/* ==============================================
   VARIABLES & ROOT
   ============================================== */
:root {
    --sidebar-purple: #221e36ff;
    --sidebar-purple-hover: #4f2c5f;
    --primary: #6f42c1;
    --primary-hover: #5a32a3;
    --bg-light: #d9e3f0;
    --text-main: #081224;
    --text-muted: #6c757d;
    --border-light: rgba(13,24,58,0.06);
    --shadow-sm: 0 1px 3px rgba(13,24,58,0.08);
    --shadow-md: 0 6px 18px rgba(26,38,66,0.06);
    --font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* ==============================================
   GLOBAL STYLES
   ============================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    background: var(--bg-light);
    color: var(--text-main);
    line-height: 1.5;
    overflow-x: hidden;
}

.wrapper {
    display: flex;
    min-height: 100vh;
    position: relative;
}

/* Main Layout */
.main {
    flex: 1;
    min-width: 0;
    transition: all .3s ease-in-out;
    background: var(--bg-light);
    position: relative;
        width: calc(100% - 250px);
        margin-left: 275px;
        padding-top: 68px;
}

.main.expanded {
    width: 100%;
    margin-left: 0;
}

@media (min-width: 992px) {
    .main.expanded {
        width: calc(100% - 70px);
        margin-left: 70px;
    }
}

@media (max-width: 991.98px) {
    .main {
        width: 100%;
        margin-left: 0;
    }
}

/* Content container */
.container-fluid {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

/* Override for navbar container */
.navbar .container-fluid {
    max-width: none;
    margin: 0;
    padding: 0 1.5rem;
    width: 100%;
}

/* Ensure content has proper spacing */
.content {
    padding: 1.5rem;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
}

@media (min-width: 992px) {
    .content {
        padding: 2rem;
    }
}

/* Content area */
.content {
    padding: 2rem 1rem;
}

@media (min-width: 768px) {
    .content {
        padding: 2rem;
    }
}

       
        /* ==============================================
   SIDEBAR STYLES
   ============================================== */
#sidebar {
    width: 300px;
    background: var(--sidebar-purple);
    transition: all .3s ease;
    z-index: 1030;
    border-right: 1px solid rgba(255,255,255,0.05);
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    margin-top:73px;
    /* Disable sidebar scrolling: content should align and not produce a scroll bar */
    overflow-y: hidden;
}

/* Only hide (translate off-screen) when on small screens */
@media (max-width: 991.98px) {
    #sidebar.collapsed {
        transform: translateX(-100%);
    }
}

@media (min-width: 992px) {
    /* Remove collapse styles for desktop view */
    #sidebar {
        width: 300px !important;
        transform: none !important;
    }

    #sidebar .sidebar-brands,
    #sidebar .sidebar-link span,
    #sidebar .fa-chevron-down,
    #sidebar .sidebar-nav {
        display: block !important;
    }

    .main {
        width: calc(100% - 300px) !important;
        margin-left: 300px !important;
    }
}

.sidebar-contents {
    height: 100%;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    /* match the container width to avoid horizontal overflow */
    width: 100%;
    box-sizing: border-box;
    /* prevent inner scrolling, keep layout aligned */
    overflow: hidden;
}



.sidebar-brands img {
    height: 48px;
    width: auto;
}

.sidebar-nav {
    list-style: none;
    padding: 1rem 0.75rem;
    margin: 0;
}

.sidebar-item {
    margin-bottom: 0.35rem;
}

.sidebar-link {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    color: rgba(255,255,255,0.85) !important;
    text-decoration: none;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
}

.sidebar-link i {
    font-size: 1.1rem;
    margin-right: 0.75rem;
    color: rgba(255,255,255,0.7);
    width: 1.2rem;
    text-align: center;
}

.sidebar-link span {
    font-size: 0.95rem;
}

.sidebar-link:hover,
.sidebar-item.active .sidebar-link {
    background: var(--sidebar-purple-hover);
    color: #fff !important;
    transform: translateY(-1px);
    /* avoid forcing a fixed width on hover which can create overflow */
}

.sidebar-link:hover i,
.sidebar-item.active .sidebar-link i {
    color: #fff;
}

