/**
 * Core Design System & Public Stylesheet
 * School Management Website
 */

:root {
    --primary: #1a5c38;
    --primary-light: #257e4e;
    --primary-dark: #103b23;
    --accent: #d4af37;
    --accent-hover: #bda02b;
    --bg-main: #f8fafc;
    --bg-card: #ffffff;
    --text-color: #1e293b;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --success: #10b981;
    --danger: #ef4444;
    --font-bn: 'Hind Siliguri', sans-serif;
    --font-en: 'Outfit', sans-serif;
    --max-width: 1200px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --transition: all 0.25s ease-in-out;
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-main);
    color: var(--text-color);
    font-family: var(--font-bn);
    font-size: 16px;
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-bn);
    font-weight: 700;
    color: var(--primary-dark);
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--primary-light);
}

.container {
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 20px;
}

/* Helper Classes */
.desktop-only {
    display: none;
}
@media (min-width: 768px) {
    .desktop-only {
        display: inline;
    }
}

/* Top Bar Styling */
.top-bar {
    background-color: var(--primary-dark);
    color: white;
    font-size: 14px;
    padding: 10px 0;
    border-bottom: 2px solid var(--accent);
}
.top-bar-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.top-bar-btn {
    background-color: var(--accent);
    color: #000 !important;
    padding: 4px 12px;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}
.top-bar-btn:hover {
    background-color: var(--accent-hover);
}

/* Main Header */
.main-header {
    background-color: var(--white);
    padding: 20px 0;
    box-shadow: var(--shadow-sm);
    border-bottom: 1px solid var(--border-color);
}
.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.logo-area {
    display: flex;
    align-items: center;
    gap: 15px;
}
.school-logo {
    height: 65px;
    width: auto;
    max-width: 280px;
    object-fit: contain;
}
@media (max-width: 576px) {
    .school-logo {
        height: 50px;
        max-width: 160px;
    }
    .school-titles h1 {
        font-size: 16px !important;
    }
    .school-titles h2 {
        font-size: 12px !important;
    }
    .logo-area {
        gap: 10px;
    }
}
.logo-placeholder {
    width: 65px;
    height: 65px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    border: 2px solid var(--accent);
}
.school-titles h1 {
    font-size: 22px;
    line-height: 1.2;
    margin-bottom: 3px;
}
.school-titles h2 {
    font-family: var(--font-en);
    font-size: 15px;
    color: var(--text-muted);
    font-weight: 600;
    letter-spacing: 0.5px;
}
.nav-toggle {
    background: none;
    border: 1px solid var(--border-color);
    color: var(--primary);
    padding: 8px 12px;
    font-size: 18px;
    cursor: pointer;
    border-radius: var(--radius-sm);
}
@media (min-width: 992px) {
    .nav-toggle {
        display: none;
    }
}

/* Navigation */
.main-nav {
    background-color: var(--primary);
    position: relative;
    z-index: 100;
}
.nav-list {
    list-style: none;
    display: none;
    flex-direction: column;
}
.nav-list.show {
    display: flex;
}
.nav-list li a {
    display: block;
    color: white;
    padding: 12px 15px;
    font-weight: 600;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
.nav-list li a:hover {
    background-color: var(--primary-light);
    color: var(--accent);
}
@media (min-width: 992px) {
    .nav-list {
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
    }
    .nav-list li a {
        border-bottom: none;
        padding: 14px 20px;
    }
}

/* Navigation Dropdowns */
.dropdown {
    position: relative;
}
.dropdown-toggle {
    cursor: pointer;
    display: flex;
    align-items: center;
}
.dropdown-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}
@media (min-width: 992px) {
    .dropdown-menu {
        position: absolute;
        top: 100%;
        left: 0;
        background-color: var(--primary-dark);
        min-width: 180px;
        box-shadow: var(--shadow-md);
        display: none;
        flex-direction: column;
        border-radius: 0 0 var(--radius-sm) var(--radius-sm);
        border-top: 3px solid var(--accent);
        z-index: 1000;
        padding: 5px 0;
    }
    .dropdown:hover .dropdown-menu {
        display: flex;
    }
    .dropdown-menu li a {
        padding: 10px 20px !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05) !important;
        color: rgba(255, 255, 255, 0.9) !important;
        font-weight: 500 !important;
        font-size: 14px !important;
        white-space: nowrap;
        text-align: left;
    }
    .dropdown-menu li:last-child a {
        border-bottom: none !important;
    }
    .dropdown-menu li a:hover {
        background-color: var(--primary-light) !important;
        color: var(--accent) !important;
    }
}
@media (max-width: 991px) {
    .dropdown-menu {
        display: block;
        background-color: rgba(0, 0, 0, 0.15);
        padding-left: 15px;
    }
    .dropdown-toggle {
        background-color: rgba(255, 255, 255, 0.03);
        pointer-events: none;
    }
}

