* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: rgb(241, 205, 0); /* Yellow accent */
    --secondary-color: #4169E1; /* Blue accent */
    --bg-color: #ffffff; /* White background */
    --postit-yellow: #FFEB3B; /* Classic post-it yellow */
    --postit-pink: #F8BBD0; /* Pink post-it */
    --postit-blue: #B3E5FC; /* Blue post-it */
    --postit-green: #C5E1A5; /* Green post-it */
    --text-primary: #1a1a1a; /* Dark text */
    --text-secondary: #666666; /* Gray text */
    --border-color: #e0e0e0; /* Light gray borders */
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-color);
    color: var(--text-primary);
    min-height: 100vh;
    padding: 40px 20px;
    line-height: 1.6;
}

.container {
    max-width: 900px;
    margin: 0 auto;
}

header {
    text-align: left;
    margin-bottom: 60px;
    padding: 0;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 30px;
}

header h1 {
    font-size: 2rem;
    font-weight: 400;
    margin-bottom: 8px;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

header h1 .highlight {
    color: var(--primary-color);
    font-weight: 500;
}

.subtitle {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-bottom: 0;
    font-weight: 400;
}

.description {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-top: 12px;
}

.description a {
    color: var(--text-primary);
    text-decoration: none;
    border-bottom: 1px solid var(--text-primary);
    transition: border-color 0.2s;
}

.description a:hover {
    border-bottom-color: var(--primary-color);
}

.loading {
    text-align: center;
    padding: 60px 20px;
    display: none;
}

.loading.show {
    display: block;
}

.spinner {
    border: 2px solid var(--border-color);
    border-top: 2px solid var(--text-primary);
    border-radius: 50%;
    width: 24px;
    height: 24px;
    animation: spin 1s linear infinite;
    margin: 0 auto 16px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.messages-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
    margin-bottom: 60px;
}

.message-card {
    background: var(--postit-yellow);
    padding: 20px;
    box-shadow: 2px 2px 8px rgba(0, 0, 0, 0.15), 0 0 1px rgba(0, 0, 0, 0.1);
    transform: rotate(-1deg);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    position: relative;
    min-height: 180px;
}

.message-card:nth-child(3n+1) {
    background: var(--postit-yellow);
    transform: rotate(-1.5deg);
}

.message-card:nth-child(3n+2) {
    background: var(--postit-pink);
    transform: rotate(1deg);
}

.message-card:nth-child(3n+3) {
    background: var(--postit-blue);
    transform: rotate(0.5deg);
}

.message-card:nth-child(4n+1) {
    background: var(--postit-green);
}

.message-card:hover {
    transform: rotate(0deg) scale(1.02);
    box-shadow: 4px 4px 12px rgba(0, 0, 0, 0.2), 0 0 2px rgba(0, 0, 0, 0.15);
    z-index: 1;
}

.message-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    padding-bottom: 8px;
}


.message-content {
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--text-primary);
    margin-bottom: 0;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.message-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.7rem;
    color: var(--text-secondary);
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.timestamp {
    font-style: normal;
}

.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 80px 20px;
    color: var(--text-secondary);
}

.empty-state h2 {
    font-size: 1.1rem;
    font-weight: 400;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.error-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px 20px;
    border-left: 3px solid #ef4444;
    color: var(--text-secondary);
}

footer {
    text-align: left;
    padding: 40px 0 0 0;
    color: var(--text-secondary);
    font-size: 0.75rem;
    border-top: 1px solid var(--border-color);
    margin-top: 60px;
}

footer p {
    margin: 4px 0;
}

/* Responsive Design */
@media (max-width: 768px) {
    body {
        padding: 24px 16px;
    }

    header h1 {
        font-size: 1.75rem;
    }

    .messages-container {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .message-card {
        padding: 18px;
        transform: rotate(0deg);
    }

    .message-card:nth-child(3n+1),
    .message-card:nth-child(3n+2),
    .message-card:nth-child(3n+3),
    .message-card:nth-child(4n+1) {
        transform: rotate(0deg);
    }
}

/* Animation for new messages */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.message-card {
    animation: fadeIn 0.3s ease-out;
}

