/* ============================================
   Cinema & Character - Professional Styling
   Mobile-First Responsive Design
   Optimized for SEO, Performance, & Engagement
   ============================================ */

/* CSS Variables for Consistent Theming */
:root {
    /* Brand Colors - Professional Palette */
    --primary-color: #1a2332;
    --primary-light: #2c3e50;
    --secondary-color: #2980b9;
    --secondary-light: #3498db;
    --accent-color: #e67e22;
    --accent-hover: #d35400;
    --success-color: #27ae60;
    --warning-color: #f39c12;
    --danger-color: #e74c3c;

    /* Neutral Colors */
    --text-primary: #2c3e50;
    --text-secondary: #7f8c8d;
    --text-light: #95a5a6;
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --bg-tertiary: #ecf0f1;
    --border-color: #e1e8ed;

    /* Gamification Colors */
    --badge-bronze: #cd7f32;
    --badge-silver: #c0c0c0;
    --badge-gold: #ffd700;
    --badge-platinum: #e5e4e2;
    --xp-bar: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    --achievement-glow: rgba(102, 126, 234, 0.3);

    /* Shadows & Effects */
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
    --shadow-xl: 0 12px 40px rgba(0, 0, 0, 0.15);
    --shadow-glow: 0 0 20px var(--achievement-glow);

    /* Border Radius */
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;

    /* Spacing Scale */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    --space-3xl: 4rem;

    /* Typography */
    --font-primary: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    --font-display: 'Georgia', 'Times New Roman', serif;
    --font-mono: 'SF Mono', 'Monaco', 'Consolas', monospace;

    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);

    /* Z-Index Scale */
    --z-dropdown: 1000;
    --z-sticky: 1020;
    --z-fixed: 1030;
    --z-modal-backdrop: 1040;
    --z-modal: 1050;
    --z-popover: 1060;
    --z-tooltip: 1070;
}

/* ============================================
   RESET & BASE STYLES
   ============================================ */

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

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    scroll-behavior: smooth;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: var(--font-primary);
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-secondary);
    overflow-x: hidden;
}

/* Typography Scale */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: var(--space-md);
    color: var(--primary-color);
}

h1 {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-family: var(--font-display);
    letter-spacing: -0.02em;
}

h2 {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    letter-spacing: -0.01em;
}

h3 {
    font-size: clamp(1.5rem, 3vw, 2rem);
}

h4 {
    font-size: clamp(1.25rem, 2.5vw, 1.5rem);
}

p {
    margin-bottom: var(--space-md);
}

a {
    color: var(--secondary-color);
    text-decoration: none;
    transition: color var(--transition-fast);
}

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

img {
    max-width: 100%;
    height: auto;
    display: block;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
}

/* ============================================
   LAYOUT CONTAINERS
   ============================================ */

.container {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 var(--space-md);
}

@media (min-width: 768px) {
    .container {
        padding: 0 var(--space-xl);
    }
}

@media (min-width: 1024px) {
    .container {
        padding: 0 var(--space-2xl);
    }
}

/* ============================================
   HEADER & NAVIGATION
   ============================================ */

header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    color: white;
    padding: var(--space-lg) 0;
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 0;
    z-index: var(--z-sticky);
    transition: padding var(--transition-base);
}

header.scrolled {
    padding: var(--space-md) 0;
    box-shadow: var(--shadow-lg);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--space-md);
}

.site-branding {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.site-title {
    font-size: clamp(1.5rem, 3vw, 2.5rem);
    margin: 0;
    color: white;
    font-family: var(--font-display);
    letter-spacing: -0.02em;
}

.site-title a {
    color: white;
    transition: opacity var(--transition-fast);
}

.site-title a:hover {
    opacity: 0.9;
}

.tagline {
    font-size: clamp(0.875rem, 1.5vw, 1rem);
    opacity: 0.9;
    margin: 0;
    font-weight: 400;
}

/* Hamburger Menu Button */
.menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    padding: var(--space-sm);
    background: transparent;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-base);
}

.menu-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: white;
    transition: all var(--transition-base);
}

.menu-toggle:hover {
    border-color: rgba(255, 255, 255, 0.6);
}

.menu-toggle.active span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* Navigation */
nav ul {
    list-style: none;
    display: flex;
    gap: var(--space-lg);
    flex-wrap: wrap;
    align-items: center;
}

nav a {
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
    font-size: 1rem;
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
    position: relative;
}

nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--accent-color);
    transition: all var(--transition-base);
    transform: translateX(-50%);
}

