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

:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-card: #1a1a24;
    --bg-card-hover: #22222e;
    --text-primary: #f5f5f7;
    --text-secondary: #a1a1aa;
    --text-muted: #71717a;
    --accent: #6366f1;
    --accent-hover: #818cf8;
    --accent-subtle: rgba(99, 102, 241, 0.1);
    --border: #27272a;
    --success: #22c55e;
    --warning: #eab308;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-full: 9999px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Header */
header {
    padding: 80px 0 60px;
    text-align: center;
    background: linear-gradient(180deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
}

header h1 {
    font-size: 3.5rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    margin-bottom: 16px;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--text-secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

header .subtitle {
    font-size: 1.25rem;
    color: var(--text-secondary);
    font-weight: 400;
    max-width: 500px;
    margin: 0 auto;
}

/* Search Section */
.search-section {
    background: var(--bg-card);
    padding: 32px;
    border-radius: var(--radius-lg);
    margin: 0 0 48px;
    border: 1px solid var(--border);
}

.search-form {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    align-items: flex-end;
}

.form-group {
    flex: 1;
    min-width: 200px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    font-size: 0.875rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.form-group input {
    width: 100%;
    padding: 14px 18px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 1rem;
    transition: all 0.2s ease;
}

.form-group input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-subtle);
}

.form-group input::placeholder {
    color: var(--text-muted);
}

.btn-primary,
.btn-secondary {
    padding: 14px 28px;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: var(--accent);
    color: white;
}

.btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--bg-card-hover);
    border-color: var(--text-muted);
}

.btn-primary:disabled,
.btn-secondary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Loading */
.loading {
    text-align: center;
    padding: 80px 24px;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 24px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading p {
    color: var(--text-secondary);
    font-size: 1rem;
}

/* Results */
.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border);
}

.results-info h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.results-info p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.sort-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sort-controls label {
    color: var(--text-muted);
    font-size: 0.875rem;
}

.sort-controls select {
    padding: 10px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.sort-controls select:focus {
    outline: none;
    border-color: var(--accent);
}

.movies-grid {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Movie Card */
.movie-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    overflow: hidden;
    display: flex;
    flex-direction: row;
    border: 1px solid var(--border);
    transition: all 0.3s ease;
}

.movie-card:hover {
    border-color: var(--text-muted);
    transform: translateY(-2px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.movie-poster {
    width: 200px;
    min-width: 200px;
    background: var(--bg-secondary);
    position: relative;
    overflow: hidden;
}

.movie-poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.movie-card:hover .movie-poster img {
    transform: scale(1.05);
}

.movie-poster .no-poster {
    width: 100%;
    height: 280px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 0.875rem;
}

.movie-info {
    flex: 1;
    padding: 28px;
}

.movie-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 12px;
    letter-spacing: -0.01em;
}

.movie-title a {
    color: var(--text-primary);
    text-decoration: none;
    transition: color 0.2s ease;
}

.movie-title a:hover {
    color: var(--accent);
}

.movie-meta {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 16px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.movie-meta span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.movie-genres {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.genre-tag {
    background: var(--accent-subtle);
    color: var(--accent);
    padding: 6px 14px;
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 500;
}

.movie-ratings {
    display: flex;
    gap: 24px;
    margin-bottom: 16px;
}

.rating {
    display: flex;
    align-items: center;
    gap: 8px;
}

.rating-value {
    font-weight: 700;
    font-size: 1.25rem;
}

.rating-press {
    color: var(--warning);
}

.rating-audience {
    color: var(--success);
}

.rating-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.movie-synopsis {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 20px;
    max-height: 72px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

/* Showtimes */
.showtimes-section {
    border-top: 1px solid var(--border);
    padding-top: 20px;
    margin-top: 8px;
}

.cinema-showtimes {
    margin-bottom: 20px;
}

.cinema-showtimes:last-child {
    margin-bottom: 0;
}

.cinema-name {
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text-primary);
}

.cinema-address {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.times-list {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.time-slot {
    background: var(--accent);
    color: white;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
}

.time-slot:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
}

.time-version {
    font-size: 0.75rem;
    opacity: 0.8;
    margin-left: 4px;
}

/* Error & No Results */
.error-message {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5;
    padding: 24px;
    border-radius: var(--radius-md);
    text-align: center;
}

.no-results {
    text-align: center;
    padding: 80px 24px;
    color: var(--text-muted);
}

/* Utility */
.hidden {
    display: none !important;
}

/* Footer */
footer {
    margin-top: 80px;
    padding: 40px 0;
    border-top: 1px solid var(--border);
    text-align: center;
    color: var(--text-muted);
    font-size: 0.875rem;
}

footer p {
    margin-bottom: 8px;
}

footer p:last-child {
    margin-bottom: 0;
}

footer a {
    color: var(--accent);
    text-decoration: none;
    transition: color 0.2s ease;
}

footer a:hover {
    color: var(--accent-hover);
}

/* Responsive */
@media (max-width: 768px) {
    header {
        padding: 60px 0 40px;
    }

    header h1 {
        font-size: 2.25rem;
    }

    header .subtitle {
        font-size: 1rem;
    }

    .search-section {
        padding: 24px;
    }

    .search-form {
        flex-direction: column;
    }

    .form-group {
        min-width: 100%;
    }

    .btn-primary,
    .btn-secondary {
        width: 100%;
        justify-content: center;
    }

    .results-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .movie-card {
        flex-direction: column;
    }

    .movie-poster {
        width: 100%;
        min-width: unset;
        height: 300px;
    }

    .movie-poster img {
        height: 300px;
    }

    .movie-info {
        padding: 20px;
    }

    .movie-title {
        font-size: 1.25rem;
    }
}