/* Page Layouts & Main Workspace */
.page-content {
    flex: 1;
    padding: 30px 20px;
}

/* Card Styling */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    padding: 25px;
    margin-bottom: 25px;
    overflow: hidden;
}
.card-title {
    font-size: 20px;
    border-bottom: 2px solid var(--accent);
    padding-bottom: 10px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Home Layout Specifics */
/* Hero Banner & Showcase Layout (Slider + Headmaster Side-by-Side) */
.showcase-container {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 25px;
    margin-bottom: 30px;
    align-items: stretch;
}

/* Slider Style */
.main-slider {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    height: 420px;
    border-bottom: 5px solid var(--accent);
    box-shadow: var(--shadow-md);
}
.slider-wrapper {
    width: 100%;
    height: 100%;
    position: relative;
}
.slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.8s ease-in-out, visibility 0.8s ease-in-out;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    align-items: flex-end;
    padding: 40px;
}
.slide.active {
    opacity: 1;
    visibility: visible;
    z-index: 1;
}
.slide-content {
    color: white;
    max-width: 80%;
    z-index: 10;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.6);
    text-align: left;
}
.slide-content h2 {
    font-size: 28px;
    color: var(--accent);
    margin-bottom: 10px;
    font-weight: 800;
}
.slide-content p {
    font-size: 15px;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.95);
}

/* Navigation Buttons */
.slider-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    z-index: 10;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}
.slider-nav-btn:hover {
    background: var(--primary);
    color: white;
}
.prev-btn {
    left: 20px;
}
.next-btn {
    right: 20px;
}

/* Dots */
.slider-dots {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 10;
}
.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: var(--transition);
}
.dot.active, .dot:hover {
    background: var(--accent);
    transform: scale(1.2);
}

/* Headmaster Card */
.headmaster-card {
    background: white;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-top: 5px solid var(--primary);
}
.headmaster-card-header {
    background-color: var(--primary-dark);
    color: white;
    padding: 15px;
    text-align: center;
    border-bottom: 2px solid var(--accent);
}
.headmaster-card-header h3 {
    font-size: 16px;
    font-weight: 700;
    margin: 0;
    font-family: var(--font-bn);
}
.headmaster-card-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    flex: 1;
    justify-content: space-between;
}
.hm-avatar-wrapper {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid var(--accent);
    margin-bottom: 12px;
    box-shadow: var(--shadow-sm);
}
.hm-avatar {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.headmaster-card-body h4 {
    font-size: 16px;
    color: var(--primary-dark);
    margin-bottom: 4px;
    font-weight: 700;
}
.hm-title {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 12px;
    font-weight: 600;
}
.hm-quote {
    font-size: 13px;
    line-height: 1.6;
    color: var(--text-color);
    font-style: italic;
    margin-bottom: 15px;
    background: #f8fafc;
    padding: 12px;
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--accent);
    text-align: justify;
}
.hm-readmore-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: bold;
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition);
    border: 1px solid var(--primary);
    padding: 8px 16px;
    border-radius: 20px;
    background: transparent;
}
.hm-readmore-btn:hover {
    background: var(--primary);
    color: white;
}

