/* Google Fonts - Noto Sans Sinhala for Sinhala support */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+Sinhala:wght@300;400;500;600;700&family=Inter:wght@300;400;500;600;700&display=swap');

/* CSS Variables for theming */
:root {
    /* Light theme (default) */
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --bg-card: #ffffff;
    --text-primary: #1a1a2e;
    --text-secondary: #4a4a68;
    --text-muted: #6c757d;
    --accent-color: #6366f1;
    --accent-hover: #4f46e5;
    --border-color: #e5e7eb;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --transition: all 0.3s ease;
}

[data-theme="dark"] {
    --bg-primary: #0f0f1a;
    --bg-secondary: #1a1a2e;
    --bg-card: #16213e;
    --text-primary: #f1f1f1;
    --text-secondary: #b8b8d0;
    --text-muted: #8888a0;
    --accent-color: #818cf8;
    --accent-hover: #a5b4fc;
    --border-color: #2d2d44;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -1px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -2px rgba(0, 0, 0, 0.4);
}

/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', 'Noto Sans Sinhala', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    transition: var(--transition);
    min-height: 100vh;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header and Navigation */
header {
    background-color: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: var(--transition);
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent-color);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo:hover {
    color: var(--accent-hover);
}

.logo svg {
    width: 28px;
    height: 28px;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
    align-items: center;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: var(--transition);
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--accent-color);
    background-color: rgba(99, 102, 241, 0.1);
}

/* Theme toggle button */
.theme-toggle {
    background: none;
    border: 2px solid var(--border-color);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    color: var(--text-secondary);
}

.theme-toggle:hover {
    border-color: var(--accent-color);
    color: var(--accent-color);
}

.theme-toggle svg {
    width: 20px;
    height: 20px;
}

.theme-toggle .sun-icon {
    display: none;
}

[data-theme="dark"] .theme-toggle .moon-icon {
    display: none;
}

[data-theme="dark"] .theme-toggle .sun-icon {
    display: block;
}

/* Mobile menu toggle */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    color: var(--text-primary);
}

.mobile-menu-toggle svg {
    width: 24px;
    height: 24px;
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
    padding: 4rem 0;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
}

.hero h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.hero p {
    font-size: 1.125rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

/* Page title */
.page-title {
    padding: 3rem 0 2rem;
    text-align: center;
}

.page-title h1 {
    font-size: 2.25rem;
    margin-bottom: 0.5rem;
}

.page-title p {
    color: var(--text-secondary);
}

/* Language toggle - HIDDEN */
.language-toggle {
    display: none;
}

/* Search and Sort Controls */
.controls {
    display: flex;
    gap: 1rem;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    margin: 2rem 0;
}

.search-box {
    position: relative;
    flex: 1;
    max-width: 400px;
}

.search-box input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.5rem;
    border: 2px solid var(--border-color);
    border-radius: 25px;
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 1rem;
    transition: var(--transition);
}

.search-box input:focus {
    outline: none;
    border-color: var(--accent-color);
}

.search-box svg {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    color: var(--text-muted);
    pointer-events: none;
}

.sort-select {
    padding: 0.75rem 2.5rem 0.75rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 25px;
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition);
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236c757d' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
}

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

.results-info {
    width: 100%;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-top: -1rem;
}

/* Reviews Grid */
.reviews-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    padding: 2rem 0 4rem;
}

/* Review Card */
.review-card {
    background: var(--bg-card);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    transition: var(--transition);
    cursor: pointer;
}

.review-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    cursor: pointer;
}

.review-card .poster-container {
    position: relative;
    overflow: hidden;
    aspect-ratio: 2/3;
}