nav a:hover {
    color: white;
    background: rgba(255, 255, 255, 0.1);
}

nav a:hover::after {
    width: 80%;
}

nav a.active {
    background: rgba(255, 255, 255, 0.15);
    color: white;
}

/* Mobile Navigation */
@media (max-width: 768px) {
    .menu-toggle {
        display: flex;
    }

    nav {
        width: 100%;
        max-height: 0;
        overflow: hidden;
        transition: max-height var(--transition-slow);
    }

    nav.active {
        max-height: 500px;
    }

    nav ul {
        flex-direction: column;
        gap: 0;
        padding: var(--space-md) 0;
        width: 100%;
    }

    nav li {
        width: 100%;
    }

    nav a {
        display: block;
        width: 100%;
        padding: var(--space-md);
        border-radius: 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }
}

/* ============================================
   HERO SECTION
   ============================================ */

.hero {
    background: linear-gradient(135deg, rgba(26, 35, 50, 0.95) 0%, rgba(44, 62, 80, 0.95) 100%),
                url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1200 120"><path d="M0,0 Q300,80 600,60 T1200,40 L1200,120 L0,120 Z" fill="rgba(255,255,255,0.03)"/></svg>');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    color: white;
    padding: var(--space-3xl) 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(52, 152, 219, 0.1) 0%, transparent 70%);
    animation: heroFloat 20s ease-in-out infinite;
}

@keyframes heroFloat {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    50% { transform: translate(50px, 50px) rotate(180deg); }
}

.hero-content {
    position: relative;
    z-index: 1;
}

.hero h1 {
    color: white;
    margin-bottom: var(--space-lg);
    text-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.hero p {
    font-size: clamp(1.125rem, 2vw, 1.5rem);
    max-width: 800px;
    margin: 0 auto var(--space-xl);
    opacity: 0.95;
    line-height: 1.7;
}

.cta-button {
    display: inline-block;
    padding: var(--space-md) var(--space-xl);
    background: var(--accent-color);
    color: white;
    font-size: 1.125rem;
    font-weight: 600;
    border-radius: var(--radius-full);
    box-shadow: var(--shadow-lg);
    transition: all var(--transition-base);
    border: 2px solid transparent;
}

.cta-button:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-xl);
}

.cta-button:active {
    transform: translateY(0);
}

/* ============================================
   GAMIFICATION ELEMENTS
   ============================================ */

/* User Progress Bar */
.user-progress-container {
    background: white;
    padding: var(--space-lg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    margin: var(--space-xl) 0;
    border: 2px solid var(--border-color);
}

.user-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
}

.stat-item {
    text-align: center;
    padding: var(--space-md);
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    transition: all var(--transition-base);
}

.stat-item:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--secondary-color);
    display: block;
    margin-bottom: var(--space-xs);
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

/* XP Progress Bar */
.xp-progress {
    margin-top: var(--space-lg);
}

.xp-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-sm);
}

.xp-label {
    font-weight: 600;
    color: var(--text-primary);
}

.xp-value {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.xp-bar {
    height: 24px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-full);
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.xp-fill {
    height: 100%;
    background: var(--xp-bar);
    border-radius: var(--radius-full);
    transition: width var(--transition-slow);
    position: relative;
    overflow: hidden;
}

.xp-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* Achievements Grid */
.achievements-section {
    margin: var(--space-2xl) 0;
}

.achievements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: var(--space-lg);
    margin-top: var(--space-lg);
}

.achievement-card {
    background: white;
    padding: var(--space-lg);
    border-radius: var(--radius-lg);
    text-align: center;
    transition: all var(--transition-base);
    border: 2px solid var(--border-color);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.achievement-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, var(--achievement-glow) 0%, transparent 70%);
    opacity: 0;
    transition: opacity var(--transition-base);
}

.achievement-card.unlocked::before {
    opacity: 1;
}

.achievement-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
}

.achievement-card.unlocked {
    border-color: var(--secondary-color);
    box-shadow: var(--shadow-glow);
}

.achievement-card.locked {
    opacity: 0.5;
    filter: grayscale(100%);
}

.achievement-icon {
    font-size: 3rem;
    margin-bottom: var(--space-md);
    position: relative;
    z-index: 1;
}

.achievement-title {
    font-weight: 600;
    margin-bottom: var(--space-sm);
    color: var(--text-primary);
    position: relative;
    z-index: 1;
}

.achievement-description {
    font-size: 0.875rem;
    color: var(--text-secondary);
    position: relative;
    z-index: 1;
}