@media (max-width: 992px) {
    .showcase-container {
        grid-template-columns: 1.5fr 1fr;
        gap: 15px;
    }
    .main-slider {
        height: 380px;
    }
    .hm-avatar-wrapper {
        width: 100px;
        height: 100px;
    }
}

@media (max-width: 768px) {
    .showcase-container {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    .main-slider {
        height: 320px;
    }
    .slide-content h2 {
        font-size: 22px;
    }
    .slide-content p {
        font-size: 13px;
    }
}

/* Ticker & Stats */
.ticker-wrap {
    background-color: #f1f5f9;
    border: 1px solid var(--border-color);
    padding: 8px 15px;
    border-radius: var(--radius-sm);
    display: flex;
    overflow: hidden;
    margin-bottom: 30px;
    align-items: center;
}
.ticker-title {
    background-color: var(--danger);
    color: white;
    padding: 2px 10px;
    font-weight: bold;
    font-size: 14px;
    border-radius: 4px;
    margin-right: 15px;
    white-space: nowrap;
}
.ticker-text {
    font-size: 14px;
    white-space: nowrap;
    animation: ticker 25s linear infinite;
}
@keyframes ticker {
    0% { transform: translate3d(100%, 0, 0); }
    100% { transform: translate3d(-100%, 0, 0); }
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}
.stat-card {
    background: white;
    border: 1px solid var(--border-color);
    padding: 25px;
    border-radius: var(--radius-md);
    text-align: center;
    border-top: 4px solid var(--primary);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}
.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}
.stat-icon {
    font-size: 35px;
    color: var(--accent);
    margin-bottom: 10px;
}
.stat-number {
    font-family: var(--font-en);
    font-size: 32px;
    font-weight: 800;
    color: var(--primary-dark);
}
.stat-label {
    font-size: 15px;
    color: var(--text-muted);
}

/* Tables Formatting */
.table-responsive {
    overflow-x: auto;
    margin-bottom: 20px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
}
table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    text-align: left;
}
th {
    background-color: var(--primary);
    color: white;
    padding: 14px 16px;
    font-weight: 600;
    text-align: center;
}
td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    text-align: center;
}
tr:nth-child(even) {
    background-color: #f8fafc;
}
tr:hover {
    background-color: #f1f5f9;
}
.badge {
    padding: 4px 8px;
    font-size: 12px;
    font-weight: bold;
    border-radius: 4px;
    display: inline-block;
}
.badge-success { background: #d1fae5; color: #065f46; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-danger { background: #fee2e2; color: #991b1b; }

/* Grid layout for Cards (Teachers, Committee, Galleries) */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
}
.profile-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    text-align: center;
    transition: var(--transition);
}
.profile-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(26, 92, 56, 0.3);
}
.profile-img-wrap {
    height: 220px;
    background-color: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 3px solid var(--accent);
}
.profile-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.profile-img-placeholder {
    font-size: 70px;
    color: var(--text-muted);
}
.profile-body {
    padding: 20px;
}
.profile-name {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 5px;
}
.profile-title {
    font-size: 14px;
    color: var(--primary);
    font-weight: 600;
    margin-bottom: 12px;
}
.profile-details {
    font-size: 14px;
    color: var(--text-muted);
    border-top: 1px dashed var(--border-color);
    padding-top: 10px;
    margin-top: 10px;
}

/* Photo Gallery */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 15px;
}
.gallery-item {
    border-radius: var(--radius-sm);
    overflow: hidden;
    height: 160px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}
.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}
.gallery-item:hover img {
    transform: scale(1.05);
}

/* Notice Board */
.notice-list {
    list-style: none;
}
.notice-item {
    padding: 15px 0;
    border-bottom: 1px dashed var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
}
.notice-item:last-child {
    border-bottom: none;
}
.notice-left {
    display: flex;
    align-items: center;
    gap: 15px;
}
.notice-date-badge {
    background-color: var(--primary-dark);
    color: white;
    padding: 6px;
    border-radius: 6px;
    text-align: center;
    min-width: 65px;
    font-size: 12px;
}
.notice-date-badge span {
    display: block;
    font-weight: bold;
    font-size: 16px;
}
.notice-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-color);
}
.notice-title:hover {
    color: var(--primary);
}

