/* Core CSS Design System for FSSIB SUG DINNER AND AWARD NIGHT */

:root {
    --primary: #6366f1;
    --secondary: #a855f7;
    
    /* Dark Theme (Default) */
    --bg-dark: #0f172a;
    --bg-dark-rgb: 15, 23, 42;
    --bg-card: rgba(30, 41, 59, 0.7);
    --bg-card-rgb: 30, 41, 59;
    --border-color: rgba(255, 255, 255, 0.08);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --text-heading: #ffffff;
    --input-bg: rgba(15, 23, 42, 0.6);
    --nav-bg: rgba(15, 23, 42, 0.85);
    --section-alt-bg: rgba(15, 23, 42, 0.5);
    --badge-color: #ffffff;
    
    --shadow-main: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body.light-mode {
    /* Light Theme Toggle */
    --bg-dark: #f1f5f9;
    --bg-dark-rgb: 241, 245, 249;
    --bg-card: rgba(255, 255, 255, 0.8);
    --bg-card-rgb: 255, 255, 255;
    --border-color: rgba(100, 116, 139, 0.15);
    --text-main: #1e293b;
    --text-muted: #475569;
    --text-heading: #0f172a;
    --input-bg: rgba(255, 255, 255, 0.9);
    --nav-bg: rgba(255, 255, 255, 0.92);
    --section-alt-bg: rgba(226, 232, 240, 0.5);
    --badge-color: #ffffff;
    --shadow-main: 0 8px 32px 0 rgba(99, 102, 241, 0.08);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Outfit', sans-serif;
    background: var(--bg-dark);
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
    transition: var(--transition);
}

/* Glassmorphism Classes */
.glass-container {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: var(--shadow-main);
    transition: var(--transition);
}

.glass-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: var(--shadow-main);
    transition: var(--transition);
    height: 100%;
}

.glass-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
    box-shadow: 0 10px 25px rgba(99, 102, 241, 0.2);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-dark);
}
::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--secondary);
}

/* Buttons */
.btn-gradient {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border: none;
    color: #fff !important;
    font-weight: 600;
    border-radius: 10px;
    padding: 0.75rem 1.75rem;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.btn-gradient::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, var(--secondary), var(--primary));
    opacity: 0;
    transition: var(--transition);
    z-index: -1;
}

.btn-gradient:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(99, 102, 241, 0.4);
}

.btn-gradient:hover::before {
    opacity: 1;
}

/* Form Styles */
.form-control, .form-select {
    background: var(--input-bg);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    border-radius: 10px;
    padding: 0.75rem 1rem;
    transition: var(--transition);
}

.form-control:focus, .form-select:focus {
    background: var(--input-bg);
    border-color: var(--primary);
    color: var(--text-main);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25);
}

/* Navigation bar */
.navbar-custom {
    background: var(--nav-bg);
    border-bottom: 1px solid var(--border-color);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 1rem 0;
    transition: var(--transition);
}

.navbar-brand span {
    color: var(--text-heading) !important;
}

body.light-mode .navbar-toggler span {
    color: var(--text-heading) !important;
}

.nav-link {
    color: var(--text-main) !important;
    font-weight: 500;
    margin: 0 0.5rem;
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -5px;
    left: 0;
    background: var(--primary);
    transition: var(--transition);
}

.nav-link:hover::after, .nav-link.active::after {
    width: 100%;
}

body.light-mode #themeToggle {
    color: var(--text-heading) !important;
}

/* =============================
   HERO SECTION – Animated BG
   ============================= */
.hero-section {
    padding: 8rem 0 5rem;
    text-align: center;
    position: relative;
    overflow: hidden;
    background:
        linear-gradient(rgba(15, 23, 42, 0.86), rgba(15, 23, 42, 0.92)),
        url('../images/award_voting_bg.png') no-repeat center center;
    background-size: cover;
}

body.light-mode .hero-section {
    background:
        linear-gradient(rgba(241, 245, 249, 0.88), rgba(241, 245, 249, 0.94)),
        url('../images/award_voting_bg.png') no-repeat center center;
    background-size: cover;
}

/* Animated mesh grid background */
.hero-section::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(99, 102, 241, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(99, 102, 241, 0.04) 1px, transparent 1px);
    background-size: 60px 60px;
    animation: gridShift 20s linear infinite;
    z-index: 0;
    pointer-events: none;
}

@keyframes gridShift {
    0% { transform: translate(0, 0); }
    100% { transform: translate(60px, 60px); }
}