.achievement-progress {
    margin-top: var(--space-md);
    font-size: 0.75rem;
    color: var(--text-light);
    font-weight: 600;
    position: relative;
    z-index: 1;
}

/* Badge System */
.badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-xs) var(--space-md);
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    box-shadow: var(--shadow-sm);
}

.badge-bronze {
    background: linear-gradient(135deg, #cd7f32 0%, #b87333 100%);
    color: white;
}

.badge-silver {
    background: linear-gradient(135deg, #c0c0c0 0%, #a8a8a8 100%);
    color: var(--text-primary);
}

.badge-gold {
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
    color: var(--text-primary);
}

.badge-platinum {
    background: linear-gradient(135deg, #e5e4e2 0%, #b8b8b8 100%);
    color: var(--text-primary);
}

/* ============================================
   FILMS GRID
   ============================================ */

.films-section {
    padding: var(--space-3xl) 0;
}

.section-header {
    text-align: center;
    margin-bottom: var(--space-2xl);
}

.section-subtitle {
    font-size: clamp(1rem, 2vw, 1.25rem);
    color: var(--text-secondary);
    max-width: 700px;
    margin: 0 auto;
}

/* Film Filters */
.film-filters {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-md);
    justify-content: center;
    margin-bottom: var(--space-2xl);
    padding: var(--space-lg);
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.filter-button {
    padding: var(--space-sm) var(--space-lg);
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 2px solid transparent;
    border-radius: var(--radius-full);
    font-weight: 600;
    font-size: 0.875rem;
    transition: all var(--transition-fast);
    cursor: pointer;
    min-width: 44px;
    min-height: 44px;
}

.filter-button:hover {
    background: var(--bg-tertiary);
    transform: translateY(-2px);
}

.filter-button.active {
    background: var(--secondary-color);
    color: white;
    border-color: var(--secondary-color);
}

/* Films Grid */
.films-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: var(--space-xl);
    margin-top: var(--space-xl);
}

@media (max-width: 480px) {
    .films-grid {
        grid-template-columns: 1fr;
        gap: var(--space-lg);
    }
}

/* Film Card */
.film-card {
    background: white;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: all var(--transition-base);
    border: 2px solid transparent;
    position: relative;
    display: flex;
    flex-direction: column;
}

.film-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
    border-color: var(--secondary-color);
}

.film-card.watched {
    border-color: var(--success-color);
}

.film-card.watched::after {
    content: '✓ Watched';
    position: absolute;
    top: var(--space-md);
    right: var(--space-md);
    background: var(--success-color);
    color: white;
    padding: var(--space-xs) var(--space-md);
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 700;
    z-index: 2;
    box-shadow: var(--shadow-md);
}

.film-rank {
    position: absolute;
    top: var(--space-md);
    left: var(--space-md);
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--accent-color) 0%, var(--accent-hover) 100%);
    color: white;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.25rem;
    box-shadow: var(--shadow-lg);
    z-index: 2;
}

.film-thumbnail-link {
    display: block;
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.film-thumbnail {
    width: 100%;
    height: 200px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-color: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    transition: transform var(--transition-base);
}

.film-thumbnail-link:hover .film-thumbnail {
    transform: scale(1.05);
}

.film-thumbnail-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity var(--transition-base);
}

.film-thumbnail-link:hover .film-thumbnail-overlay {
    opacity: 1;
}

.play-icon {
    width: 60px;
    height: 60px;
    color: white;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.4));
    transition: transform var(--transition-fast);
}

.film-thumbnail-link:hover .play-icon {
    transform: scale(1.1);
}

/* Fallback for missing thumbnails */
.film-thumbnail:empty::after,
.film-thumbnail[style*="undefined"]::after {
    content: '🎬';
    font-size: 4rem;
    opacity: 0.3;
}

.film-content {
    padding: var(--space-lg);
    flex: 1;
    display: flex;
    flex-direction: column;
}

.film-title {
    font-size: 1.5rem;
    margin-bottom: var(--space-sm);
    color: var(--primary-color);
    line-height: 1.3;
}

