/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    min-height: 100vh;
}

/* Login Section */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.login-box {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
    border: 1px solid rgba(255, 255, 255, 0.18);
    max-width: 800px; /* Increased from 600px for wider modal */
    width: 100%;
    margin: 0 auto; /* Ensure horizontal centering within the flex container */
}

.login-box h1 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 10px;
    color: #fff;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.tagline {
    text-align: center;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 30px;
    font-size: 0.9rem;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    color: #fff;
    font-weight: 500;
}

.input-group input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.input-group input:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.6);
    background: rgba(255, 255, 255, 0.15);
}

.input-group input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.input-hint {
    display: block;
    margin-top: 5px;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.6);
    font-style: italic;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.form-row .input-group {
    margin-bottom: 0; /* Remove bottom margin since form-row handles spacing */
}

.form-spacer {
    height: 20px; /* Space below last input before button */
}

.btn-login {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 10px;
    color: #fff;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

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

.btn-login:active {
    transform: translateY(0);
}

.register-link {
    text-align: center;
    margin-top: 20px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
}

.register-link a {
    color: #fff;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.register-link a:hover {
    color: #ffd700;
}

.register-note {
    text-align: center;
    margin-top: 15px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.85rem;
    line-height: 1.4;
}

/* Login Modal */
.login-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px; /* Add padding to ensure modal doesn't touch edges on small screens */
    overflow-y: auto; /* Allow scrolling within the modal container */
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    z-index: 999; /* Ensure overlay is below modal content but above background */
}

.modal-content {
    position: relative;
    z-index: 1001;
    animation: modalSlideIn 0.3s ease-out;
    max-width: 800px; /* Match the login-box width */
    width: 100%;
    margin: 0 auto; /* Ensure horizontal centering */
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #fff;
    font-size: 28px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    line-height: 1;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

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

/* Main Content */
.main-content {
    background: #0f0f23;
    min-height: 100vh;
}

/* Header */
.header {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    padding: 20px 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.logo {
    font-size: 1.8rem;
    color: #fff;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.nav-menu {
    display: flex;
    gap: 30px;
}

.nav-link {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.nav-link:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

.nav-link.active {
    color: #fff;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 15px;
}

.username-display {
    color: #fff;
    font-weight: 500;
}

.btn-logout {
    padding: 8px 20px;
    background: rgba(255, 59, 48, 0.8);
    border: none;
    border-radius: 8px;
    color: #fff;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-logout:hover {
    background: rgba(255, 59, 48, 1);
    transform: translateY(-2px);
}

.btn-login-header {
    padding: 8px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 8px;
    color: #fff;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(102, 126, 234, 0.3);
}

.btn-login-header:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.5);
}

.btn-register-header {
    padding: 8px 20px;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    border: none;
    border-radius: 8px;
    color: #fff;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(245, 87, 108, 0.3);
    margin-left: 10px;
}

.btn-register-header:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(245, 87, 108, 0.5);
}

.btn-clear {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

.btn-clear:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.btn-add-genre {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
}

.btn-add-genre:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
}

.genre-filter-container {
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Notification System */
.notification {
    position: fixed;
    top: -100px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.9);
    color: #fff;
    padding: 15px 30px;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    z-index: 10000;
    font-weight: 500;
    transition: top 0.3s ease;
    min-width: 300px;
    text-align: center;
}

.notification.show {
    top: 20px;
}

.notification-success {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
}

.notification-error {
    background: linear-gradient(135deg, #eb3349 0%, #f45c43 100%);
}

.notification-info {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* Content Sections */
.content-section {
    display: none;
    padding: 40px 20px;
    max-width: 1400px;
    margin: 0 auto;
}

.content-section.active {
    display: block;
}

.section-header {
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.section-header h2 {
    font-size: 2rem;
    color: #fff;
}

.filters {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.filter-select {
    padding: 10px 15px;
    border-radius: 8px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-select:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.4);
}

.filter-select option {
    background: #1a1a2e;
    color: #fff;
}

.search-input {
    padding: 10px 15px;
    border-radius: 8px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 1rem;
    min-width: 250px;
    transition: all 0.3s ease;
}

.search-input:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.4);
}

.search-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

/* Content Grid */
.content-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
}

.content-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.content-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.card-image {
    position: relative;
    width: 100%;
    height: 330px; /* Increased by 50% from 220px */
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-image img {
    width: auto;
    height: 100%; /* Full height to fit container */
    max-width: 100%;
    object-fit: contain; /* Shows entire image without cropping */
    object-position: center;
    transition: transform 0.3s ease;
}

.content-card:hover .card-image img {
    transform: scale(1.05); /* Slight zoom effect on hover */
}

.placeholder-image {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: bold;
    color: rgba(255, 255, 255, 0.3);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.play-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.content-card:hover .play-overlay {
    opacity: 1;
}

.play-icon {
    font-size: 3rem;
    color: #fff;
}

.season-badge,
.age-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.8);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.age-badge {
    background: rgba(255, 59, 48, 0.9);
}

.card-info {
    padding: 20px;
}

.card-info h3 {
    font-size: 1.2rem;
    margin-bottom: 10px;
    color: #fff;
}

.card-meta {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
    margin-bottom: 8px;
}

.card-rating {
    color: #ffd700;
    font-weight: 600;
    font-size: 0.95rem;
}

/* Age Warning */
.age-warning {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
}

.warning-box {
    background: rgba(255, 59, 48, 0.1);
    border: 2px solid rgba(255, 59, 48, 0.5);
    border-radius: 20px;
    padding: 60px 40px;
    text-align: center;
    max-width: 500px;
}

.warning-box h2 {
    font-size: 2rem;
    margin-bottom: 20px;
    color: #ff3b30;
}

.warning-box p {
    font-size: 1.1rem;
    margin-bottom: 30px;
    color: rgba(255, 255, 255, 0.8);
}

.btn-confirm {
    padding: 15px 40px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 10px;
    color: #fff;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.btn-confirm:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-container {
        flex-direction: column;
        align-items: center;
    }

    .nav-menu {
        gap: 15px;
    }
    
    .user-menu {
        display: flex;
        gap: 10px;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .btn-login-header,
    .btn-register-header {
        padding: 6px 16px;
        font-size: 0.9rem;
    }

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

    .filters {
        width: 100%;
    }

    .search-input {
        width: 100%;
        min-width: auto;
    }

    .content-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 20px;
    }
}

@media (max-width: 480px) {
    .content-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 15px;
    }

    .login-modal {
        padding: 10px; /* Reduce padding on small screens */
    }

    .login-box {
        padding: 30px 20px;
        max-width: 100%; /* Allow full width on small screens */
    }

    .form-row {
        grid-template-columns: 1fr; /* Stack inputs vertically on small screens */
        gap: 15px;
    }

    .logo {
        font-size: 1.5rem;
    }

    .nav-link {
        font-size: 1rem;
        padding: 6px 12px;
    }
    
    .btn-login-header,
    .btn-register-header {
        padding: 5px 12px;
        font-size: 0.85rem;
        margin-left: 5px;
    }
}

/* Loading and Error States */
.loading {
    text-align: center;
    padding: 40px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 1.1rem;
}

.loading::after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
    margin-left: 10px;
}

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

.error {
    text-align: center;
    padding: 40px;
    color: #ff6b6b;
    font-size: 1.1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    margin: 20px 0;
}

.no-content {
    text-align: center;
    padding: 40px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 1.1rem;
    font-style: italic;
}