/* Hero floating glow orbs */
.hero-glow {
    position: absolute;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.18) 0%, rgba(168, 85, 247, 0.08) 40%, transparent 70%);
    top: 10%;
    left: 50%;
    transform: translate(-50%, -30%);
    z-index: 0;
    pointer-events: none;
    animation: glowPulse 6s ease-in-out infinite alternate;
}

@keyframes glowPulse {
    0% { opacity: 0.6; transform: translate(-50%, -30%) scale(1); }
    100% { opacity: 1; transform: translate(-50%, -30%) scale(1.15); }
}

body.light-mode .hero-glow {
    background: radial-gradient(circle, rgba(99, 102, 241, 0.1) 0%, rgba(168, 85, 247, 0.05) 40%, transparent 70%);
}

/* Floating vote-themed particles canvas */
.hero-particles {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.hero-particle {
    position: absolute;
    opacity: 0;
    animation: floatUp var(--duration) var(--delay) ease-in-out infinite;
    font-size: var(--size);
    color: rgba(99, 102, 241, 0.15);
    filter: blur(0.5px);
}

body.light-mode .hero-particle {
    color: rgba(99, 102, 241, 0.12);
}

@keyframes floatUp {
    0%   { opacity: 0; transform: translateY(100vh) rotate(0deg) scale(0.5); }
    15%  { opacity: 0.7; }
    85%  { opacity: 0.7; }
    100% { opacity: 0; transform: translateY(-20vh) rotate(360deg) scale(1.1); }
}

/* Hero content stays above particles */
.hero-section .container {
    position: relative;
    z-index: 2;
}

.gradient-text {
    background: linear-gradient(135deg, #a5b4fc, #c084fc, #818cf8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 800;
}

body.light-mode .gradient-text {
    background: linear-gradient(135deg, #6366f1, #a855f7, #6366f1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Hero text colours – dark mode */
.hero-section h1 {
    color: var(--text-heading);
}

.hero-section .lead {
    color: var(--text-muted);
}

body.light-mode .hero-section h1 {
    color: #0f172a;
}

body.light-mode .hero-section .lead {
    color: #475569;
}

/* Countdown Timer */
.countdown-container {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin: 2.5rem 0;
}

.countdown-box {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    width: 80px;
    padding: 1rem 0;
    text-align: center;
    box-shadow: var(--shadow-main);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.countdown-number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
}

.countdown-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    color: var(--text-muted);
}

/* Stats Counter */
.bg-dark-rgb {
    background: var(--section-alt-bg) !important;
}

.stat-box {
    text-align: center;
    padding: 2rem;
}

.stat-number {
    font-size: 3rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Profile Details Page */
.profile-image-container {
    border-radius: 20px;
    overflow: hidden;
    border: 3px solid var(--border-color);
    box-shadow: var(--shadow-main);
}

.profile-image-container img {
    width: 100%;
    height: auto;
    display: block;
    transition: var(--transition);
}

.profile-image-container img:hover {
    transform: scale(1.05);
}

/* =============================
   Section Headings (Dark + Light)
   ============================= */
h2.fw-bold, h3.fw-bold, h4.fw-bold, h5.fw-bold, h6.fw-bold {
    color: var(--text-heading);
}

body.light-mode .text-white {
    color: var(--text-heading) !important;
}

body.light-mode .glass-card h5 {
    color: var(--text-heading) !important;
}

body.light-mode .btn-outline-light {
    color: var(--primary) !important;
    border-color: var(--primary) !important;
}

body.light-mode .btn-outline-light:hover {
    background: var(--primary) !important;
    color: #fff !important;
}

/* Testimonials & FAQs */
.faq-accordion .accordion-item {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    margin-bottom: 1rem;
    border-radius: 12px;
    overflow: hidden;
}

.faq-accordion .accordion-button {
    background: transparent;
    color: var(--text-main);
    font-weight: 600;
    box-shadow: none;
}

.faq-accordion .accordion-button:not(.collapsed) {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary);
}

.faq-accordion .accordion-body {
    background: transparent;
    color: var(--text-muted);
    border-top: 1px solid var(--border-color);
}

body.light-mode .faq-accordion .accordion-button::after {
    filter: none;
}

/* Footer styling */
footer {
    background: rgba(15, 23, 42, 0.95);
    border-top: 1px solid var(--border-color);
    padding: 3rem 0;
    margin-top: 5rem;
}

body.light-mode footer {
    background: #0f172a;
}

.footer-social-link {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-main);
    margin-right: 0.75rem;
    transition: var(--transition);
}

.footer-social-link:hover {
    background: var(--primary);
    color: #fff;
    transform: translateY(-3px);
}

/* =============================
   FORM LABELS – Light Mode
   ============================= */
.form-label {
    color: var(--text-main);
}

/* =============================
   Category / Award Cards – Light
   ============================= */
body.light-mode .glass-card {
    background: rgba(255, 255, 255, 0.85);
    border-color: rgba(100, 116, 139, 0.15);
    box-shadow: 0 4px 24px rgba(99, 102, 241, 0.06);
}

body.light-mode .glass-card:hover {
    box-shadow: 0 10px 30px rgba(99, 102, 241, 0.12);
    border-color: var(--primary);
}

body.light-mode .glass-container {
    background: rgba(255, 255, 255, 0.85);
    border-color: rgba(100, 116, 139, 0.12);
}

/* =============================
   Contact Section – Light Mode
   ============================= */
body.light-mode .bg-dark-rgb.bg-opacity-30,
body.light-mode .bg-dark-rgb.bg-opacity-50 {
    background: var(--section-alt-bg) !important;
}

/* =============================
   Responsive particle sizing
   ============================= */
@media (max-width: 768px) {
    .hero-particle {
        font-size: calc(var(--size) * 0.7) !important;
    }
    .hero-section {
        padding: 6rem 0 3rem;
    }
}

/* =============================
   MAXIMUM CONTRAST READABILITY OVERRIDES
   ============================= */
/* Force custom text-muted to override Bootstrap default dark grey values in Dark/Light themes */
.text-muted {
    color: var(--text-muted) !important;
}

body.light-mode {
    --text-main: #0f172a !important;      /* Deep black for light mode body text */
    --text-muted: #334155 !important;     /* Dark slate for light mode muted text */
    --text-heading: #000000 !important;   /* Pure black for light mode headings */
}

/* Footer (Always dark background) - Force bright text & links for contrast regardless of body mode */
footer, .footer,
body.light-mode footer, body.light-mode .footer {
    color: #e2e8f0 !important;
    background: #0f172a !important; /* Ensure footer background stays dark */
}
footer h1, footer h2, footer h3, footer h4, footer h5, footer h6,
body.light-mode footer h1, body.light-mode footer h2, body.light-mode footer h3, body.light-mode footer h4, body.light-mode footer h5, body.light-mode footer h6,
body.light-mode footer .text-white,
body.light-mode footer .fw-bold {
    color: #ffffff !important;
}
footer .text-muted, 
footer a.text-muted,
body.light-mode footer .text-muted,
body.light-mode footer a.text-muted {
    color: #94a3b8 !important;
}
footer a.text-muted:hover,
body.light-mode footer a.text-muted:hover {
    color: #ffffff !important;
    text-decoration: underline !important;
}

/* Stat numbers and text inside stat box labels */
.stat-box .text-muted {
    color: #cbd5e1 !important;            /* Bright silver for dark theme stat labels */
    opacity: 0.95;
}
body.light-mode .stat-box .text-muted {
    color: #334155 !important;            /* Rich deep grey for light theme stat labels */
}

/* General text-white-50 overrides */
.text-white-50 {
    color: rgba(248, 250, 252, 0.75) !important;
}
body.light-mode .text-white-50 {
    color: rgba(15, 23, 42, 0.75) !important;
}

/* =============================
   RESULTS PAGE – Light Mode
   ============================= */
/* Category heading inside glass-container */
body.light-mode .glass-container h5.text-white,
body.light-mode .glass-container h5 {
    color: #0f172a !important;
}

/* Results table: strip the dark Bootstrap theme in light mode */
body.light-mode .table-dark {
    --bs-table-bg: transparent !important;
    --bs-table-color: #0f172a !important;
    --bs-table-border-color: rgba(100, 116, 139, 0.15) !important;
    background-color: transparent !important;
    color: #0f172a !important;
}

body.light-mode .table-dark thead tr {
    color: #475569 !important;
}

body.light-mode .table-dark thead th {
    color: #475569 !important;
    border-color: rgba(100, 116, 139, 0.2) !important;
}

body.light-mode .table-dark tbody tr td {
    color: #0f172a !important;
    border-color: rgba(100, 116, 139, 0.1) !important;
}

/* Contestant full_name inside table */
body.light-mode .table-dark .fw-semibold.text-white {
    color: #0f172a !important;
}

/* Percentage share text */
body.light-mode .table-dark .text-white-50 {
    color: rgba(15, 23, 42, 0.65) !important;
}

/* Progress bar track in light mode */
body.light-mode .table-dark .progress {
    background: rgba(15, 23, 42, 0.08) !important;
}

/* Crown / rank text */
body.light-mode .table-dark .fw-bold {
    color: #0f172a !important;
}