.review-card .poster {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

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

.review-card .poster-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    padding: 2rem 1rem 1rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.review-card:hover .poster-overlay {
    opacity: 1;
}

.review-card .rating {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    color: #fbbf24;
    font-weight: 600;
}

.review-card .content {
    padding: 1.5rem;
}

.review-card .title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.review-card .meta {
    display: flex;
    gap: 1rem;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.review-card .meta span {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.review-card .watch-date {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-style: italic;
    margin-top: 0.5rem;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.modal-content {
    background: var(--bg-card);
    border-radius: 20px;
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
    animation: slideUp 0.3s ease;
    position: relative;
}

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

.modal-header {
    position: relative;
    height: 400px;
    overflow: hidden;
}

.modal-poster {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.modal-poster-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.95));
    padding: 3rem 2rem 2rem;
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(0, 0, 0, 0.7);
    border: none;
    color: white;
    font-size: 2rem;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.modal-close:hover {
    background: var(--accent-color);
    transform: rotate(90deg);
}

.modal-title {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: white;
}

.modal-info {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
    color: #e0e0e0;
    font-size: 1rem;
}

.modal-info span {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.modal-rating {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.25rem;
    color: #fbbf24;
}

.modal-body {
    padding: 2rem;
}

.modal-watch-date {
    background: var(--bg-secondary);
    padding: 1rem;
    border-radius: 10px;
    margin-bottom: 2rem;
    font-size: 0.95rem;
    color: var(--text-secondary);
    border-left: 4px solid var(--accent-color);
}

.modal-watch-date strong {
    color: var(--accent-color);
}

.modal-review {
    font-size: 1.1rem;
    line-height: 1.9;
    color: var(--text-primary);
    white-space: pre-wrap;
}

.modal-seasons {
    margin-top: 2rem;
}

.modal-seasons h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--accent-color);
}

.season-review {
    background: var(--bg-secondary);
    padding: 1.5rem;
    border-radius: 10px;
    margin-bottom: 1.5rem;
    border-left: 4px solid var(--accent-color);
    transition: var(--transition);
}

.season-review.active-season {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
    border-left-color: #764ba2;
    box-shadow: 0 8px 16px rgba(102, 126, 234, 0.3);
    transform: translateY(-2px);
}

.season-review.active-season h4,
.season-review.active-season .season-text {
    color: #ffffff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.season-review.active-season .season-meta {
    color: rgba(255, 255, 255, 0.95);
    font-weight: 500;
}

.season-review h4 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

/* Season Card Specific Styles */
.season-card {
    position: relative;
}

.season-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--accent-color);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    z-index: 10;
    box-shadow: var(--shadow-md);
}

.season-info {
    font-size: 0.9rem;
    color: var(--accent-color);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.season-meta {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.season-meta span {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.season-rating {
    color: #fbbf24;
    font-weight: 600;
}

.season-watch-date {
    font-style: italic;
}

.season-text {
    margin-top: 1rem;
    line-height: 1.8;
    color: var(--text-secondary);
}

/* About Page Styles */
.about-section {
    padding: 3rem 0;
}

.about-content {
    max-width: 800px;
    margin: 0 auto;
}

.about-card {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 2.5rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
}

.about-card h2 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--accent-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.about-card h2 svg {
    width: 24px;
    height: 24px;
}

.about-card p {
    color: var(--text-secondary);
    line-height: 1.8;
}

.about-card blockquote {
    background: var(--bg-secondary);
    border-left: 4px solid var(--accent-color);
    padding: 1.5rem;
    margin: 1rem 0;
    border-radius: 0 8px 8px 0;
    font-style: italic;
    color: var(--text-secondary);
}

.profile-section {
    text-align: center;
    margin-bottom: 2rem;
}

.profile-avatar {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-color), var(--accent-hover));
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    font-size: 4rem;
}

/* Footer */
footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    padding: 2rem 0;
    text-align: center;
    color: var(--text-muted);
}

footer a {
    color: var(--accent-color);
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-muted);
}

.empty-state svg {
    width: 64px;
    height: 64px;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* Loading state */
.loading {
    display: flex;
    justify-content: center;
    padding: 4rem;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top-color: var(--accent-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Responsive Design */
@media (max-width: 768px) {
    .nav-links {
        position: fixed;
        top: 70px;
        left: 0;
        right: 0;
        background: var(--bg-secondary);
        flex-direction: column;
        padding: 1rem;
        gap: 0.5rem;
        border-bottom: 1px solid var(--border-color);
        transform: translateY(-150%);
        opacity: 0;
        transition: var(--transition);
        z-index: 999;
    }

    .nav-links.active {
        transform: translateY(0);
        opacity: 1;
    }

    .nav-links a {
        display: block;
        padding: 1rem;
        text-align: center;
    }

    .mobile-menu-toggle {
        display: block;
    }

    .theme-toggle-desktop {
        display: none;
    }

    .hero h1 {
        font-size: 1.75rem;
    }

    .hero p {
        font-size: 1rem;
    }

    .page-title h1 {
        font-size: 1.75rem;
    }

    .reviews-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 1.5rem;
    }

    .about-card {
        padding: 1.5rem;
    }

    .profile-avatar {
        width: 120px;
        height: 120px;
        font-size: 3rem;
    }

    /* Modal responsive */
    .modal.active {
        padding: 0;
    }

    .modal-content {
        max-height: 100vh;
        border-radius: 0;
        height: 100%;
    }

    .modal-header {
        height: 300px;
    }

    .modal-title {
        font-size: 1.75rem;
    }

    .modal-body {
        padding: 1.5rem;
    }

    .modal-review {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }

    .reviews-grid {
        grid-template-columns: 1fr;
    }

    .language-toggle {
        flex-wrap: wrap;
    }

    .lang-btn {
        flex: 1;
        min-width: 100px;
    }
}

/* Utility classes */
.text-center {
    text-align: center;
}

.mb-1 {
    margin-bottom: 0.5rem;
}

.mb-2 {
    margin-bottom: 1rem;
}

.mb-3 {
    margin-bottom: 1.5rem;
}

.mt-2 {
    margin-top: 1rem;
}

.mt-3 {
    margin-top: 1.5rem;
}