.film-meta {
    display: flex;
    gap: var(--space-md);
    flex-wrap: wrap;
    margin-bottom: var(--space-md);
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.film-description {
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: var(--space-lg);
    flex: 1;
}

.film-tags {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
    margin-bottom: var(--space-lg);
}

.tag {
    padding: var(--space-xs) var(--space-md);
    background: var(--bg-secondary);
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 600;
    transition: all var(--transition-fast);
}

.tag:hover {
    background: var(--secondary-light);
    color: white;
}

.film-actions {
    display: flex;
    gap: var(--space-md);
    margin-top: auto;
}

.btn {
    flex: 1;
    padding: var(--space-md);
    text-align: center;
    border-radius: var(--radius-md);
    font-weight: 600;
    transition: all var(--transition-fast);
    cursor: pointer;
    border: 2px solid transparent;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
}

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

.btn-primary:hover {
    background: var(--secondary-light);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-outline {
    background: transparent;
    color: var(--secondary-color);
    border-color: var(--secondary-color);
}

.btn-outline:hover {
    background: var(--secondary-color);
    color: white;
}

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

/* User Rating */
.user-rating {
    display: flex;
    gap: var(--space-xs);
    margin-top: var(--space-md);
    justify-content: center;
}

.star {
    font-size: 1.5rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    filter: grayscale(100%);
    opacity: 0.3;
}

.star.filled {
    filter: grayscale(0%);
    opacity: 1;
    color: var(--badge-gold);
}

.star:hover {
    transform: scale(1.2);
    filter: grayscale(0%);
    opacity: 1;
}

/* ============================================
   MOVIE DETAIL PAGE
   ============================================ */

.movie-detail {
    background: white;
    margin: var(--space-2xl) 0;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.movie-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    color: white;
    padding: var(--space-2xl);
}

.movie-title-section {
    display: flex;
    align-items: start;
    gap: var(--space-xl);
    flex-wrap: wrap;
}

.movie-rank-large {
    width: 80px;
    height: 80px;
    background: var(--accent-color);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    font-weight: 700;
    box-shadow: var(--shadow-xl);
    flex-shrink: 0;
}

.movie-info {
    flex: 1;
}

.movie-title-main {
    font-size: clamp(2rem, 5vw, 3rem);
    margin-bottom: var(--space-md);
    color: white;
}

.movie-meta-detail {
    display: flex;
    gap: var(--space-xl);
    flex-wrap: wrap;
    font-size: 1.125rem;
    opacity: 0.9;
}

.movie-content-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-2xl);
    padding: var(--space-2xl);
}

@media (min-width: 1024px) {
    .movie-content-grid {
        grid-template-columns: 2fr 1fr;
    }
}

.movie-main-content {
    display: flex;
    flex-direction: column;
    gap: var(--space-2xl);
}

.movie-sidebar {
    display: flex;
    flex-direction: column;
    gap: var(--space-xl);
}

.content-section {
    background: var(--bg-secondary);
    padding: var(--space-xl);
    border-radius: var(--radius-lg);
    border-left: 4px solid var(--secondary-color);
}

.content-section h3 {
    color: var(--primary-color);
    margin-bottom: var(--space-lg);
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.video-container {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    height: 0;
    overflow: hidden;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Characters Grid */
.characters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: var(--space-lg);
}

.character-card {
    background: white;
    padding: var(--space-lg);
    border-radius: var(--radius-md);
    text-align: center;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-base);
}

.character-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.character-name {
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: var(--space-sm);
}

.character-traits {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-xs);
    justify-content: center;
    margin-top: var(--space-md);
}

/* Reviews */
.reviews-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
}

.review-item {
    background: white;
    padding: var(--space-lg);
    border-radius: var(--radius-md);
    border-left: 3px solid var(--accent-color);
    box-shadow: var(--shadow-sm);
}

.review-text {
    font-style: italic;
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: var(--space-md);
}

.review-source {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.875rem;
}

/* ============================================
   BLOG & ARTICLES
   ============================================ */

.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: var(--space-xl);
}

.article-card {
    background: white;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: all var(--transition-base);
}

.article-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
}

.article-image {
    width: 100%;
    height: 250px;
    object-fit: cover;
    background: var(--bg-tertiary);
}

.article-content {
    padding: var(--space-xl);
}

.article-title {
    font-size: 1.5rem;
    margin-bottom: var(--space-md);
    color: var(--primary-color);
}

.article-excerpt {
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: var(--space-lg);
}

.read-more {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    color: var(--secondary-color);
    font-weight: 600;
    transition: gap var(--transition-fast);
}

.read-more:hover {
    gap: var(--space-md);
}

/* Article Detail */
.article-detail {
    background: white;
    margin: var(--space-2xl) 0;
    padding: var(--space-3xl);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}

.article-detail h1 {
    margin-bottom: var(--space-xl);
}

