:root {
    --bg-primary: #0F172A;
    --bg-secondary: #1E293B;
    --text-primary: #F8FAFC;
    --text-secondary: #94A3B8;
    --accent: #E50914;
    --accent-hover: #F87171;
    --border: #334155;
    --glass-bg: rgba(15, 23, 42, 0.75);
    --glass-border: rgba(255, 255, 255, 0.08);
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    line-height: 1.6;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* Typography Enhancements */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    letter-spacing: -0.025em;
    color: #FFFFFF;
}

/* Navbar (Glassmorphism) */
.navbar {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--glass-border);
    padding: 1.25rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.navbar-brand {
    font-size: 1.75rem;
    font-weight: 800;
    letter-spacing: -0.05em;
    color: var(--accent);
    text-transform: uppercase;
    text-shadow: 0 2px 10px rgba(229, 9, 20, 0.3);
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 2.5rem;
}

.lang-switcher a {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    transition: all 0.2s;
}

.lang-switcher a:hover {
    background: rgba(255,255,255,0.05);
    color: var(--text-primary);
}

.lang-switcher a.active {
    color: var(--text-primary);
    background: rgba(229, 9, 20, 0.15);
}

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

.nav-link {
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.95rem;
}

.nav-link:hover {
    color: var(--text-primary);
}

