/* ============================================================
   MBC My Dream - Master Responsive Theme (User & Admin)
   ============================================================ */

:root {
    --premium-purple: #1e0735;
    --deep-purple: #0f031a;
    --gold: #FFD700;
    --orange: #FF8C00;
    --glass-bg: rgba(255, 255, 255, 0.07);
    --glass-border: rgba(255, 255, 255, 0.1);

    /* Mapping for Admin Panel Consistency */
    --slate-dark: var(--deep-purple);
    --slate-card: rgba(30, 7, 53, 0.7);
    --accent: var(--gold);

    /* Fluid Typography (Standardized) */
    --fs-xs: clamp(0.65rem, 0.6rem + 0.25vw, 0.75rem);
    --fs-sm: clamp(0.75rem, 0.7rem + 0.25vw, 0.875rem);
    --fs-base: clamp(0.875rem, 0.8rem + 0.3vw, 1rem);
    --fs-lg: clamp(1rem, 0.95rem + 0.4vw, 1.25rem);
    --fs-xl: clamp(1.25rem, 1.15rem + 0.6vw, 1.75rem);
    --fs-2xl: clamp(1.75rem, 1.5rem + 1vw, 2.5rem);
    --fs-3xl: clamp(2.5rem, 2rem + 2vw, 4rem);

    /* Admin Layout Variables */
    --sidebar-width: 260px;
    --sidebar-collapsed-width: 70px;
    --navbar-height: 70px;
    --transition-speed: 0.3s;
}

/* --- Base Reset & Typography --- */
body {
    font-family: 'Inter', sans-serif;
    color: white;
    background-color: var(--deep-purple);
    font-size: var(--fs-base);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

h1,
.display-1,
.display-2,
.display-3 {
    font-size: var(--fs-3xl);
    line-height: 1.1;
    font-weight: 800;
}

h2,
.display-4,
.display-5 {
    font-size: var(--fs-2xl);
    font-weight: 800;
}

h3 {
    font-size: var(--fs-xl);
    font-weight: 800;
}

h4 {
    font-size: var(--fs-lg);
    font-weight: 700;
}

h5,
h6 {
    font-size: var(--fs-base);
    font-weight: 700;
}

.small,
small {
    font-size: var(--fs-sm) !important;
}

.smaller {
    font-size: var(--fs-xs) !important;
}

/* --- Backgrounds & Layout --- */
.bg-premium {
    background-color: var(--deep-purple);
    background-image: radial-gradient(circle at top right, #2d0a4e 0%, transparent 40%);
    min-height: 100vh;
}

.bg-gold {
    background: linear-gradient(135deg, var(--orange) 0%, var(--gold) 100%) !important;
}

.bg-white-5 {
    background: rgba(255, 255, 255, 0.05) !important;
}

.bg-white-10 {
    background: rgba(255, 255, 255, 0.10) !important;
}

.glass-nav {
    background: rgba(30, 7, 53, 0.85) !important;
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-bottom: 1px solid var(--glass-border) !important;
}

/* --- Utilities --- */
.text-gold {
    color: var(--gold) !important;
}

.text-white-25 {
    color: rgba(255, 255, 255, 0.25) !important;
}

.text-white-50 {
    color: rgba(255, 255, 255, 0.50) !important;
}

.border-gold {
    border-color: var(--gold) !important;
}

.border-white-5 {
    border-color: rgba(255, 255, 255, 0.05) !important;
}

.border-white-10 {
    border-color: rgba(255, 255, 255, 0.10) !important;
}

.fw-black {
    font-weight: 800;
}

.tracking-tighter {
    letter-spacing: -0.05em;
}

.tracking-widest {
    letter-spacing: 0.1em;
}

.uppercase {
    text-transform: uppercase;
}

/* --- Buttons --- */
.btn {
    padding: 0.75rem 1.5rem;
    border-radius: 50rem;
    font-weight: 700;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    min-height: 44px;
    /* Touch friendly */
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-lg {
    padding: 1rem 2.5rem;
}

.btn-gold {
    background: linear-gradient(to right, var(--orange), var(--gold));
    border: none;
    color: #1a0a00;
    box-shadow: 0 4px 15px rgba(255, 140, 0, 0.3);
}

.btn-gold:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 140, 0, 0.5);
    filter: brightness(1.1);
    color: #1a0a00;
}

/* --- Cards --- */
.premium-card,
.admin-card {
    background: linear-gradient(135deg, rgba(45, 10, 78, 0.6) 0%, rgba(30, 7, 53, 0.8) 100%);
    border: 1px solid var(--glass-border);
    border-radius: 1.5rem;
    padding: 2rem;
    transition: all 0.3s ease;
    height: 100%;
    /* Alignment helper */
    display: flex;
    flex-direction: column;
}

.premium-card:hover {
    transform: translateY(-4px);
    border-color: rgba(255, 215, 0, 0.3);
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.5);
}

/* --- Forms --- */
.form-control,
.form-select {
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: white !important;
    padding: 0.8rem 1.25rem;
    border-radius: 0.75rem;
    min-height: 48px;
}

