/* =========================================
    1. RESET & CORE 
   ========================================= */
* { 
    box-sizing: border-box; 
    margin: 0; 
    padding: 0; 
}

:root {
    --accent: #e74c3c;
    --sidebar-w: 250px;
    --header-h: 70px;
}

html, body {
    width: 100%;
    background-color: #121212;
    color: #ffffff;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    overflow-x: hidden; 
    -webkit-text-size-adjust: 100%;
}

/* =========================================
    2. FIXED HEADER 
   ========================================= */
.site-header {
    background: #000000 !important;
    height: var(--header-h);
    position: fixed !important;
    top: 0; left: 0; width: 100%;
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    border-bottom: 1px solid #333;
}

/* =========================================
    3. SHARED NAVIGATION STYLES
   ========================================= */
.nav-list {
    list-style: none !important;
    display: flex;
}

.nav-link {
    text-decoration: none !important;
    color: #ffffff !important;
    display: flex !important;
    align-items: center !important;
    text-align: left !important; /* Forces text to the left */
    transition: 0.3s ease;
    border-radius: 8px;
}

.nav-link.active, .nav-link:hover {
    background: var(--accent) !important;
    color: #fff !important;
    border-color: var(--accent) !important;
}

/* =========================================
    4. MOVIE CARDS & GRID 
   ========================================= */
.content {
    padding: 20px;
    min-height: 100vh;
}

.movie-grid {
    display: grid;
    gap: 20px;
    align-items: stretch;
}

.movie-card {
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    transition: transform 0.3s ease;
}

.movie-poster {
    width: 100%;
    aspect-ratio: 2 / 3;
    object-fit: cover;
    background: #222;
}

.movie-info {
    padding: 12px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.movie-title {
    font-size: 15px;
    font-weight: bold;
    margin-bottom: 8px;
    line-height: 1.3;
}

.movie-meta {
    font-size: 12px;
    color: #888;
    margin-bottom: 10px;
}

.card-footer {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: #1a1a1a;
    border-top: 1px solid #333;
    margin-top: auto;
    height: 55px;
}

.action-item {
    width: 35px;
    height: 35px;
    background: #2a2a2a;
    border: 1px solid #444;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    cursor: pointer;
}

.edit-btn {
    margin-left: auto;
    background: var(--accent);
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    font-weight: bold;
    font-size: 11px;
}

/* =========================================
    5. DESKTOP LAYOUT (1024px and Up)
   ========================================= */
@media screen and (min-width: 1024px) {
    .main-container {
        display: flex;
        flex-direction: row;
        margin-top: var(--header-h);
    }

    .sidebar {
        width: var(--sidebar-w);
        flex-shrink: 0;
        background: #111;
        border-right: 1px solid #333;
        position: fixed;
        top: var(--header-h);
        bottom: 0;
        overflow-y: auto;
        overflow-x: hidden; /* Prevent horizontal scroll on PC */
        z-index: 2000;
    }

    .nav-list {
        padding: 20px;
        flex-direction: column;
        gap: 10px;
        align-items: stretch; /* Makes links fill sidebar width */
    }

    .nav-link {
        padding: 6px 20px !important; /* Left padding for alignment */
        background: #252525;
        font-size: 14px;
        border: 1px solid #333;
        width: 100%;
    }

    .content {
        margin-left: var(--sidebar-w);
        width: calc(100% - var(--sidebar-w));
    }

    .movie-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* =========================================
    6. MOBILE LAYOUT (Under 1023px)
   ========================================= */
@media screen and (max-width: 1023px) {
    .main-container {
        display: flex;
        flex-direction: column;
        margin-top: var(--header-h);
        width: 100%;
    }

    .sidebar {
        width: 100%;
        background: #000;
        overflow-x: auto;
        white-space: nowrap;
        border-bottom: 2px solid #333;
        padding: 15px 0;
        z-index: 1000;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }
    
    .sidebar::-webkit-scrollbar {
        display: none;
    }

    .nav-list {
        flex-direction: row;
        padding: 0 15px;
        gap: 12px;
        width: max-content;
    }

    .nav-link {
        font-size: 16px !important;
        font-weight: 800;
        padding: 12px 20px !important;
        background: #222 !important;
        border: 1px solid #444 !important;
        white-space: nowrap;
        display: inline-flex !important;
    }

    .content {
        width: 100% !important;
        margin-left: 0 !important;
        padding: 15px !important;
    }

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

    .movie-title {
        font-size: 20px;
        height: auto;
    }
    
    .card-footer {
        height: 70px;
    }
    
    .action-item {
        width: 45px;
        height: 45px;
    }
}

/* =========================================
    7. MISC & SCROLLBARS
   ========================================= */
.tag-badge {
    display: inline-block !important;
    background: #333 !important;
    color: #bbb !important;
    padding: 2px 12px !important;
    border-radius: 4px !important;
    font-size: 12px !important;
    text-decoration: none !important;
    margin-right: 5px;
    margin-bottom: 5px;
    border: 1px solid #444 !important;
}

.tag-badge:hover {
    background: #444 !important;
    color: #ffffff !important;
}

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #121212;
}

::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 10px;
    border: 2px solid #121212;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent);
}

* {
    scrollbar-width: thin;
    scrollbar-color: #333 #121212;
}