.sidebar-dropdown {
    padding-left: 3rem;
    font-size: 0.9rem;
}

.sidebar-dropdown.show {
    display: block;
}

.sidebar-link[aria-expanded="true"] .fa-chevron-down {
    transform: rotate(180deg);
}

.fa-chevron-down {
    transition: transform 0.2s ease;
    margin-left: auto;
}

/* ==============================================
   NAVBAR STYLES
   ============================================== */
.navbar {
    background: #fff;
    height: 72px;
    border-bottom: 1px solid var(--border-light);
    padding: 0;
    box-shadow: var(--shadow-sm);
    position: fixed;
    left: 0;
    right: 0;
    top: 0;
    width: 100%;
    z-index: 1060;
}

.navbar .container-fluid {
    height: 100%;
    padding: 0 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: none; /* Remove max-width constraint */
    margin: 0; /* Remove auto margins */
    width: 100%; /* Ensure full width */
}

/* Shift the right-side navbar block a bit left by adding right margin
   Increase the value to move it further left; decrease to move it right */
.navbar .container-fluid > .d-flex.align-items-center {
    margin-right: 5.89rem; /* tweak this number to adjust spacing */
}

.logo-navbar {
    display: flex;
    align-items: center;
    margin-left: 0;
    padding-left: 0;
}

.navbar-logo {
    height: 36px;
    width: auto;
}

@media (max-width: 991.98px) {
    .navbar {
        padding: 0;
    }
    
    .logo-navbar {
        margin-left: 60px;
    }
}

#sidebarToggle {
    display: none; /* Hide on desktop by default */
}

@media (max-width: 991.98px) {
    #sidebarToggle {
        display: block; /* Show only on mobile */
        background: none;
        border: none;
        padding: 0.5rem;
        cursor: pointer;
    }
}

.navbar .nav-link {
    color: var(--text-main) !important;
    padding: 0.5rem;
}

.navbar .nav-link img {
    width: 32px;
    height: 32px;
}

.sidebar-toggle {
    display: none; /* hidden by default, shown only on small screens below */
}

.sidebar-toggle:hover {
    background-color: rgba(0,0,0,0.05);
}

.hamburger {
    width: 22px;
    height: 2px;
    background: var(--text-main);
    position: relative;
    display: block;
    transition: all .3s ease;
}

.hamburger:before,
.hamburger:after {
    content: '';
    position: absolute;
    width: 22px;
    height: 2px;
    background: var(--text-main);
    left: 0;
    transition: all .3s ease;
}

.hamburger:before {
    top: -7px;
}

.hamburger:after {
    bottom: -7px;
}

/* Animation for hamburger when sidebar is collapsed */
#sidebar.collapsed ~ .main .hamburger {
    background: transparent;
}

#sidebar.collapsed ~ .main .hamburger:before {
    transform: rotate(45deg);
    top: 0;
}

#sidebar.collapsed ~ .main .hamburger:after {
    transform: rotate(-45deg);
    bottom: 0;
}

#sidebar.collapsed ~ .main .hamburger {
    transform: rotate(45deg);
}

#sidebar.collapsed ~ .main .hamburger:before {
    transform: rotate(90deg);
    top: 0;
}

#sidebar.collapsed ~ .main .hamburger:after {
    transform: rotate(90deg);
    bottom: 0;
}

/* desktop: keep toggle visible; positioning handled above */

        /* ==============================================
   CARD STYLES
   ============================================== */
.card {
    background: #fff;
    border: none;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    height: 100%;
}

.card-body {
    padding: 1.5rem;
}

/* Grid Layout Improvements */
.row {
    margin-right: -1rem;
    margin-left: -1rem;
    display: flex;
    flex-wrap: wrap;
}

.row > [class^="col-"] {
    padding-right: 1rem;
    padding-left: 1rem;
}

/* Dashboard specific spacing */
.g-3 {
    --bs-gutter-x: 1.5rem;
    --bs-gutter-y: 1.5rem;
    margin-top: calc(-1 * var(--bs-gutter-y));
    margin-right: calc(-.5 * var(--bs-gutter-x));
    margin-left: calc(-.5 * var(--bs-gutter-x));
}