.btn-login {
    background: linear-gradient(135deg, var(--accent) 0%, #b80710 100%);
    padding: 0.5rem 1.25rem;
    border-radius: 6px;
    color: white !important;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(229, 9, 20, 0.4);
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(229, 9, 20, 0.6);
}

.dropdown {
    position: relative;
    cursor: pointer;
}

.dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-menu {
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    position: absolute;
    right: 0;
    top: 100%;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.5rem 0;
    min-width: 160px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.dropdown-item {
    display: block;
    padding: 0.75rem 1.25rem;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.dropdown-item:hover {
    background: rgba(255,255,255,0.05);
    color: var(--accent);
}

/* Main Content */
.main-content {
    max-width: 1280px;
    margin: 2rem auto;
    padding: 0 1.5rem;
    min-height: calc(100vh - 150px);
}

/* Auth Cards */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
    margin-top: 5rem;
}

.auth-card {
    background: var(--bg-secondary);
    padding: 2.5rem;
    border-radius: 12px;
    width: 100%;
    max-width: 420px;
    border: 1px solid var(--border);
    box-shadow: 0 20px 40px rgba(0,0,0,0.4);
}

.auth-title {
    text-align: center;
    margin-bottom: 2rem;
    font-size: 1.75rem;
    color: white;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 0.875rem 1rem;
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid var(--border);
    color: var(--text-primary);
    border-radius: 6px;
    font-size: 1rem;
    transition: all 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(229, 9, 20, 0.2);
    background: var(--bg-primary);
}

.btn-primary {
    width: 100%;
    padding: 0.875rem;
    background: linear-gradient(135deg, var(--accent) 0%, #b80710 100%);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 15px rgba(229, 9, 20, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(229, 9, 20, 0.5);
}

/* Search Container */
.search-container {
    margin: 3rem auto;
    max-width: 700px;
}

.search-wrapper {
    display: flex;
    gap: 12px;
}

.search-input {
    width: 100%;
    padding: 1rem 1rem 1rem 3rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    color: var(--text-primary);
    border-radius: 30px;
    font-size: 1.1rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.search-input:focus {
    outline: none;
    border-color: var(--text-secondary);
    box-shadow: 0 0 0 4px rgba(255,255,255,0.05), 0 10px 25px rgba(0,0,0,0.3);
    background: #253347;
    transform: translateY(-2px);
}

.year-input {
    padding: 1rem;
    width: 140px !important;
    text-align: center;
}

.search-icon {
    position: absolute;
    left: 1.25rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    font-size: 1.1rem;
    z-index: 10;
}

/* Movie Grid */
.movie-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 2.5rem;
}

.movie-card {
    background: var(--bg-secondary);
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    border: 1px solid var(--glass-border);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.movie-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.3);
    border-color: rgba(255,255,255,0.15);
}

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

.movie-poster-container {
    position: relative;
    padding-top: 150%;
    background: linear-gradient(90deg, #1E293B 25%, #334155 50%, #1E293B 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

.movie-poster {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.6s ease-in-out;
}

.movie-poster.loaded {
    opacity: 1;
}

.movie-info {
    padding: 1.25rem;
}

.movie-title {
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: white;
}

.movie-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
}

.movie-year {
    background: rgba(255,255,255,0.1);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

/* Favorite Button */
.btn-fav {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255,255,255,0.1);
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 10;
}

.btn-fav:hover {
    background: rgba(15, 23, 42, 0.9);
    transform: scale(1.1);
}

.btn-fav.active {
    color: var(--accent);
    background: rgba(229, 9, 20, 0.1);
    border-color: rgba(229, 9, 20, 0.3);
}

/* Movie Detail */
.detail-container {
    display: flex;
    gap: 3rem;
    background: var(--bg-secondary);
    padding: 3rem;
    border-radius: 16px;
    border: 1px solid var(--border);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    margin-top: 2rem;
}

.detail-poster-container {
    width: 350px;
    height: 525px; /* 2:3 aspect ratio */
    border-radius: 12px;
    position: relative;
    background: linear-gradient(90deg, #1E293B 25%, #334155 50%, #1E293B 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
    flex-shrink: 0;
}

.detail-poster {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 12px;
    position: absolute;
    top: 0;
    left: 0;
    opacity: 0;
    transition: opacity 0.6s ease;
}

.detail-poster.loaded {
    opacity: 1;
}

.detail-info {
    flex: 1;
}

.detail-info h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: white;
    line-height: 1.2;
}

.detail-meta {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.meta-badge {
    background: rgba(255,255,255,0.05);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    border: 1px solid rgba(255,255,255,0.1);
}

.detail-plot {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #CBD5E1;
    margin-bottom: 2rem;
}

.detail-btn-fav {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1.5rem;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border);
    color: white;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s;
}

.detail-btn-fav:hover {
    background: rgba(255,255,255,0.1);
    transform: translateY(-2px);
}

.detail-btn-fav.active {
    background: rgba(229, 9, 20, 0.1);
    border-color: var(--accent);
    color: var(--accent);
}

.no-poster {
    background: #1E293B;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    font-weight: 700;
    font-size: 1.2rem;
    text-transform: uppercase;
    letter-spacing: 3px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.empty-state {
    text-align: center;
    padding: 6rem 2rem;
    color: var(--text-secondary);
}

.empty-state i {
    font-size: 4rem;
    margin-bottom: 1.5rem;
    color: var(--border);
}

.empty-state h2 {
    font-size: 1.5rem;
    color: white;
    margin-bottom: 0.5rem;
}

.loader {
    text-align: center;
    padding: 3rem;
    color: var(--accent);
}

.loader p {
    margin-top: 1rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-box {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 2.5rem;
    width: 90%;
    max-width: 400px;
    text-align: center;
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 20px 40px rgba(0,0,0,0.5);
}

.modal-overlay.active .modal-box {
    transform: scale(1);
}

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

.modal-message {
    color: var(--text-secondary);
    margin-bottom: 2rem;
    font-size: 1rem;
    line-height: 1.5;
}

.modal-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

.btn-cancel {
    flex: 1;
    padding: 0.75rem 1.5rem;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border);
    color: var(--text-primary);
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
}

.btn-cancel:hover {
    background: rgba(255,255,255,0.1);
}

.btn-confirm {
    flex: 1;
    padding: 0.75rem 1.5rem;
    background: var(--accent);
    border: none;
    color: white;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
}

.btn-confirm:hover {
    background: var(--accent-hover);
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 80px; /* Below navbar */
    right: 20px;
    z-index: 3000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    padding: 1rem 1.5rem;
    border-radius: 8px;
    border-left: 4px solid var(--border);
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    transform: translateX(120%);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    max-width: 350px;
}

.toast.show {
    transform: translateX(0);
}

.toast-error {
    border-left-color: var(--accent);
}
.toast-error i {
    color: var(--accent);
}

.toast-success {
    border-left-color: #10B981;
}
.toast-success i {
    color: #10B981;
}

.toast-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    margin-left: auto;
    line-height: 1;
}

.toast-close:hover {
    color: var(--text-primary);
}

@media (max-width: 768px) {
    .detail-container {
        flex-direction: column;
        padding: 1.5rem;
    }
    
    .detail-poster-container {
        width: 100%;
        max-width: 350px;
        height: auto;
        aspect-ratio: 2/3;
        margin: 0 auto;
    }
    
    .search-wrapper {
        flex-direction: column;
    }
    
    .year-input {
        width: 100% !important;
    }
}