.form-control:focus,
.form-select:focus {
    background: rgba(255, 255, 255, 0.08) !important;
    border-color: var(--gold) !important;
    box-shadow: 0 0 0 4px rgba(255, 215, 0, 0.15) !important;
}

/* --- Navigation --- */
.logo-box {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    font-size: 1.25rem;
}

.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(15, 3, 26, 0.95);
    backdrop-filter: blur(15px);
    border-top: 1px solid var(--glass-border);
    z-index: 1050;
    display: none;
    padding: 0.5rem 0;
}

.bottom-nav-item {
    flex: 1;
    text-align: center;
    color: rgba(255, 255, 255, 0.4);
    text-decoration: none;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.bottom-nav-item i {
    font-size: 1.4rem;
}

.bottom-nav-item.active {
    color: var(--gold);
}

/* --- Admin Specific --- */
/* --- Admin Sidebar --- */
.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    background: #0f031a;
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    z-index: 1040;
    transition: width var(--transition-speed) cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 10px 0 30px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
}

.sidebar.collapsed {
    width: var(--sidebar-collapsed-width);
}

.sidebar-brand {
    height: var(--navbar-height);
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    overflow: hidden;
    white-space: nowrap;
}

.sidebar.collapsed .sidebar-brand span {
    display: none;
}

.sidebar-nav {
    flex-grow: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 1rem 0.75rem;
}

.sidebar.collapsed .sidebar-nav {
    padding: 1rem 0.5rem;
}

.sidebar-nav .nav-link {
    color: rgba(255, 255, 255, 0.5);
    padding: 0.75rem 1rem;
    border-radius: 0.75rem;
    margin-bottom: 0.25rem;
    transition: all 0.2s ease;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    white-space: nowrap;
}

.sidebar.collapsed .nav-link {
    justify-content: center;
    padding: 0.75rem;
    gap: 0;
}

.sidebar.collapsed .nav-link span,
.sidebar.collapsed .nav-section-label {
    display: none;
}

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

.sidebar-nav .nav-link.active {
    background: rgba(255, 215, 0, 0.08);
    color: var(--gold);
    border: 1px solid rgba(255, 215, 0, 0.1);
}

.sidebar-nav .nav-link i {
    font-size: 1.25rem;
    min-width: 24px;
    text-align: center;
}

.nav-section-label {
    padding: 1.5rem 1rem 0.5rem;
}

/* --- Top Navbar --- */
.top-navbar {
    height: var(--navbar-height);
    position: fixed;
    top: 0;
    right: 0;
    left: var(--sidebar-width);
    background: rgba(15, 3, 26, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    z-index: 1030;
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    transition: left var(--transition-speed) ease;
}

.sidebar.collapsed+.main-content .top-navbar,
body.sidebar-collapsed .top-navbar {
    left: var(--sidebar-collapsed-width);
}

.main-content {
    margin-left: var(--sidebar-width);
    padding-top: calc(var(--navbar-height) + 2rem);
    padding-left: 1.5rem;
    padding-right: 1.5rem;
    padding-bottom: 3rem;
    transition: margin-left var(--transition-speed) ease;
    min-height: 100vh;
}

body.sidebar-collapsed .main-content {
    margin-left: var(--sidebar-collapsed-width);
}

.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    z-index: 1035;
    display: none;
}

/* --- Marquee --- */
.marquee-container {
    background: var(--gold);
    color: var(--deep-purple);
    font-weight: 800;
    text-transform: uppercase;
    font-size: 0.75rem;
    padding: 0.75rem 0;
    overflow: hidden;
    position: sticky;
    bottom: 0;
    width: 100%;
    z-index: 1000;
}

.marquee-content {
    display: flex;
    white-space: nowrap;
    animation: marquee 30s linear infinite;
}

@keyframes marquee {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
    }
}

/* --- Responsive Adjustments --- */
@media (max-width: 1200px) {
    .main-content {
        padding: 2rem;
    }
}

@media (max-width: 992px) {
    .sidebar {
        transform: translateX(-100%);
        width: var(--sidebar-width) !important;
    }

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

    .main-content,
    .top-navbar {
        margin-left: 0 !important;
        left: 0 !important;
    }

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

@media (max-width: 768px) {
    .bottom-nav {
        display: flex;
    }

    main {
        padding-bottom: 80px;
    }

    .marquee-container {
        bottom: 65px;
    }

    /* Adjust for bottom nav */
    .premium-card:hover {
        transform: none;
    }
}

@media (max-width: 480px) {
    .container {
        padding-left: 1.25rem;
        padding-right: 1.25rem;
    }

    .btn-lg {
        width: 100%;
    }

    .premium-card,
    .admin-card {
        padding: 1.5rem;
    }
}

/* --- Tables --- */
.table-responsive {
    border-radius: 1rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table-dark {
    --bs-table-bg: transparent;
}

.table-dark td,
.table-dark th {
    border-color: rgba(255, 255, 255, 0.05);
    padding: 1rem;
}