/* 
* Theme Name: School Website - Modern Professional Edition
* Design: Clean, Institutional, Premium
*/

:root {
    /* --- Default Theme: Modern Professional (Blue & Crimson) --- */
    --primary-color: #0f4c81;
    /* Classic Blue - Trust & Stability */
    --primary-light: #357abd;
    --primary-dark: #0a3356;
    --primary-gradient: linear-gradient(135deg, #0f4c81 0%, #1e6bb8 100%);

    --secondary-color: #d32f2f;
    /* Crimson - Passion & Energy */
    --secondary-dark: #b71c1c;
    --secondary-gradient: linear-gradient(135deg, #d32f2f 0%, #b71c1c 100%);

    --accent-color: #ffd700;
    /* Gold - Excellence */

    /* Typography & Backgrounds */
    --text-main: #2c3e50;
    --text-light: #546e7a;
    --bg-body: #f8f9fa;
    /* Ghost White */
    --bg-white: #ffffff;
    --divider-color: #e9ecef;

    /* Shadows (Soft & Modern) */
    --shadow-sm: 0 2px 10px rgba(15, 76, 129, 0.05);
    --shadow-md: 0 8px 30px rgba(15, 76, 129, 0.08);
    /* Levitation effect */
    --shadow-lg: 0 20px 50px rgba(15, 76, 129, 0.12);
    --shadow-hover: 0 15px 35px rgba(211, 47, 47, 0.2);
    --shadow-glow: 0 0 20px rgba(211, 47, 47, 0.4);
    --shadow-btn-color: 211, 47, 47;
    /* Crimson RGB for button shadows */
}

/* --- Royal Bone Theme --- */
[data-theme="royal"] {
    /* Royal Blue #162660 */
    --primary-color: #162660;
    --primary-light: #2c4291;
    --primary-dark: #0a1230;
    --primary-gradient: linear-gradient(135deg, #162660 0%, #162660 100%);
    /* Solid Royal */

    /* Powder Blue #D0E6FD - Used as Secondary equivalent (needs text adjustment) */
    /* Since Secondary is often used for buttons with white text, we might need a darker variant for text, 
       but for backgrounds Powder Blue is good. 
       Let's use Royal Blue as the main "Secondary" interaction color too, but maybe lighter?
       The user wants THESE 3 colors. 
       Bone #F1E4D1
    */

    /* Mapping: 
       Primary -> Royal Blue #162660
       Secondary -> Used for highlights/buttons. Let's make secondary closer to Royal or a Gold/Bone contrast.
       Actually, let's use the Powder Blue for "Light" backgrounds and Bone for "Accent".
       If I set Secondary to Powder Blue, text on it must be dark.
       Let's set Secondary Gradient to a mix of Royal and Powder?
       Or, let's simply make the 'Secondary' color distinct.
       Let's try using the Bone color as the Accent and Powder Blue as a background tint.
       
       Re-mapping for functional CSS:
    */
    --primary-color: #162660;
    --primary-dark: #000000;
    --primary-gradient: linear-gradient(135deg, #162660 0%, #2a3c7a 100%);

    --secondary-color: #162660;
    /* Keep uniform or use a darker Powder? */
    /* Let's try to use the colors as asked: */
    --secondary-color: #558abb;
    /* Mid-tone blue derived from Powder/Royal mix */
    --secondary-dark: #162660;
    --secondary-gradient: linear-gradient(135deg, #162660 0%, #4a6fa5 100%);

    --accent-color: #F1E4D1;
    /* Bone */

    --text-main: #162660;
    /* Royal Blue Text */
    --text-light: #4a5a8a;
    --bg-body: #F1E4D1;
    /* Bone Background */
    --bg-white: #ffffff;

    /* Adjust Shadows to match Royal Blue */
    --shadow-sm: 0 2px 10px rgba(22, 38, 96, 0.05);
    --shadow-md: 0 8px 30px rgba(22, 38, 96, 0.08);
    --shadow-lg: 0 20px 50px rgba(22, 38, 96, 0.12);
    --shadow-hover: 0 15px 35px rgba(22, 38, 96, 0.2);
    --shadow-glow: 0 0 20px rgba(22, 38, 96, 0.4);

    --shadow-btn-color: 22, 38, 96;
    /* Royal Blue RGB for button shadows */
}

/* --- Sunset Surf Theme --- */
[data-theme="sunset"] {
    /* Blue Surf #3B5B8A - Calming & Trustworthy */
    --primary-color: #3B5B8A;
    --primary-light: #5d7ca8;
    --primary-dark: #1e3a63;
    --primary-gradient: linear-gradient(135deg, #3B5B8A 0%, #2a4570 100%);

    /* Sunset Sorbet #F2B33D - Vibrant & Energetic */
    --secondary-color: #F2B33D;
    --secondary-dark: #d99a20;
    --secondary-gradient: linear-gradient(135deg, #F2B33D 0%, #f5c05c 100%);

    --accent-color: #FFE082;
    /* Lighter yellow/gold */

    --text-main: #2d3e50;
    --text-light: #546e7a;
    --bg-body: #fdfaf5;
    /* Warm off-white */
    --bg-white: #ffffff;

    /* Shadows - Blue tinted */
    --shadow-sm: 0 2px 10px rgba(59, 91, 138, 0.1);
    --shadow-md: 0 8px 30px rgba(59, 91, 138, 0.12);
    --shadow-lg: 0 20px 50px rgba(59, 91, 138, 0.15);
    --shadow-hover: 0 15px 35px rgba(242, 179, 61, 0.25);
    --shadow-glow: 0 0 20px rgba(242, 179, 61, 0.4);

    --shadow-btn-color: 242, 179, 61;
    /* Sunset Sorbet RGB */
}

/* Sunset Theme Specifics */
[data-theme="sunset"] .navbar-custom {
    background: rgba(255, 255, 255, 0.96);
}

[data-theme="sunset"] .btn-cyan {
    color: #fff;
    /* Ensure text is readable on yellow/orange, usually white is fine */
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    /* Add subtle shadow for better contrast on yellow */
}

/* --- Vibrant Spice Theme --- */
[data-theme="vibrant"] {
    /* Tyrian Purple #5F0F40 - Deep & Luxurious */
    --primary-color: #5F0F40;
    --primary-light: #8a1c5e;
    --primary-dark: #3a0525;
    --primary-gradient: linear-gradient(135deg, #5F0F40 0%, #9A031E 100%);
    /* Purple to Ruby */

    /* Dark Orange #FB8B24 - Energetic & Vibrant */
    --secondary-color: #FB8B24;
    --secondary-dark: #e36414;
    --secondary-gradient: linear-gradient(135deg, #FB8B24 0%, #E36414 100%);
    /* Orange to Pumpkin */

    --accent-color: #E36414;
    /* Pumpkin */

    --text-main: #3a0525;
    /* Dark Purple Text */
    --text-light: #7c2d52;
    --bg-body: #fff9f2;
    /* Very light warm tint */
    --bg-white: #ffffff;

    /* Shadows - Purple/Red tinted */
    --shadow-sm: 0 2px 10px rgba(95, 15, 64, 0.08);
    --shadow-md: 0 8px 30px rgba(95, 15, 64, 0.1);
    --shadow-lg: 0 20px 50px rgba(95, 15, 64, 0.15);
    --shadow-hover: 0 15px 35px rgba(251, 139, 36, 0.25);
    --shadow-glow: 0 0 20px rgba(251, 139, 36, 0.4);

    --shadow-btn-color: 251, 139, 36;
    /* Dark Orange RGB */
}

/* Vibrant Theme Specifics */
[data-theme="vibrant"] .navbar-custom {
    background: rgba(255, 255, 255, 0.96);
}

[data-theme="vibrant"] .btn-cyan {
    color: #fff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Adjustments for Royal Theme specifically */
[data-theme="royal"] .btn-cyan {
    color: #fff;
    /* Ensure text is white on dark gradients */
}

[data-theme="royal"] .bg-light {
    background-color: #D0E6FD !important;
    /* Powder Blue for light sections */
}

[data-theme="royal"] .navbar-custom {
    background: rgba(255, 255, 255, 0.95);
}


body {
    font-family: 'Open Sans', sans-serif;
    color: var(--text-main);
    line-height: 1.8;
    background-color: var(--bg-body);
    overflow-x: hidden;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    color: var(--primary-dark);
    letter-spacing: -0.5px;
}

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

.bg-primary-custom {
    background: var(--primary-gradient) !important;
    color: white;
}

.text-secondary-custom {
    color: var(--secondary-dark) !important;
}

.bg-secondary-custom {
    background: var(--secondary-gradient) !important;
    color: white;
}

/* Ensure headings in dark sections are white */
.bg-primary-custom h1,
.bg-primary-custom h2,
.bg-primary-custom h3,
.bg-primary-custom h4,
.bg-primary-custom h5,
.bg-primary-custom h6,
.bg-secondary-custom h1,
.bg-secondary-custom h2,
.bg-secondary-custom h3,
.bg-secondary-custom h4,
.bg-secondary-custom h5,
.bg-secondary-custom h6 {
    color: white !important;
}

/* Premium Buttons */
.btn {
    border-radius: 50px;
    padding: 12px 35px;
    font-weight: 600;
    font-family: 'Montserrat', sans-serif;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 1px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.btn-cyan {
    background: var(--secondary-gradient);
    color: white;
    box-shadow: 0 4px 15px rgba(var(--shadow-btn-color), 0.3);
}

.btn-cyan:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(var(--shadow-btn-color), 0.5);
    color: white;
}

.btn-outline-light {
    border: 2px solid white;
    color: white;
    background: transparent;
}

.btn-outline-light:hover {
    background: white;
    color: var(--primary-color);
    box-shadow: 0 5px 15px rgba(255, 255, 255, 0.3);
}

/* --- Header & Top Bar --- */
.top-bar {
    background: var(--primary-dark);
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.85rem;
    padding: 12px 0;
    font-weight: 500;
}

.top-bar a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    transition: color 0.3s;
}

.top-bar a:hover {
    color: var(--secondary-color);
}

/* Glassy Navbar */
.navbar-custom {
    background: rgba(255, 255, 255, 0.98);
    /*backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);*/
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
    padding: 15px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.02);
}

.navbar-brand h2 {
    font-size: 1.6rem;
    letter-spacing: -1px;
    color: var(--primary-color);
}

/* Nav Links as Pills */
.nav-link {
    font-weight: 600;
    color: var(--primary-dark) !important;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.9rem;
    padding: 10px 20px !important;
    margin: 0 5px;
    position: relative;
    border-radius: 50px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-link:hover,
.nav-link.active {
    color: white !important;
    background: var(--primary-gradient);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

/* Dropdown Animation */
.dropdown-menu {
    border: none;
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    padding: 20px 0;
    margin-top: 15px !important;
    display: block;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: white;
}

.nav-item.dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    font-family: 'Open Sans', sans-serif;
    font-size: 0.95rem;
    padding: 12px 30px;
    color: var(--text-main);
    transition: all 0.2s;
    font-weight: 500;
    border-left: 3px solid transparent;
}

.dropdown-item:hover {
    background: rgba(15, 76, 129, 0.03);
    color: var(--primary-color);
    padding-left: 35px;
    border-left-color: var(--secondary-color);
}

/* Triangle for Dropdown */
.dropdown-menu::before {
    content: '';
    position: absolute;
    top: -8px;
    left: 25px;
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 8px solid white;
}

/* --- Hero Slider --- */
.hero-slider .carousel-item {
    height: 700px;
    background-size: cover;
    background-position: center;
}

.hero-overlay {
    /*background: linear-gradient(90deg, rgba(15, 76, 129, 0.9) 0%, rgba(0, 191, 165, 0.7) 100%);*/
    background: linear-gradient(90deg, rgba(9, 9, 9, 0.5) 0%, rgba(7, 7, 7, 0.3) 100%);
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
}

.hero-content h1 {
    font-size: 4.5rem;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    color: white;
    text-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.hero-content p {
    font-size: 1.4rem;
    font-weight: 300;
    color: rgba(255, 255, 255, 0.95);
    max-width: 650px;
    margin-bottom: 2.5rem;
}

/* --- Feature Cards & General Cards --- */
.feature-card {
    background: white;
    padding: 45px 35px;
    border-radius: 16px;
    box-shadow: var(--shadow-sm);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(0, 0, 0, 0.02);
    height: 100%;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

/* --- Theme Switcher Widget --- */
.theme-switcher-wrapper {
    position: fixed;
    top: 50%;
    right: 0;
    transform: translateY(-50%);
    z-index: 9999;
    display: flex;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.theme-toggle-btn {
    background: var(--primary-dark);
    color: white;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 8px 0 0 8px;
    box-shadow: -4px 0 15px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.theme-toggle-btn:hover {
    background: var(--secondary-color);
    width: 55px;
}

.theme-panel {
    background: white;
    width: 0;
    /* Hidden by default */
    overflow: hidden;
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.1);
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 0 0 0 8px;
}

.theme-switcher-wrapper.active .theme-panel {
    width: 280px;
}

.theme-panel-content {
    padding: 25px;
    width: 280px;
    /* Fixed width content to prevent reflow */
}

.theme-option {
    display: flex;
    align-items: center;
    padding: 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 10px;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.theme-option:hover {
    background: var(--bg-body);
    transform: translateX(5px);
}

.theme-option.active {
    border-color: var(--primary-color);
    background: rgba(15, 76, 129, 0.05);
}

.color-preview {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    margin-right: 15px;
    border: 2px solid rgba(0, 0, 0, 0.1);
    position: relative;
}

/* Double color preview */
.color-preview::after {
    content: '';
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 14px;
    height: 14px;
    background: var(--secondary-preview);
    border-radius: 50%;
    border: 2px solid white;
}

.feature-card:hover {
    transform: translateY(-12px);
    box-shadow: var(--shadow-lg);
}

.feature-icon {
    font-size: 3.5rem;
    background: var(--secondary-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 25px;
    display: inline-block;
}

.card {
    border-radius: 16px;
    overflow: hidden;
    border: none;
    background: white;
    box-shadow: var(--shadow-sm);
    transition: all 0.4s ease;
}

.card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-5px);
}

/* --- Event Cards --- */
.event-card {
    border-radius: 12px;
    background: white;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.05);
    /* Subtle base shadow */
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    border: 1px solid rgba(0, 0, 0, 0.02) !important;
}

.event-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

.event-img-wrapper {
    position: relative;
    overflow: hidden;
    border-radius: 12px 12px 0 0;
    height: 220px;
}

.event-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.event-card:hover .event-img-wrapper img {
    transform: scale(1.08);
    /* Zoom effect */
}

.event-date-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background: white;
    padding: 6px 12px;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    color: var(--primary-dark);
    z-index: 10;
    line-height: 1.1;
    min-width: 60px;
}

.event-date-badge .fs-4 {
    color: var(--secondary-color);
    font-weight: 800;
    font-size: 1.4rem !important;
}

.event-date-badge .small {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.5px;
}

/* --- Sections --- */
.section-padding {
    padding: 100px 0;
}

.bg-light {
    background-color: #f0f2f5 !important;
}

.section-title h2 {
    font-size: 2.8rem;
    margin-bottom: 1.5rem;
    color: var(--primary-dark);
}

.section-title p {
    color: var(--text-light);
    max-width: 700px;
    margin: 0 auto;
    font-size: 1.1rem;
}

/* --- Footer --- */
footer {
    background: var(--primary-dark);
    color: rgba(255, 255, 255, 0.7);
    padding-top: 90px;
}

footer h5 {
    color: white;
    margin-bottom: 35px;
    font-size: 1.3rem;
    font-weight: 700;
}

footer a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: all 0.3s;
    display: inline-block;
    font-size: 0.95rem;
}

footer a:hover {
    color: var(--secondary-color);
    transform: translateX(8px);
}

.footer-bottom {
    background: rgba(0, 0, 0, 0.2);
    padding: 30px 0;
    margin-top: 70px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* --- Adjustments for active list groups in Sidebars --- */
.list-group-item.active {
    background: var(--primary-gradient) !important;
    border-color: transparent !important;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .hero-content h1 {
        font-size: 2.8rem;
    }

    .section-padding {
        padding: 60px 0;
    }

    .nav-link {
        margin: 5px 0;
        border-radius: 8px;
    }
}

/* --- Mobile Drawer (Offcanvas) Styles (< 992px) --- */
@media (max-width: 991.98px) {
    .offcanvas-lg {
        position: fixed !important;
        top: 0;
        bottom: 0;
        left: 0;
        z-index: 1045;
        display: flex;
        flex-direction: column;
        max-width: 80%;
        width: 300px;
        background-color: var(--bg-white);
        background-clip: padding-box;
        border-right: 1px solid rgba(0, 0, 0, 0.05);
        box-shadow: var(--shadow-lg);
        outline: 0;
        transform: translateX(-100%);
        transition: transform 0.3s ease-in-out;
        visibility: hidden;
    }

    .offcanvas-lg.show {
        transform: none;
        visibility: visible;
    }

    /* Theme Backgrounds for Drawer */
    [data-theme="royal"] .offcanvas-lg {
        background-color: #F1E4D1;
    }

    [data-theme="sunset"] .offcanvas-lg {
        background-color: #fdfaf5;
    }

    [data-theme="vibrant"] .offcanvas-lg {
        background-color: #fff9f2;
    }

    /* Drawer links */
    .offcanvas-body .nav-link {
        padding: 12px 20px !important;
        margin: 5px 0;
        border-radius: 8px;
        font-size: 1rem;
        border: 1px solid transparent;
        display: block;
        /* Ensure block display */
        color: var(--text-main);
    }

    .offcanvas-body .nav-link:hover,
    .offcanvas-body .nav-link.active {
        background: rgba(var(--shadow-btn-color), 0.1);
        color: var(--primary-color) !important;
        box-shadow: none;
        transform: none;
        border-color: rgba(var(--shadow-btn-color), 0.2);
    }

    .offcanvas-body .btn-cyan {
        width: 100%;
        text-align: center;
        margin-top: 20px;
    }

    /* Dropdown inside drawer */
    .dropdown-menu {
        box-shadow: none;
        border: none;
        background: transparent;
        padding-left: 10px;
        margin-top: 0 !important;
        display: none;
        /* Hide default, show on click via BS JS */
        opacity: 1;
        visibility: visible;
        transform: none;
        position: static;
    }

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

    .dropdown-item {
        padding: 10px 15px;
        border-left: 2px solid rgba(0, 0, 0, 0.1);
    }

    .dropdown-menu::before {
        display: none;
    }

    /* Mobile Header adjustments */
    .offcanvas-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 1rem 1rem;
        border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    }
}