.article-detail img {
    width: 100%;
    border-radius: var(--radius-md);
    margin: var(--space-xl) 0;
    box-shadow: var(--shadow-md);
}

.article-detail p {
    font-size: 1.125rem;
    line-height: 1.8;
    margin-bottom: var(--space-xl);
}

.article-detail h2 {
    margin-top: var(--space-2xl);
    margin-bottom: var(--space-lg);
}

/* ============================================
   FORMS
   ============================================ */

form {
    background: white;
    padding: var(--space-2xl);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    max-width: 700px;
    margin: 0 auto;
}

.form-group {
    margin-bottom: var(--space-xl);
}

label {
    display: block;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-sm);
}

input[type="text"],
input[type="email"],
input[type="url"],
textarea,
select {
    width: 100%;
    padding: var(--space-md);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 1rem;
    transition: all var(--transition-fast);
    background: var(--bg-primary);
    min-height: 44px;
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

textarea {
    min-height: 150px;
    resize: vertical;
}

.form-hint {
    font-size: 0.875rem;
    color: var(--text-light);
    margin-top: var(--space-sm);
}

button[type="submit"] {
    width: 100%;
    padding: var(--space-lg);
    background: var(--secondary-color);
    color: white;
    font-size: 1.125rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    transition: all var(--transition-base);
    cursor: pointer;
    border: none;
    min-height: 44px;
}

button[type="submit"]:hover {
    background: var(--secondary-light);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

button[type="submit"]:active {
    transform: translateY(0);
}

/* ============================================
   FOOTER
   ============================================ */

footer {
    background: var(--primary-color);
    color: rgba(255, 255, 255, 0.9);
    padding: var(--space-2xl) 0 var(--space-xl);
    margin-top: var(--space-3xl);
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--space-2xl);
    margin-bottom: var(--space-xl);
}

.footer-section h3 {
    color: white;
    margin-bottom: var(--space-lg);
    font-size: 1.25rem;
}

.footer-section p {
    line-height: 1.8;
    opacity: 0.9;
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: var(--space-md);
}

.footer-links a {
    color: rgba(255, 255, 255, 0.9);
    transition: all var(--transition-fast);
    display: inline-block;
}

.footer-links a:hover {
    color: white;
    transform: translateX(4px);
}

.social-links {
    display: flex;
    gap: var(--space-md);
    margin-top: var(--space-lg);
}

.social-link {
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.25rem;
    transition: all var(--transition-base);
}

.social-link:hover {
    background: var(--secondary-color);
    transform: translateY(-4px);
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: var(--space-lg);
    text-align: center;
    font-size: 0.875rem;
    opacity: 0.8;
}

/* ============================================
   UTILITY CLASSES
   ============================================ */

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mt-0 { margin-top: 0; }
.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mt-xl { margin-top: var(--space-xl); }

.mb-0 { margin-bottom: 0; }
.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.mb-xl { margin-bottom: var(--space-xl); }

.hidden { display: none !important; }
.visible { display: block !important; }

/* Loading States */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
}

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

/* Accessibility */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Focus Styles */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
    outline: 3px solid var(--secondary-color);
    outline-offset: 2px;
}

