/* ==========================================================================
   1. VARIABLES & COLOR THEME
   ========================================================================== */
:root {
    --primary: #7f1d1d;       /* Deep Maroon */
    --white: #ffffff;
    --bg-body: #fffbf0;       /* Cream */
    --bg-card: #fff1f2;       /* Rose White */
    --border: #fecdd3;
    --text-main: #2d0a0a;
    --text-muted: #5c2b0c;
    --accent: #b45309;        /* Gold/Bronze */
    --highlight: #ffeb3b;     /* Bright Yellow */
    --shadow: 0 4px 6px rgba(0,0,0,0.1);
    --shadow-md: 0 8px 15px rgba(0,0,0,0.1);
}

/* ==========================================================================
   2. RESET & BASE (Mobile-Optimized)
   ========================================================================== */
html { 
    font-size: 62.5%; /* Sets base 1rem to 10px */
} 

body {
    background-color: var(--bg-body);
    color: var(--text-main);
    font-family: system-ui, -apple-system, sans-serif;
    font-size: 1.6rem;
    line-height: 1.6;
    margin: 0;
    padding-top: 60px; /* Space for fixed top navbar */
    padding-bottom: 80px; /* Space for bottom nav */
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

a { 
    color: var(--primary); 
    text-decoration: none; 
    font-weight: 700; 
    transition: 0.2s ease;
}
a:hover, a:focus, a:active { text-decoration: none; color: var(--accent); }
img { max-width: 100%; display: block; margin: 0 auto; }
*, *:before, *:after { box-sizing: border-box; }

/* ==========================================================================
   3. TYPOGRAPHY & ANIMATIONS
   ========================================================================== */
h1, h2, h3 { font-weight: 800; margin: 20px 0 10px; line-height: 1.2; color: var(--text-main); }
h1 { font-size: 2.6rem; text-transform: capitalize; }
h2 { font-size: 2.2rem; }
h3 { font-size: 1.8rem; }
p { margin-bottom: 15px; }

/* Main Site Title Animation */
.site-logo {
    font-size: 3.6rem;
    font-weight: 900;
    text-align: center;
    margin: 10px 0;
    background: linear-gradient(90deg, #ff00cc, #333399, #00ffff, #ff00cc);
    background-size: 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: shine 3s linear infinite;
    filter: drop-shadow(0px 0px 4px rgba(255, 0, 204, 0.8));
}
@keyframes shine { to { background-position: 200%; } }

/* ==========================================================================
   4. NAVIGATION (Top Fixed & Sidebar)
   ========================================================================== */
.top-fixed {
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1050;
    box-shadow: var(--shadow);
}

.navbar.navc {
    background: var(--primary); /* Deep Maroon Navbar */
    color: var(--white);
    border: none;
    border-radius: 0;
    margin: 0;
    padding: 12px 0;
    display: flex;
    align-items: center;
}
.navbar a { color: var(--white); }

.t-brand {
    font-size: 2.0rem;
    font-weight: 800;
    margin-left: 15px;
    letter-spacing: 0.5px;
}
#menu-open { font-size: 2.4rem; cursor: pointer; }

/* Sidebar Wrapper */
#sidebar-wrapper {
    position: fixed;
    top: 0;
    left: -280px; 
    width: 280px;
    height: 100vh;
    background: var(--white);
    z-index: 1100;
    overflow-y: auto;
    box-shadow: 2px 0 10px rgba(0,0,0,0.2);
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
#wrapper.toggled #sidebar-wrapper { left: 0; }

.brand.block {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
}
.brand.block .brand.l { font-size: 2rem; font-weight: 800; color: var(--primary); }
.close { font-size: 3rem; color: var(--text-muted); cursor: pointer; opacity: 0.8; }

.sidebar-nav { list-style: none; padding: 0; margin: 0; }
.sidebar-nav li a {
    display: block;
    padding: 15px 20px;
    font-size: 1.8rem;
    color: var(--text-main);
    border-bottom: 1px solid var(--border);
    transition: background 0.2s;
}
.sidebar-nav li a:hover { background: var(--bg-card); color: var(--primary); }
.sidebar-nav li a span { margin-right: 10px; color: var(--primary); }

/* ==========================================================================
   5. BOTTOM MOBILE NAVIGATION
   ========================================================================== */
.nav-bottom {
    position: fixed;
    bottom: 0; left: 0; width: 100%;
    height: 60px;
    background: var(--primary); /* Deep Maroon */
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 1040;
    box-shadow: 0 -4px 10px rgba(0,0,0,0.2);
}
.nav-bottom .grid-3 { flex: 1; }
.nav-bottom a {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
    color: var(--white);
    font-size: 2.4rem;
    padding: 10px;
}
.pulse { animation: pulse 2s infinite; }
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.2); } }