.g-3 > * {
    padding-right: calc(var(--bs-gutter-x) * .5);
    padding-left: calc(var(--bs-gutter-x) * .5);
    margin-top: var(--bs-gutter-y);
}

/* Upload Box */
.upload-box {
    border: 3px dashed rgba(111,66,193,0.12);
    background: linear-gradient(180deg, rgba(111,66,193,0.03), rgba(111,66,193,0.00));
    padding: 1.5rem;
    border-radius: 15px;
    height: 300px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.upload-box .icon-wrap {
    width: 86px;
    height: 86px;
    border-radius: 50%;
    background: #fff;
    box-shadow: var(--shadow-md);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.25rem;
}

.upload-box .icon-wrap i {
    font-size: 1.75rem;
    color: var(--primary);
}

/* Stats Card */
.stats-card h6 {
    color: var(--text-muted);
    font-weight: 400;
    margin-bottom: 0.5rem;
}

.stats-card h1 {
    font-size: 2.75rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    line-height: 1.2;
}

.stats-card .text-success {
    color: #28a745 !important;
}

/* Top 5 List */
.top5-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.top5-thumb {
    width: 52px;
    height: 36px;
    object-fit: cover;
    border-radius: 6px;
    margin-right: 12px;
}

.badge-rank {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    margin-right: 0.75rem;
}

        /* ==============================================
   BUTTON STYLES
   ============================================== */
.btn {
    padding: 0.5rem 1.25rem;
    font-weight: 500;
    border-radius: 50rem;
    transition: all 0.2s ease;
}

.btn-primary {
    background: var(--sidebar-purple-hover);
    border: none;
    color: #fff;
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

.btn-outline-secondary {
    border-color: rgba(111,66,193,0.12);
    color: var(--text-main);
}

.btn-outline-secondary:hover {
    background: rgba(111,66,193,0.05);
    border-color: rgba(111,66,193,0.2);
    color: var(--text-main);
}

/* ==============================================
   CHART STYLES
   ============================================== */
.chart-container {
    position: relative;
    height: 320px;
    padding: 1.5rem 0;
    /* container is transparent — visual emphasis is drawn under the line via Canvas */
    border-radius: 12px;
    background: transparent;
}

/* Mini Chart */
#miniUserChart {
    height: 64px !important;
}

/* ==============================================
   UTILITY CLASSES
   ============================================== */
.text-muted {
    color: var(--text-muted) !important;
}

.small-muted {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.fw-semibold {
    font-weight: 600;
}

.text-truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

        .hero-title {
            font-size: 3.5rem;
            font-weight: bold;
            margin-bottom: 20px;
            text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
        }

        .hero-description {
            font-size: 1.2rem;
            margin-bottom: 30px;
            max-width: 400px;
            line-height: 1.6;
            text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
        }

        .hero-buttons {
            display: flex;
            gap: 15px;
        }

        .btn-play {
            background: white;
            color: #333;
            border: none;
            padding: 12px 30px;
            border-radius: 10px;
            font-weight: 600;
            display: flex;
            align-items: center;
            gap: 8px;
            transition: transform 0.3s;
        }

        .btn-play:hover {
            transform: translateY(-2px);
            box-shadow: 0 4px 8px rgba(0,0,0,0.2);
        }

        .btn-add {
            background: rgba(0,0,0,0.3);
            color: white;
            border: 2px solid white;
            padding: 10px 25px;
            border-radius: 10px;
            font-weight: 600;
            display: flex;
            align-items: center;
            gap: 8px;
            transition: all 0.3s;
        }

        .btn-add:hover {
            background: white;
            color: #333;
        }

        .hero-characters {
            position: absolute;
            right: 100px;
            top: 50%;
            transform: translateY(-50%);
            z-index: 2;
        }

        .character {
            width: 200px;
            height: 200px;
            border-radius: 50%;
            margin-bottom: 20px;
            background: linear-gradient(135deg, #e17055, #fdcb6e);
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 4rem;
            box-shadow: 0 10px 20px rgba(0,0,0,0.2);
        }

        .character.secondary {
            width: 150px;
            height: 150px;
            background: linear-gradient(135deg, #ddd6fe, #f3e8ff);
            font-size: 3rem;
            margin-left: 50px;
        }

        /* Content Sections */
        .content-section {
            padding: 40px 0;
        }

        .section-title {
            font-size: 1.8rem;
            font-weight: bold;
            color: #333;
            margin-bottom: 25px;
        }

        .movie-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
            gap: 20px;
            margin-bottom: 30px;
        }

        .movie-card {
            background: white;
            border-radius: 10px;
            overflow: hidden;
            box-shadow: 0 4px 8px rgba(0,0,0,0.1);
            transition: transform 0.3s, box-shadow 0.3s;
            cursor: pointer;
        }

        .movie-card:hover {
            transform: translateY(-5px);
            box-shadow: 0 8px 16px rgba(0,0,0,0.2);
        }

        .movie-poster {
            width: 100%;
            height: 120px;
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            display: flex;
            align-items: center;
            justify-content: center;
            color: white;
            font-weight: bold;
            font-size: 0.9rem;
            text-align: center;
            padding: 10px;
            position: relative;
        }

        .movie-poster.angels { background: linear-gradient(135deg, #ffeaa7, #fab1a0); }
        .movie-poster.heaven { background: linear-gradient(135deg, #74b9ff, #0984e3); }
        .movie-poster.song { background: linear-gradient(135deg, #fd79a8, #e84393); }
        .movie-poster.shepherd { background: linear-gradient(135deg, #fdcb6e, #e17055); }
        .movie-poster.nativity { background: linear-gradient(135deg, #a29bfe, #6c5ce7); }
        .movie-poster.home { background: linear-gradient(135deg, #ffa502, #ff6348); }
        .movie-poster.prayer { background: linear-gradient(135deg, #ff7675, #d63031); }
        .movie-poster.believe { background: linear-gradient(135deg, #00b894, #00a085); }
        .movie-poster.gods { background: linear-gradient(135deg, #2d3436, #636e72); }
        .movie-poster.king { background: linear-gradient(135deg, #fdcb6e, #f39c12); }
        .movie-poster.ratatouille { background: linear-gradient(135deg, #e17055, #d63031); }
        .movie-poster.tangled { background: linear-gradient(135deg, #a29bfe, #6c5ce7); }
        .movie-poster.life { background: linear-gradient(135deg, #fd79a8, #fdcb6e); }

        .play-icon {
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            background: #a1613d;
            border-radius: 50%;
            width: 40px;
            height: 40px;
            display: flex;
            align-items: center;
            justify-content: center;
            opacity: 0;
            transition: opacity 0.3s;
        }

        .movie-card:hover .play-icon {
            opacity: 1;
        }

        .search-icon {
            color: #666;
            font-size: 1.2rem;
        }

        @media (max-width: 768px) {
            .hero-title {
                font-size: 2.5rem;
                flex-direction: row !important;
            }
            
            .hero-characters {
                display: none;
            }
            
            .hero-description {
                font-size: 1.1rem;
                margin-bottom: 25px;
            }

            .hero-buttons {
                flex-direction: row !important;

                align-items: flex-start;
                gap: 10px;
            }

            .btn-play, .btn-add {
                width: auto;
                min-width: 120px;
            }
            
            .movie-grid {
                grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
                gap: 15px;
            }

            .btn-play {
            width: 40px;
            height: 40px;
            padding: 0;
            border-radius: 50% !important;
            }

      

            .section-title {
                font-size: 1.5rem;
                margin-bottom: 20px;
            }

            .content-section {
                padding: 30px 0;
            }
        }

        @media (max-width: 480px) {
            .hero-title {
                font-size: 2rem;
            }

            .hero-description {
                font-size: 1rem;
            }

            .movie-grid {
                grid-template-columns: repeat(2, 1fr);
                gap: 10px;
            }

            .movie-poster {
                height: 100px;
                font-size: 0.8rem;
            }

            .section-title {
                font-size: 1.3rem;
            }
        }

        /* Mobile Responsiveness Improvements */
        @media (max-width: 768px) {
            .card {
                margin-bottom: 1rem;
            }

            .card-body {
                padding: 1rem;
            }

            .stats-card h1 {
                font-size: 2rem;
            }

            .upload-box {
                height: auto;
                padding: 1.5rem;
            }

            .upload-box .icon-wrap {
                width: 64px;
                height: 64px;
            }

            .sidebar-link {
                padding: 0.875rem 1rem;
            }

            .navbar {
                padding: 0.5rem 1rem;
            }

            .content {
                padding: 1rem;
            }

            .container-fluid {
                padding: 1rem;
            }

            /* Improve touch targets */
            .btn {
                padding: 0.625rem 1.25rem;
                min-height: 44px;
            }

            /* Adjust chart responsiveness */
            .chart-container {
                height: 250px;
            }

            /* Improve mobile table view */
            .table-responsive {
                margin-bottom: 1rem;
            }
        }

/* ------------------------------------------------------------------
   Hide native vertical scrollbar visually while preserving scroll
   - Users can still scroll with mouse wheel, touchpad, trackpad or keyboard
   - Works across modern browsers: Chrome/Safari/Edge/Firefox/IE
   If you prefer this to apply only to the dashboard main area, change
   the selectors from html, body to .main or .wrapper as needed.
   ------------------------------------------------------------------ */
html, body {
    -ms-overflow-style: none; /* IE and Edge */
    scrollbar-width: none;    /* Firefox */
}

/* Chrome, Safari and Opera */
html::-webkit-scrollbar, body::-webkit-scrollbar {
    width: 0px;
    background: transparent;
}

/* Keep scrolling behavior unchanged (no overflow:hidden) */

/* ------------------------------------------------------------------
   Mobile-only styled sidebar toggle (beautified)
   - Visible only on screens smaller than 992px
   - Animated hamburger -> X using body.sidebar-collapsed class
   ------------------------------------------------------------------ */
@media (max-width: 991.98px) {
    .sidebar-toggle {
        display: flex !important;

/* Logo inside the navbar positioned relative to the sidebar on desktop
   - On desktop: position the logo just to the right of the sidebar (slightly above visually)
   - On mobile: align the logo to the left edge inside the navbar
*/
.logo-navbar {
    display: flex;
    align-items: center;
    padding-left: 1rem;
}

.navbar-logo {
    height: 36px;
    width: auto;
    display: block;
}

/* When sidebar is collapsed on desktop, shift the logo closer to the collapsed sidebar */
@media (min-width: 992px) {
    #sidebar.collapsed ~ .main .logo-navbar {
        left: calc(70px + 12px);
        top: 6px;
    }
}

@media (max-width: 991.98px) {
    .logo-navbar {
        left: 12px; /* on mobile keep it aligned to the left */
        top: 8px;
    }
    /* ensure main padding isn't excessive on mobile where navbar is same height */
    .main { padding-top: 72px; }
}
        cursor: pointer;
        width: 48px;
        height: 48px;
        position: fixed;
        left: 12px;
        top: 12px;
        align-items: center;
        justify-content: center;
        border-radius: 12px;
        transition: all 0.25s ease;
        border: none;
        background: rgba(255,255,255,0.98);
        padding: 8px;
        box-shadow: 0 8px 24px rgba(12,24,60,0.12);
        z-index: 1045;
    }

    /* Slight hover feedback */
    .sidebar-toggle:hover {
        transform: translateY(-2px);
        box-shadow: 0 12px 28px rgba(12,24,60,0.14);
    }

    /* Make hamburger lines a bit thicker on mobile */
    .sidebar-toggle .hamburger {
        width: 22px;
        height: 2px;
        background: var(--text-main);
        border-radius: 2px;
        position: relative;
        transition: all .25s ease;
    }

    .sidebar-toggle .hamburger:before,
    .sidebar-toggle .hamburger:after {
        width: 22px;
        height: 2px;
        background: var(--text-main);
        border-radius: 2px;
    }

    /* Animate into X when sidebar is collapsed (body gains sidebar-collapsed class)
       we use body.sidebar-collapsed because the JS toggles that class. */
    body.sidebar-collapsed .sidebar-toggle .hamburger {
        background: transparent;
    }

    body.sidebar-collapsed .sidebar-toggle .hamburger:before {
        transform: translateY(0) rotate(45deg);
        top: 0;
    }

    body.sidebar-collapsed .sidebar-toggle .hamburger:after {
        transform: translateY(0) rotate(-45deg);
        bottom: 0;
    }
}