/* Print Styles */
@media print {
    header, footer, nav, .cta-button, .film-actions, .achievements-section {
        display: none;
    }

    body {
        background: white;
        color: black;
    }

    .film-card, .article-card {
        page-break-inside: avoid;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    :root {
        --border-color: #000;
        --text-secondary: #000;
    }

    .btn {
        border-width: 3px;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Dark Mode Support (Optional) */
@media (prefers-color-scheme: dark) {
    /* Uncomment to enable dark mode */
    /*
    :root {
        --primary-color: #1e293b;
        --text-primary: #e2e8f0;
        --bg-primary: #0f172a;
        --bg-secondary: #1e293b;
        --bg-tertiary: #334155;
        --border-color: #475569;
        --card-bg: #1e293b;
    }
    */
}

/* ============================================
   SOCIAL SHARING COMPONENT
   Modern SVG-based social sharing buttons
   ============================================ */

.social-share {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-md);
    align-items: center;
    padding: var(--space-lg) 0;
    border-top: 1px solid var(--border-color);
    margin-top: var(--space-xl);
}

.social-share-label {
    font-weight: 600;
    color: var(--text-primary);
    margin-right: var(--space-md);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.social-share-buttons {
    display: flex;
    gap: var(--space-sm);
    flex-wrap: wrap;
}

.share-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    transition: all var(--transition-base);
    cursor: pointer;
    border: none;
    position: relative;
    overflow: hidden;
}

.share-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.share-btn:hover::before {
    opacity: 0.15;
}

.share-btn:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.share-btn:active {
    transform: translateY(-1px);
}

.share-btn svg {
    width: 22px;
    height: 22px;
    position: relative;
    z-index: 1;
    transition: transform var(--transition-fast);
}

.share-btn:hover svg {
    transform: scale(1.1);
}

/* Twitter/X */
.share-btn--twitter {
    background: #000000;
    color: white;
}

.share-btn--twitter:hover {
    background: #1a1a1a;
}

/* Facebook */
.share-btn--facebook {
    background: #1877f2;
    color: white;
}

.share-btn--facebook:hover {
    background: #0d65d9;
}

/* WhatsApp */
.share-btn--whatsapp {
    background: #25d366;
    color: white;
}

.share-btn--whatsapp:hover {
    background: #1da851;
}

/* LinkedIn */
.share-btn--linkedin {
    background: #0a66c2;
    color: white;
}

.share-btn--linkedin:hover {
    background: #084d93;
}

/* Email */
.share-btn--email {
    background: var(--primary-color);
    color: white;
}

.share-btn--email:hover {
    background: var(--primary-light);
}

/* Reddit */
.share-btn--reddit {
    background: #ff4500;
    color: white;
}

.share-btn--reddit:hover {
    background: #e03d00;
}

/* Copy Link */
.share-btn--copy {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.share-btn--copy:hover {
    background: var(--secondary-color);
    color: white;
}

.share-btn--copy.copied {
    background: var(--success-color);
    color: white;
}

/* Share button with text (for larger displays) */
.share-btn-full {
    width: auto;
    padding: var(--space-sm) var(--space-lg);
    gap: var(--space-sm);
    font-weight: 600;
    font-size: 0.875rem;
}

@media (max-width: 640px) {
    .share-btn-full span {
        display: none;
    }
    .share-btn-full {
        width: 44px;
        padding: var(--space-sm);
    }
}

/* Floating share bar for articles */
.share-floating {
    position: fixed;
    left: var(--space-lg);
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    z-index: var(--z-fixed);
    padding: var(--space-md);
    background: rgba(255, 255, 255, 0.95);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

@media (max-width: 1200px) {
    .share-floating {
        display: none;
    }
}

/* Inline share for mobile */
.share-inline {
    display: none;
}

@media (max-width: 1200px) {
    .share-inline {
        display: flex;
    }
}

/* ============================================
   MODERN GLASSMORPHISM CARDS
   ============================================ */

.glass-card {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

/* ============================================
   ENHANCED HOVER ANIMATIONS
   ============================================ */

.hover-lift {
    transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.hover-lift:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
}

.hover-glow {
    transition: box-shadow var(--transition-base);
}

.hover-glow:hover {
    box-shadow: 0 0 30px rgba(52, 152, 219, 0.3);
}

/* Gradient text effect */
.gradient-text {
    background: linear-gradient(135deg, var(--secondary-color) 0%, var(--accent-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ============================================
   MODERN BUTTON STYLES
   ============================================ */

.btn-gradient {
    background: linear-gradient(135deg, var(--secondary-color) 0%, var(--accent-color) 100%);
    color: white;
    border: none;
    position: relative;
    overflow: hidden;
}

.btn-gradient::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left var(--transition-slow);
}

.btn-gradient:hover::before {
    left: 100%;
}

/* ============================================
   SCROLL ANIMATIONS
   ============================================ */

.fade-in-up {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.fade-in-up.visible {
    opacity: 1;
    transform: translateY(0);
}

.stagger-children > * {
    opacity: 0;
    transform: translateY(20px);
}

.stagger-children.visible > * {
    opacity: 1;
    transform: translateY(0);
}

.stagger-children.visible > *:nth-child(1) { transition-delay: 0.1s; }
.stagger-children.visible > *:nth-child(2) { transition-delay: 0.2s; }
.stagger-children.visible > *:nth-child(3) { transition-delay: 0.3s; }
.stagger-children.visible > *:nth-child(4) { transition-delay: 0.4s; }
.stagger-children.visible > *:nth-child(5) { transition-delay: 0.5s; }
.stagger-children.visible > *:nth-child(6) { transition-delay: 0.6s; }

/* ============================================
   TOOLTIP STYLES
   ============================================ */

[data-tooltip] {
    position: relative;
}

[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%) scale(0.8);
    padding: var(--space-sm) var(--space-md);
    background: var(--primary-color);
    color: white;
    font-size: 0.75rem;
    font-weight: 500;
    white-space: nowrap;
    border-radius: var(--radius-sm);
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-fast);
    z-index: var(--z-tooltip);
    pointer-events: none;
}

[data-tooltip]:hover::after {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) scale(1);
}

/* ============================================
   BREADCRUMB NAVIGATION
   ============================================ */

.breadcrumb {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: 0.875rem;
    color: var(--text-secondary);
    padding: var(--space-md) 0;
    flex-wrap: wrap;
}

.breadcrumb a {
    color: var(--text-secondary);
    transition: color var(--transition-fast);
}

.breadcrumb a:hover {
    color: var(--secondary-color);
}

.breadcrumb-separator {
    color: var(--text-light);
}

.breadcrumb-current {
    color: var(--text-primary);
    font-weight: 500;
}

/* ============================================
   READING PROGRESS BAR
   ============================================ */

.reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: linear-gradient(90deg, var(--secondary-color), var(--accent-color));
    z-index: var(--z-fixed);
    transition: width 0.1s linear;
}

/* ============================================
   TABLE OF CONTENTS
   ============================================ */

.toc {
    background: var(--bg-secondary);
    padding: var(--space-lg);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-xl);
    border-left: 4px solid var(--secondary-color);
}

.toc-title {
    font-weight: 700;
    margin-bottom: var(--space-md);
    font-size: 1rem;
    color: var(--text-primary);
}

.toc-list {
    list-style: none;
}

.toc-list li {
    margin-bottom: var(--space-sm);
}

.toc-list a {
    color: var(--text-secondary);
    font-size: 0.875rem;
    display: block;
    padding: var(--space-xs) 0;
    transition: all var(--transition-fast);
}

.toc-list a:hover {
    color: var(--secondary-color);
    padding-left: var(--space-sm);
}

/* ============================================
   ENHANCED FOOTER WITH SOCIAL
   ============================================ */

.footer-social {
    display: flex;
    gap: var(--space-md);
    margin-top: var(--space-lg);
}

.footer-social .share-btn {
    background: rgba(255, 255, 255, 0.1);
}

.footer-social .share-btn:hover {
    background: var(--secondary-color);
}

/* ============================================
   NOTIFICATION TOAST
   ============================================ */

.toast {
    position: fixed;
    bottom: var(--space-xl);
    right: var(--space-xl);
    padding: var(--space-md) var(--space-lg);
    background: var(--primary-color);
    color: white;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-xl);
    z-index: var(--z-modal);
    transform: translateY(100px);
    opacity: 0;
    transition: all var(--transition-base);
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

.toast-success {
    background: var(--success-color);
}

.toast-error {
    background: var(--danger-color);
}

/* ============================================
   SKELETON LOADING
   ============================================ */

.skeleton {
    background: linear-gradient(90deg, var(--bg-tertiary) 25%, var(--bg-secondary) 50%, var(--bg-tertiary) 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: var(--radius-sm);
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.skeleton-text {
    height: 1em;
    margin-bottom: var(--space-sm);
}

.skeleton-title {
    height: 1.5em;
    width: 60%;
    margin-bottom: var(--space-md);
}

.skeleton-image {
    height: 200px;
}

/* ============================================
   COMPREHENSIVE MOBILE OPTIMIZATION
   All devices from 320px to 1024px
   ============================================ */

/* Extra small devices (phones, 320px - 480px) */
@media (max-width: 480px) {
    html {
        font-size: 14px;
    }

    .container {
        padding: 0 var(--space-md);
    }

    /* Hero section mobile */
    .hero {
        padding: var(--space-xl) 0;
        background-attachment: scroll; /* Better performance on mobile */
    }

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

    .hero h2 {
        font-size: 1.5rem;
    }

    /* Film thumbnails mobile */
    .film-thumbnail {
        height: 180px;
    }

    .play-icon {
        width: 48px;
        height: 48px;
    }

    .film-rank {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }

    .film-content {
        padding: var(--space-md);
    }

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

    .film-description {
        font-size: 0.9rem;
        -webkit-line-clamp: 3;
        display: -webkit-box;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    /* Touch-friendly buttons (min 44px) */
    .btn {
        min-height: 44px;
        padding: var(--space-sm) var(--space-md);
        font-size: 0.875rem;
    }

    .film-actions {
        flex-direction: column;
        gap: var(--space-sm);
    }

    .film-actions .btn {
        width: 100%;
        justify-content: center;
    }

    /* Tags smaller on mobile */
    .tag {
        font-size: 0.7rem;
        padding: 0.2rem 0.5rem;
    }

    /* Movie detail page mobile */
    .movie-poster {
        height: 220px !important;
    }

    .movie-title-main {
        font-size: 1.5rem;
    }

    .movie-rank-large {
        width: 50px;
        height: 50px;
        font-size: 1.25rem;
    }

    /* Social share buttons mobile */
    .share-btn {
        width: 40px;
        height: 40px;
    }

    .share-btn svg {
        width: 18px;
        height: 18px;
    }

    .social-share {
        justify-content: center;
    }

    .social-share-label {
        width: 100%;
        text-align: center;
        margin-bottom: var(--space-sm);
    }

    /* Footer mobile */
    .footer-content {
        flex-direction: column;
        gap: var(--space-xl);
    }

    .footer-section {
        width: 100%;
        text-align: center;
    }

    .footer-social {
        justify-content: center;
    }

    /* Reading progress thinner on mobile */
    .reading-progress {
        height: 2px;
    }

    /* Article mobile */
    article h1 {
        font-size: 1.5rem;
    }

    article h2 {
        font-size: 1.25rem;
    }

    article p {
        font-size: 1rem;
    }

    .article-meta {
        flex-direction: column;
        align-items: center;
        gap: var(--space-sm);
    }

    /* CTA box mobile */
    .cta-box, .cta-section {
        padding: var(--space-lg);
    }

    /* Video container mobile */
    .video-container {
        margin: var(--space-md) calc(-1 * var(--space-md));
        border-radius: 0;
    }
}

/* Small devices (large phones, 481px - 768px) */
@media (min-width: 481px) and (max-width: 768px) {
    .film-thumbnail {
        height: 200px;
    }

    .movie-poster {
        height: 280px !important;
    }

    .films-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-md);
    }

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

/* Medium devices (tablets, 769px - 1024px) */
@media (min-width: 769px) and (max-width: 1024px) {
    .films-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .movie-content-grid {
        grid-template-columns: 1fr;
    }

    .movie-sidebar {
        order: -1;
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: var(--space-md);
    }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    /* Remove hover effects that don't work well on touch */
    .film-card:hover {
        transform: none;
    }

    .film-thumbnail-link:hover .film-thumbnail {
        transform: none;
    }

    .film-thumbnail-overlay {
        opacity: 0.5; /* Always show play button on touch devices */
    }

    .share-btn:hover {
        transform: none;
    }

    /* Larger touch targets */
    .btn, .share-btn, .star {
        min-height: 44px;
        min-width: 44px;
    }

    nav a {
        min-height: 44px;
        display: flex;
        align-items: center;
    }
}

/* Landscape phone optimization */
@media (max-height: 500px) and (orientation: landscape) {
    .hero {
        padding: var(--space-lg) 0;
    }

    .hero h2 {
        font-size: 1.25rem;
        margin-bottom: var(--space-sm);
    }

    .hero p {
        font-size: 0.9rem;
        margin-bottom: var(--space-md);
    }

    .movie-poster {
        height: 200px !important;
    }
}

/* Safe area insets for notched devices */
@supports (padding: max(0px)) {
    .container {
        padding-left: max(var(--space-lg), env(safe-area-inset-left));
        padding-right: max(var(--space-lg), env(safe-area-inset-right));
    }

    footer {
        padding-bottom: max(var(--space-xl), env(safe-area-inset-bottom));
    }

    .share-floating {
        left: max(var(--space-lg), env(safe-area-inset-left));
    }

    .toast {
        right: max(var(--space-xl), env(safe-area-inset-right));
        bottom: max(var(--space-xl), env(safe-area-inset-bottom));
    }
}

/* Improve text readability on mobile */
@media (max-width: 768px) {
    body {
        -webkit-text-size-adjust: 100%;
        text-size-adjust: 100%;
    }

    /* Prevent zoom on input focus on iOS */
    input, select, textarea {
        font-size: 16px;
    }

    /* Better line height for readability */
    p, li {
        line-height: 1.8;
    }

    /* Prevent horizontal scroll */
    html, body {
        overflow-x: hidden;
    }

    /* Make images responsive */
    img {
        max-width: 100%;
        height: auto;
    }
}

/* High resolution displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    /* Sharper borders and shadows */
    .film-card {
        border-width: 1px;
    }

    .share-btn {
        border-width: 1px;
    }
}