@media (min-width: 768px) {
    .nav-bottom { display: none; }
    body { padding-bottom: 0; }
}

/* ==========================================================================
   6. CARDS & SECTIONS (Overrides Bootstrap .list-group-item)
   ========================================================================== */
.container.cpad { max-width: 800px; margin: 0 auto; padding: 15px; }

.list-group-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px !important;
    margin-bottom: 20px;
    padding: 20px;
    box-shadow: var(--shadow);
}

/* Thematic Section Headers */
.list-group-item.active {
    background: linear-gradient(135deg, var(--primary) 0%, #4338ca 100%);
    border-color: var(--primary);
    color: var(--white);
    font-size: 2.4rem;
    font-weight: 800;
    text-align: center;
    padding: 15px;
    text-shadow: 0px 2px 4px rgba(0, 0, 0, 0.3);
}

.list-group-item.active h1, 
.list-group-item.active h2 {
    color: var(--white);
    margin: 0;
}

/* ==========================================================================
   7. MATKA RESULT BOXES
   ========================================================================== */
.result-block {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
    padding: 20px 10px;
    font-size: 2rem;
    color: var(--text-main);
    border: 2px solid var(--border);
}

.result-block h3 {
    background: var(--primary);
    color: var(--white);
    padding: 10px;
/*    margin: -20px -10px 15px -10px; */
    border-radius: 10px 10px 0 0;
    font-size: 2.2rem;
    text-shadow: 0px 3px 5px rgba(0, 0, 0, 0.4);
}

.result-block b {
    font-size: 3.2rem;
    font-weight: 900;
    color: var(--text-main);
    padding: 0 5px;
    text-shadow: -1px -1px 0px rgba(255,255,255,0.8), 2px 2px 2px rgba(127, 29, 29, 0.2);
}

/* ==========================================================================
   8. BUTTONS (Gold Glow Theme)
   ========================================================================== */
.btn-primary, .btn-success, .btn-block {
    display: inline-block;
    padding: 12px 24px;
    border-radius: 50px;
    font-size: 1.8rem;
    font-weight: 800;
    text-align: center;
    text-transform: uppercase;
    cursor: pointer;
    background: linear-gradient(135deg, #fbbf24 0%, #d97706 100%);
    color: var(--white);
    border: none;
    box-shadow: var(--shadow);
    animation: glow-pulse 2s infinite;
    transition: 0.2s;
    touch-action: manipulation;
}

.btn-primary:hover, .btn-success:hover, .btn-primary:active, .btn-success:active {
    color: var(--white);
    transform: scale(1.05);
}

/* The specific glow-pulse animation you requested */
@keyframes glow-pulse {
    0% { box-shadow: 0 0 0 0 rgba(251, 191, 36, 0.7); }
    70% { box-shadow: 0 0 0 15px rgba(251, 191, 36, 0); }
    100% { box-shadow: 0 0 0 0 rgba(251, 191, 36, 0); }
}

/* ==========================================================================
   9. TABLES & TIMETABLE
   ========================================================================== */
.table-responsive {
    background: var(--white);
    border-radius: 12px;
    box-shadow: var(--shadow);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid var(--border);
    margin-bottom: 20px;
}
.table { margin-bottom: 0; width: 100%; border-collapse: collapse; }
.table th {
    background-color: var(--bg-card);
    color: var(--primary);
    text-align: center;
    padding: 15px;
    font-size: 1.6rem;
    border-bottom: 2px solid var(--border);
}
.table td {
    padding: 15px;
    text-align: center;
    vertical-align: middle;
    border-bottom: 1px solid var(--border);
    font-size: 1.6rem;
}

/* ==========================================================================
   10. SCROLL BUTTONS
   ========================================================================== */
.scroll-btn {
    position: fixed;
    right: 20px;
    width: 50px;
    height: 50px;
    background-color: var(--primary); /* Matched to theme */
    color: var(--white);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 2.4rem;
    z-index: 1000;
    box-shadow: var(--shadow-md);
    transition: background-color 0.3s, transform 0.3s, opacity 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.scroll-btn:hover {
    background-color: var(--text-main);
    transform: scale(1.1);
}
#goBottomBtn { bottom: 80px; } /* Lifted above bottom nav */
#goTopBtn {
    bottom: 140px; 
    opacity: 0;   
    visibility: hidden;
    pointer-events: none; 
}
#goTopBtn.show {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* ==========================================================================
   11. UTILITIES
   ========================================================================== */
.text-center { text-align: center; }
.text-uppercase { text-transform: uppercase; }
.img-responsive { max-width: 100%; height: auto; display: block; margin: 0 auto; }