/* Contact Info & Forms */
.contact-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
}
@media (min-width: 768px) {
    .contact-grid {
        grid-template-columns: 1fr 1fr;
    }
}
.contact-form .form-group {
    margin-bottom: 15px;
}
.contact-form label {
    display: block;
    font-weight: bold;
    font-size: 14px;
    margin-bottom: 5px;
}
.contact-form input, .contact-form textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    outline: none;
    font-size: 15px;
}
.contact-form input:focus, .contact-form textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(26, 92, 56, 0.1);
}
.btn-submit {
    background-color: var(--primary);
    color: white;
    border: none;
    padding: 12px 25px;
    font-weight: bold;
    border-radius: 6px;
    cursor: pointer;
    transition: var(--transition);
}
.btn-submit:hover {
    background-color: var(--primary-light);
}

/* Footers */
.main-footer {
    background-color: #111827;
    color: #e5e7eb;
    padding: 50px 0 0;
    border-top: 5px solid var(--accent);
}
.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 40px;
    padding-bottom: 40px;
}
.footer-col h3 {
    color: white;
    font-size: 18px;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--accent);
    display: inline-block;
    padding-bottom: 5px;
}
.footer-links {
    list-style: none;
}
.footer-links li {
    margin-bottom: 10px;
}
.footer-links li a {
    color: #9ca3af;
}
.footer-links li a:hover {
    color: var(--accent);
    padding-left: 5px;
}
.footer-bottom {
    background-color: #030712;
    padding: 20px 0;
    border-top: 1px solid #1f2937;
    font-size: 13px;
    color: #6b7280;
}
.footer-bottom-content {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}
@media (min-width: 768px) {
    .footer-bottom-content {
        flex-direction: row;
    }
}

/* Print Styles */
@media print {
    body {
        background: white;
        color: black;
        font-size: 12pt;
    }
    .top-bar, .main-header, .main-nav, .main-footer, .nav-toggle, .btn-logout, .sidebar-toggle, .sidebar-menu, .btn-submit, .btn {
        display: none !important;
    }
    .page-content, .container {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    .card {
        border: none !important;
        box-shadow: none !important;
        padding: 0 !important;
    }
    table {
        border: 1px solid black !important;
    }
    th, td {
        border: 1px solid black !important;
        color: black !important;
        background: none !important;
    }
    tr:nth-child(even) {
        background: none !important;
    }
}

/* Premium Global Alert Redesign Override */
.alert {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    padding: 16px 20px !important;
    border-radius: 10px !important;
    margin-bottom: 25px !important;
    font-size: 15px !important;
    font-weight: 500 !important;
    text-align: left !important;
}

.alert-success {
    background: #ecfdf5 !important;
    border-left: 6px solid #10b981 !important;
    border-top: 1px solid #a7f3d0 !important;
    border-right: 1px solid #a7f3d0 !important;
    border-bottom: 1px solid #a7f3d0 !important;
    color: #065f46 !important;
    box-shadow: 0 10px 15px -3px rgba(16, 185, 129, 0.08), 0 4px 6px -4px rgba(16, 185, 129, 0.08) !important;
}

.alert-danger {
    background: #fef2f2 !important;
    border-left: 6px solid #ef4444 !important;
    border-top: 1px solid #fca5a5 !important;
    border-right: 1px solid #fca5a5 !important;
    border-bottom: 1px solid #fca5a5 !important;
    color: #991b1b !important;
    box-shadow: 0 10px 15px -3px rgba(239, 68, 68, 0.08), 0 4px 6px -4px rgba(239, 68, 68, 0.08) !important;
}

.alert-warning {
    background: #fffbeb !important;
    border-left: 6px solid #f59e0b !important;
    border-top: 1px solid #fde68a !important;
    border-right: 1px solid #fde68a !important;
    border-bottom: 1px solid #fde68a !important;
    color: #92400e !important;
    box-shadow: 0 10px 15px -3px rgba(245, 94, 11, 0.08), 0 4px 6px -4px rgba(245, 94, 11, 0.08) !important;
}
