@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
    --black-pure: #141414;
    --black-deep: #080808;
    --card-surface: #181818;
    --border-dark: #2f2f2f;
    --netflix-red: #e50914;
    --netflix-red-hover: #b81d24;
    --text-pure: #ffffff;
    --text-gray-light: #e5e5e5;
    --text-muted: #aaaaaa;
    --text-dark: #666666;
    --font-core: 'Inter', sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--black-pure);
    color: var(--text-pure);
    font-family: var(--font-core);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* Navigation Layout */
.netflix-navbar {
    background: linear-gradient(to bottom, rgba(0,0,0,0.9) 0%, transparent 100%);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 24px 4%;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-container {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.logo-text {
    position: absolute;
    font-weight: 800;
    font-size: 1.2rem; /* Adjust based on your image size */
    color: #e50914;    /* Matches your Netflix red theme */
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
    pointer-events: none; /* Allows clicks to pass through to the image */
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 40px;
}

.app-logo {
    font-size: 1.8rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: var(--netflix-red);
    cursor: pointer;
}
.app-logo span { color: var(--text-pure); }

.nav-links-desktop {
    display: flex;
    list-style: none;
    gap: 25px;
}

.nav-links-desktop li {
    font-size: 0.9rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.2s ease;
    font-weight: 500;
}

.nav-links-desktop li:hover, .nav-links-desktop li.active {
    color: var(--text-pure);
}

/* Category Filters Control System Bar */
.filter-control-bar {
    padding: 10px 4%;
    display: flex;
    align-items: center;
    gap: 24px;
    z-index: 900;
    margin-top: -10px;
    flex-wrap: wrap;
}

.type-selectors {
    display: flex;
    background-color: var(--black-deep);
    padding: 4px;
    border-radius: 30px;
    border: 1px solid var(--border-dark);
}

.pill-toggle {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 8px 24px;
    font-family: var(--font-core);
    font-size: 0.8rem;
    font-weight: 600;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.pill-toggle.active {
    background-color: var(--netflix-red);
    color: var(--text-pure);
}

.clean-select {
    background-color: var(--card-surface);
    color: var(--text-pure);
    border: 1px solid var(--border-dark);
    padding: 8px 16px;
    font-family: var(--font-core);
    font-size: 0.8rem;
    border-radius: 4px;
    cursor: pointer;
    outline: none;
}

/* App Viewport and Carousels */
.app-viewport {
    padding: 20px 4% 60px 4%;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 40px;
}

.netflix-row-section {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.row-header h2 { font-size: 1.4rem; font-weight: 700; }
.row-subtitle { font-size: 0.8rem; color: var(--text-muted); }

.scroll-track-container { width: 100%; }
.netflix-scroll-track {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    padding: 10px 0 25px 0;
    scroll-behavior: smooth;
}

.netflix-scroll-track::-webkit-scrollbar { height: 6px; }
.netflix-scroll-track::-webkit-scrollbar-track { background: var(--black-pure); }
.netflix-scroll-track::-webkit-scrollbar-thumb { background: #333; border-radius: 10px; }

.suggestion-card {
    flex: 0 0 190px;
    background-color: var(--card-surface);
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    position: relative;
    transition: transform 0.3s cubic-bezier(0.25, 1, 0.5, 1);
    border: 1px solid transparent;
}

.suggestion-card:hover {
    transform: scale(1.05);
    border-color: #555;
}

.poster-box {
    width: 100%;
    aspect-ratio: 2 / 3;
    background-color: var(--black-deep);
    position: relative;
}

.poster-box img { width: 100%; height: 100%; object-fit: cover; }

.card-rating-badge {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background-color: rgba(0,0,0,0.85);
    padding: 2px 6px;
    font-size: 0.65rem;
    font-weight: 700;
    color: #ffb800;
    border-radius: 3px;
}

.card-title-footer { padding: 12px; }
.card-title-footer h4 { font-size: 0.8rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Form Component Architecture and Lists */
.dashboard-split-grid {
    display: grid;
    grid-template-columns: 420px 1fr;
    gap: 40px;
    transition: all 0.3s ease;
}

.netflix-form-card {
    background-color: var(--card-surface);
    border: 1px solid var(--border-dark);
    border-radius: 8px;
    padding: 30px;
}

.card-header h3, .queue-header h3 { font-size: 1.15rem; font-weight: 700; margin-bottom: 4px; }
.card-header p, .queue-header p { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 24px; }

.input-tag { font-size: 0.75rem; text-transform: uppercase; font-weight: 700; color: var(--text-muted); display: block; margin-bottom: 8px; }
.tabs { display: flex; background-color: var(--black-pure); border: 1px solid var(--border-dark); padding: 2px; border-radius: 4px; }
.tabs button { flex: 1; padding: 10px; background: transparent; border: none; font-family: var(--font-core); color: var(--text-muted); font-size: 0.75rem; font-weight: 600; cursor: pointer; border-radius: 3px; }
.tabs button.active { background-color: var(--card-surface); color: var(--text-pure); }

#add-show-form { display: flex; flex-direction: column; gap: 18px; }
.form-group { display: flex; flex-direction: column; gap: 6px; position: relative; }
.form-group label { font-size: 0.75rem; color: var(--text-gray-light); }

input[type="text"], input[type="datetime-local"] {
    width: 100%; 
    padding: 12px 14px; 
    background-color: var(--black-pure); 
    border: 1px solid var(--border-dark); 
    color: var(--text-pure); 
    font-family: var(--font-core); 
    font-size: 0.85rem; 
    border-radius: 4px;
}

input[type="text"], input[type="datetime-local"] {
    width: 100%; 
    padding: 12px 14px; 
    background-color: var(--black-pure); 
    border: 1px solid var(--border-dark); 
    color: var(--text-pure); 
    font-family: var(--font-core); 
    font-size: 0.85rem; 
    border-radius: 4px;
}

/* 1. Sets the default empty state text (mm/dd/yyyy) to a darker, muted placeholder gray */
input[type="datetime-local"]::-webkit-datetime-edit-text,
input[type="datetime-local"]::-webkit-datetime-edit-month-field,
input[type="datetime-local"]::-webkit-datetime-edit-day-field,
input[type="datetime-local"]::-webkit-datetime-edit-year-field,
input[type="datetime-local"]::-webkit-datetime-edit-hour-field,
input[type="datetime-local"]::-webkit-datetime-edit-minute-field,
input[type="datetime-local"]::-webkit-datetime-edit-ampm-field {
    color: var(--text-dark); /* Subtle dark gray */
}

/* 2. When a date is selected/set OR the input field is active and focused, make it pure white */
input[type="datetime-local"]:valid::-webkit-datetime-edit-text,
input[type="datetime-local"]:valid::-webkit-datetime-edit-month-field,
input[type="datetime-local"]:valid::-webkit-datetime-edit-day-field,
input[type="datetime-local"]:valid::-webkit-datetime-edit-year-field,
input[type="datetime-local"]:valid::-webkit-datetime-edit-hour-field,
input[type="datetime-local"]:valid::-webkit-datetime-edit-minute-field,
input[type="datetime-local"]:valid::-webkit-datetime-edit-ampm-field,
input[type="datetime-local"]:focus::-webkit-datetime-edit-text,
input[type="datetime-local"]:focus::-webkit-datetime-edit-month-field,
input[type="datetime-local"]:focus::-webkit-datetime-edit-day-field,
input[type="datetime-local"]:focus::-webkit-datetime-edit-year-field,
input[type="datetime-local"]:focus::-webkit-datetime-edit-hour-field,
input[type="datetime-local"]:focus::-webkit-datetime-edit-minute-field,
input[type="datetime-local"]:focus::-webkit-datetime-edit-ampm-field {
    color: var(--text-pure) !important; /* Turns perfectly white when set or focused */
}

/* 3. Keeps the small calendar icon button on the right side crisp white */
input[type="datetime-local"]::-webkit-calendar-picker-indicator {
    filter: invert(1) brightness(100%);
    cursor: pointer;
}

.search-dropdown { position: absolute; top: 100%; left: 0; right: 0; background-color: var(--card-surface); border: 1px solid var(--border-dark); border-radius: 4px; margin-top: 4px; max-height: 200px; overflow-y: auto; z-index: 100; }
.search-item { padding: 10px 14px; font-size: 0.8rem; cursor: pointer; color: var(--text-gray-light); }
.search-item:hover { background-color: var(--black-pure); color: var(--netflix-red); }

#submit-btn { width: 100%; padding: 14px; background-color: var(--netflix-red); color: var(--text-pure); border: none; font-family: var(--font-core); font-weight: 700; font-size: 0.85rem; border-radius: 4px; cursor: pointer; margin-top: 8px; }
#submit-btn:hover { background-color: var(--netflix-red-hover); }

.log-vertical-stack { display: flex; flex-direction: column; gap: 12px; }
.placeholder-text { font-size: 0.85rem; color: var(--text-dark); border: 1px dashed var(--border-dark); padding: 40px; text-align: center; border-radius: 6px; }

.movie-card { display: flex; background-color: var(--card-surface); border: 1px solid var(--border-dark); border-radius: 6px; overflow: hidden; align-items: center; position: relative; }
.card-poster { width: 70px; height: 100px; object-fit: cover; }
.card-info { padding: 16px; display: flex; flex-direction: column; gap: 4px; }
.card-info h4 { font-size: 0.95rem; font-weight: 600; }
.card-time { font-size: 0.75rem; color: var(--netflix-red); font-weight: 600; }
.card-details { font-size: 0.75rem; color: var(--text-muted); }

.delete-log-btn {
    position: absolute; right: 20px; background: transparent; border: none; color: var(--text-dark); font-size: 1.2rem; cursor: pointer; transition: color 0.2s ease;
}
.delete-log-btn:hover { color: var(--netflix-red); }

/* IMDb Style Dynamic Modular Overlay System */
.modal-overlay { position: fixed; inset: 0; background-color: rgba(0, 0, 0, 0.85); z-index: 5000; display: flex; justify-content: center; align-items: center; padding: 20px; backdrop-filter: blur(8px); }
.modal-content-wrapper { background-color: var(--card-surface); border: 1px solid var(--border-dark); width: 100%; max-width: 800px; max-height: 90vh; border-radius: 10px; overflow-y: auto; position: relative; }
.modal-close-btn { position: absolute; top: 20px; right: 20px; background-color: rgba(0,0,0,0.5); border: none; color: var(--text-pure); font-size: 1.8rem; width: 40px; height: 40px; border-radius: 50%; cursor: pointer; z-index: 100; display: flex; align-items: center; justify-content: center; }

.hero-backdrop-banner { position: relative; width: 100%; height: 300px; background-size: cover; background-position: center; }
.hero-backdrop-banner::before { content: ''; position: absolute; inset: 0; background: linear-gradient(to top, var(--card-surface) 0%, transparent 100%); }
.hero-title-cluster { position: absolute; bottom: 20px; left: 30px; right: 30px; }
.hero-title-cluster h2 { font-size: 2rem; font-weight: 800; margin-bottom: 8px; text-shadow: 0 2px 10px rgba(0,0,0,0.8); }

.meta-pill-container { display: flex; gap: 12px; align-items: center; font-size: 0.8rem; color: var(--text-gray-light); }
.rating-star { color: #ffb800; font-weight: 700; }

.modal-editorial-body { padding: 30px; display: flex; flex-direction: column; gap: 24px; }
.overview-box h3, .cast-section-wrapper h3 { font-size: 1rem; text-transform: uppercase; letter-spacing: 1px; color: var(--text-muted); margin-bottom: 8px; }
.overview-box p { font-size: 0.9rem; line-height: 1.6; color: var(--text-gray-light); }

.cast-scroller-track { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 10px; }
.actor-capsule { flex: 0 0 100px; text-align: center; }
.actor-headshot { width: 70px; height: 70px; border-radius: 50%; object-fit: cover; margin: 0 auto 6px auto; background-color: var(--black-deep); border: 1px solid var(--border-dark); }
.actor-capsule h4 { font-size: 0.75rem; font-weight: 600; color: var(--text-pure); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.actor-capsule p { font-size: 0.65rem; color: var(--text-dark); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.action-fill-form-btn { align-self: flex-start; padding: 10px 20px; background-color: var(--text-pure); color: #000; border: none; font-weight: 700; font-size: 0.8rem; border-radius: 4px; cursor: pointer; }

.netflix-footer { background-color: var(--black-deep); border-top: 1px solid var(--border-dark); padding: 30px 4%; display: flex; justify-content: space-between; font-size: 0.7rem; color: var(--text-dark); margin-top: auto; }
.hidden { display: none !important; }

/* =========================================================================
   📱 MOBILE RESPONSIVENESS OVERRIDES (For screens smaller than 768px)
   ========================================================================= */
@media (max-width: 768px) {
    /* 1. Turn the 2-column dashboard into a single vertical stack */
    .dashboard-split-grid {
        grid-template-columns: 1fr !important; /* Forces columns to stack on top of each other */
        gap: 20px;
    }

    /* 2. Adjust the navigation bar spacing */
    .netflix-navbar {
        padding: 16px 4%;
        flex-direction: column; /* Stacks logo above the links if needed */
        gap: 12px;
        text-align: center;
    }

    .nav-left {
        flex-direction: column;
        gap: 12px;
    }

    .nav-links-desktop {
        gap: 15px;
    }

    /* 3. Make the control/search bar wrap naturally */
    .filter-control-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 16px;
    }

    .row-search-box {
        width: 100%;
    }

    .row-search-box input {
        flex: 1; /* Lets search input fill available horizontal space */
    }

    /* 4. Optimize forms and modal padding for small screens */
    .netflix-form-card {
        padding: 20px;
    }

    .modal-content-wrapper {
        width: 95%;
        max-height: 95vh;
    }

    .hero-title-cluster h2 {
        font-size: 1.5rem; /* Shrink heavy header text so it fits */
    }
}