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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    background: #0a0a0a;
    color: #f0f0f0;
    min-height: 100vh;
    padding: 0;
}

.flashbar {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    color: #1a1a1a;
    padding: 0.75rem 2rem;
    text-align: center;
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    box-shadow: 0 2px 8px rgba(251, 191, 36, 0.15);
}

.flashbar p {
    margin: 0;
    line-height: 1.4;
}

.container {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 1.5rem 2rem;
}

.input-section {
    text-align: center;
    margin-bottom: 1.5rem;
}

h1 {
    font-size: 2rem;
    font-weight: 300;
    letter-spacing: 0.1em;
    margin-bottom: 0.75rem;
    text-transform: lowercase;
    color: #ffffff;
}

.suggestion-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    margin-bottom: 1rem;
}

.chip {
    background: transparent;
    border: 1px solid #333;
    color: #888;
    font-size: 0.75rem;
    padding: 0.4rem 1rem;
    margin: 0;
    cursor: pointer;
    letter-spacing: 0.05em;
    text-transform: lowercase;
    transition: all 0.3s ease;
    border-radius: 20px;
}

.chip:hover {
    border-color: #666;
    color: #ccc;
    background: #111;
}

#emotion-input {
    background: transparent;
    border: none;
    border-bottom: 1px solid #333;
    color: #f0f0f0;
    font-size: 1.2rem;
    padding: 0.5rem 0;
    width: 100%;
    max-width: 500px;
    text-align: center;
    outline: none;
    transition: border-color 0.3s ease;
}

#emotion-input::placeholder {
    color: #555;
}

#emotion-input:focus {
    border-bottom-color: #888;
}

button {
    background: transparent;
    border: 1px solid #333;
    color: #f0f0f0;
    font-size: 0.85rem;
    padding: 0.5rem 1.5rem;
    margin-top: 1rem;
    cursor: pointer;
    letter-spacing: 0.1em;
    text-transform: lowercase;
    transition: all 0.3s ease;
}

button:hover {
    border-color: #888;
    background: #111;
}

.results {
    opacity: 1;
    transition: opacity 0.3s ease;
}

.results.hidden {
    opacity: 0;
    pointer-events: none;
    position: absolute;
}

.movies-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.2rem;
    margin-bottom: 2rem;
    max-width: 720px;
    margin-left: auto;
    margin-right: auto;
}

.movies-grid.hidden {
    display: none;
}

.movie-card {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.6s ease forwards;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.movie-card:nth-child(1) { animation-delay: 0.05s; }
.movie-card:nth-child(2) { animation-delay: 0.1s; }
.movie-card:nth-child(3) { animation-delay: 0.15s; }
.movie-card:nth-child(4) { animation-delay: 0.2s; }

.movie-card:hover {
    transform: translateY(-5px);
}

.movie-poster {
    width: 100%;
    aspect-ratio: 2/3;
    border-radius: 4px;
    background: #1a1a1a;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    position: relative;
    overflow: hidden;
}

.poster-title {
    font-size: 0.85rem;
    font-weight: 400;
    text-align: center;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.3;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.poster-year {
    font-size: 0.7rem;
    font-weight: 300;
    text-align: center;
    color: rgba(255, 255, 255, 0.6);
    margin-top: 0.4rem;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.regenerate-btn {
    display: block;
    margin: 0 auto;
}

.loading {
    text-align: center;
    padding: 3rem 0;
}

.loading.hidden {
    display: none;
}

.spinner {
    width: 40px;
    height: 40px;
    margin: 0 auto 1rem;
    border: 3px solid #333;
    border-top: 3px solid #888;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.loading p {
    color: #888;
    font-size: 0.9rem;
    letter-spacing: 0.1em;
    text-transform: lowercase;
}

@media (max-width: 768px) {
    .movies-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 568px) {
    h1 {
        font-size: 2rem;
    }

    #emotion-input {
        font-size: 1.2rem;
    }

    .movies-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
}

.modal-content {
    position: relative;
    max-width: 900px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 2rem;
    color: #888;
    cursor: pointer;
    z-index: 10;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.3s ease;
}

.modal-close:hover {
    color: #fff;
}

.modal-body {
    display: flex;
    gap: 2rem;
    background: #111;
    border-radius: 8px;
    overflow: hidden;
}

.modal-poster {
    width: 300px;
    min-width: 300px;
    height: 450px;
    background: #1a1a1a;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    border-radius: 4px 0 0 4px;
}

.modal-poster-title {
    font-size: 1.5rem;
    font-weight: 400;
    text-align: center;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.3;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.modal-info {
    flex: 1;
    padding: 2rem;
    padding-left: 0;
}

.modal-info h2 {
    font-size: 2rem;
    font-weight: 300;
    margin-bottom: 0.5rem;
    color: #fff;
}

.modal-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.9rem;
    color: #888;
    margin-bottom: 1.5rem;
}

.separator {
    color: #444;
}

.modal-info p {
    line-height: 1.6;
    color: #ccc;
    font-size: 1rem;
}

@media (max-width: 768px) {
    .modal-body {
        flex-direction: column;
    }

    .modal-poster {
        width: 100%;
        min-width: unset;
        height: auto;
        aspect-ratio: 2/3;
        border-radius: 4px 4px 0 0;
    }

    .modal-info {
        padding: 2rem;
    }

    .modal-info h2 {
        font-size: 1.5rem;
    }
}
