@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;500;600;700;800&display=swap');

:root {
    /* Color Palette (Studyboat Inspired - Synced with Website) */
    --primary: #0b1a30;       /* Dark Navy Blue */
    --primary-light: #162a4a; /* Medium Navy Blue */
    --secondary: #10b981;     /* Sea Green */
    --secondary-dark: #059669;
    --accent: #f2a900;        /* Golden Yellow Accent */
    --accent-hover: #d99700;
    --danger: #ef4444;
    --success: #10b981;
    --warning: #f59e0b;
    
    /* Neutral Colors - Light Mode */
    --bg-app: #f8fafc;
    --bg-card: #ffffff;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border: #e2e8f0;
    
    /* Layout & Effects */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.02);
    --shadow-premium: 0 20px 25px -5px rgba(0, 0, 0, 0.07), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Dark Mode Overrides (Optional / Adaptive class) */
body.dark-mode {
    --bg-app: #0b0f19;
    --bg-card: #151f32;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --border: #1e293b;
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-app);
    color: var(--text-main);
    line-height: 1.5;
    min-height: 100vh;
    transition: var(--transition);
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    letter-spacing: -0.02em;
}

a {
    text-decoration: none;
    color: inherit;
}

/* Login Page Styles */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
    background: radial-gradient(circle at 10% 20%, rgb(4, 21, 62) 0.1%, rgb(10, 34, 101) 90.2%);
}

.login-card {
    background: rgba(255, 255, 255, 0.95);
    padding: 40px;
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 450px;
    box-shadow: var(--shadow-premium);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    text-align: center;
    animation: fadeIn 0.6s ease-out;
}

body.dark-mode .login-card {
    background: rgba(21, 31, 50, 0.95);
    border-color: rgba(255, 255, 255, 0.05);
}

.login-logo {
    max-width: 150px;
    height: auto;
    margin-bottom: 20px;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.1));
}

.login-title {
    font-size: 28px;
    color: var(--primary);
    margin-bottom: 8px;
}

body.dark-mode .login-title {
    color: var(--primary-light);
}

.login-subtitle {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 30px;
}

/* Forms and Inputs */
.form-group {
    margin-bottom: 20px;
    text-align: left;
}

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text-main);
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    font-family: inherit;
    font-size: 15px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    background-color: transparent;
    color: var(--text-main);
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-light);
    box-shadow: 0 0 0 4px rgba(11, 26, 48, 0.15);
}

select.form-control {
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23475569'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    background-size: 16px;
    padding-right: 40px;
    appearance: none;
}

body.dark-mode select.form-control {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2394a3b8'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    gap: 8px;
}

.btn-primary {
    background-color: var(--primary);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-light);
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(11, 26, 48, 0.25);
}

.btn-secondary {
    background-color: var(--secondary);
    color: white;
}

.btn-secondary:hover {
    background-color: var(--secondary-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(16, 185, 129, 0.25);
}

.btn-danger {
    background-color: var(--danger);
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(239, 68, 68, 0.25);
}

.btn-block {
    width: 100%;
}

.alert {
    padding: 14px 18px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-danger {
    background-color: rgba(239, 68, 68, 0.1);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.alert-success {
    background-color: rgba(16, 185, 129, 0.1);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

/* Dashboard Layout */
.dashboard-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar Styling */
.sidebar {
    width: 280px;
    background-color: var(--primary);
    color: white;
    padding: 30px 20px;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-lg);
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    transition: var(--transition);
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-bottom: 25px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    margin-bottom: 25px;
}

.sidebar-logo {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background-color: white;
    padding: 4px;
}

.sidebar-title {
    font-size: 20px;
    font-weight: 800;
    font-family: 'Outfit', sans-serif;
    letter-spacing: 0.5px;
    color: white;
}

.sidebar-menu {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sidebar-item a {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.75);
    transition: var(--transition);
    gap: 12px;
}

.sidebar-item a i {
    transition: var(--transition);
}

.sidebar-item a:hover, .sidebar-item.active a {
    background-color: rgba(255, 255, 255, 0.08);
    color: var(--accent) !important;
    font-weight: 600;
    box-shadow: var(--shadow-sm);
}

.sidebar-item a:hover i, .sidebar-item.active a i {
    color: var(--accent) !important;
    transform: scale(1.1);
}

.sidebar-footer {
    margin-top: auto;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
}

/* Main Content Styling */
.main-content {
    flex: 1;
    margin-left: 280px;
    padding: 40px;
    transition: var(--transition);
}

/* Header Styling */
.top-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 35px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
}

.header-title h1 {
    font-size: 28px;
    color: var(--text-main);
}

.header-title p {
    color: var(--text-muted);
    font-size: 14px;
    margin-top: 4px;
}

.user-profile-widget {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg-card);
    padding: 8px 16px;
    border-radius: 50px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    background-color: var(--border);
}

.user-info {
    text-align: left;
}

.user-name {
    font-size: 14px;
    font-weight: 600;
}

.user-role {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.5px;
}

/* Stats Cards Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
    margin-bottom: 40px;
}

.stat-card {
    background-color: var(--bg-card);
    padding: 24px;
    border-radius: 16px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
    transition: var(--transition);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background-color: var(--primary);
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(11, 26, 48, 0.1);
}

.stat-card:hover::before {
    background-color: var(--accent);
}

.stat-content {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 32px;
    font-weight: 800;
    color: var(--primary);
    font-family: 'Outfit', sans-serif;
}

body.dark-mode .stat-value {
    color: var(--primary-light);
}

.stat-label {
    font-size: 14px;
    color: var(--text-muted);
    font-weight: 500;
    margin-top: 4px;
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    background-color: rgba(11, 26, 48, 0.05);
    color: var(--primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    transition: var(--transition);
}

.stat-card:hover .stat-icon {
    background-color: var(--accent);
    color: var(--primary);
}

/* Content Cards */
.card {
    background-color: var(--bg-card);
    border-radius: 16px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border);
    padding: 30px;
    margin-bottom: 30px;
    position: relative;
    overflow: hidden;
    transition: var(--transition);
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background-color: var(--primary);
    transition: var(--transition);
}

.card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(11, 26, 48, 0.1);
}

.card:hover::before {
    background-color: var(--accent);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1.5px solid var(--border);
}

.card-title {
    font-size: 20px;
    color: var(--text-main);
}

/* Tables styling */
.table-responsive {
    overflow-x: auto;
    width: 100%;
}

.table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.table th {
    background-color: var(--bg-app);
    padding: 16px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted);
    border-bottom: 2px solid var(--border);
}

.table td {
    padding: 16px;
    font-size: 14px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

.table tbody tr {
    transition: var(--transition);
}

.table tbody tr:hover {
    background-color: rgba(11, 26, 48, 0.02);
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 50px;
    font-size: 12px;
    font-weight: 600;
    text-transform: capitalize;
}

.badge-success {
    background-color: rgba(16, 185, 129, 0.15);
    color: var(--success);
}

.badge-warning {
    background-color: rgba(245, 158, 11, 0.15);
    color: var(--warning);
}

.badge-danger {
    background-color: rgba(239, 68, 68, 0.15);
    color: var(--danger);
}

/* Two Column Layout */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
    gap: 30px;
}

/* Photo Upload Box Styles */
.photo-upload-preview {
    width: 120px;
    height: 120px;
    border-radius: var(--radius-sm);
    border: 2px dashed var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
    overflow: hidden;
    background-color: var(--bg-app);
}

.photo-upload-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.photo-limit-text {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Dark Mode Toggle Switch */
.theme-switch-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
}

.theme-switch {
    display: inline-block;
    height: 24px;
    position: relative;
    width: 50px;
}

.theme-switch input {
    display:none;
}

.slider {
    background-color: #ccc;
    bottom: 0;
    cursor: pointer;
    left: 0;
    position: absolute;
    right: 0;
    top: 0;
    transition: .4s;
    border-radius: 34px;
}

.slider:before {
    background-color: white;
    bottom: 4px;
    content: "";
    height: 16px;
    left: 4px;
    position: absolute;
    transition: .4s;
    width: 16px;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: var(--primary-light);
}

input:checked + .slider:before {
    transform: translateX(26px);
}

/* Keyframes */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Mobile Toggle Hamburger button */
.mobile-nav-toggle {
    display: none;
    font-size: 24px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-main);
}

/* Responsive CSS Styles */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
        padding: 24px;
    }
    
    .mobile-nav-toggle {
        display: block;
    }
}

@media (max-width: 576px) {
    .grid-2 {
        grid-template-columns: 1fr;
    }
    .top-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    .user-profile-widget {
        align-self: flex-end;
    }
    .login-card {
        padding: 24px;
    }
}

/* Multiselect checkboxes style */
.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
    border: 1.5px solid var(--border);
    padding: 16px;
    border-radius: var(--radius-sm);
    max-height: 200px;
    overflow-y: auto;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    cursor: pointer;
}

.checkbox-item input {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

/* Fee Details in Tabular Card */
.fee-summary-table td {
    padding: 10px 16px;
}

/* Collapsible Accordion Tab Styles */
details.calendar-accordion {
    border: 1.5px solid var(--border);
    border-radius: 12px;
    margin-bottom: 15px;
    background-color: var(--bg-card);
    overflow: hidden;
    transition: var(--transition);
}

details.calendar-accordion[open] {
    box-shadow: var(--shadow-md);
    border-color: var(--primary-light);
}

details.calendar-accordion summary {
    padding: 16px 20px;
    font-size: 16px;
    font-weight: 700;
    font-family: 'Outfit', sans-serif;
    cursor: pointer;
    background-color: var(--bg-card);
    color: var(--primary);
    display: flex;
    justify-content: space-between;
    align-items: center;
    list-style: none; /* Hide default triangle */
    transition: var(--transition);
}

details.calendar-accordion summary::-webkit-details-marker {
    display: none; /* Hide Safari default marker */
}

details.calendar-accordion summary::after {
    content: "▼";
    font-size: 12px;
    color: var(--text-muted);
    transition: transform 0.3s ease;
}

details.calendar-accordion[open] summary::after {
    transform: rotate(180deg);
}

details.calendar-accordion summary:hover {
    background-color: var(--bg-app);
    color: var(--accent-hover);
}

details.calendar-accordion .accordion-content {
    padding: 20px;
    border-top: 1.5px solid var(--border);
    background-color: var(--bg-card);
}

/* Calendar Styling */
.calendar-container {
    width: 100%;
    margin: 0 auto;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
    width: 100%;
}

.calendar-header-cell {
    background-color: var(--primary);
    color: white;
    padding: 10px;
    text-align: center;
    font-weight: 600;
    font-size: 13px;
    border-radius: var(--radius-sm);
}

.calendar-day-cell {
    min-height: 90px;
    border: 1px solid var(--border);
    background-color: var(--bg-app);
    padding: 6px;
    border-radius: var(--radius-sm);
    display: flex;
    flex-direction: column;
    gap: 4px;
    position: relative;
}

.calendar-day-cell.empty {
    background-color: transparent;
    border: none;
}

.calendar-day-cell .day-number {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
    align-self: flex-start;
}

.calendar-class-pill {
    padding: 4px 6px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.3;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    cursor: help;
}

.calendar-class-pill.scheduled {
    background-color: rgba(11, 26, 48, 0.08);
    color: var(--primary-light);
    border-left: 3px solid var(--primary-light);
}

.calendar-class-pill.cancelled {
    background-color: rgba(239, 68, 68, 0.12);
    color: var(--danger);
    border-left: 3px solid var(--danger);
}

.class-pill-time {
    font-size: 9px;
    opacity: 0.8;
}

.class-pill-subject {
    font-weight: 700;
}

/* Student Directory Accordion Styling */
details.student-accordion {
    border: 1.5px solid var(--border);
    border-radius: 12px;
    margin-bottom: 15px;
    background-color: var(--bg-card);
    overflow: hidden;
    transition: var(--transition);
}

details.student-accordion[open] {
    box-shadow: var(--shadow-md);
    border-color: var(--primary-light);
}

details.student-accordion summary {
    padding: 16px 20px;
    font-size: 16px;
    font-weight: 700;
    font-family: 'Outfit', sans-serif;
    cursor: pointer;
    background-color: var(--bg-card);
    color: var(--primary);
    display: flex;
    justify-content: space-between;
    align-items: center;
    list-style: none; /* Hide default triangle */
    transition: var(--transition);
}

details.student-accordion summary::-webkit-details-marker {
    display: none; /* Hide Safari default marker */
}

details.student-accordion summary::after {
    content: "▼";
    font-size: 12px;
    color: var(--text-muted);
    transition: transform 0.3s ease;
}

details.student-accordion[open] summary::after {
    transform: rotate(180deg);
}

details.student-accordion summary:hover {
    background-color: var(--bg-app);
    color: var(--accent-hover);
}

details.student-accordion .accordion-content {
    padding: 20px;
    border-top: 1.5px solid var(--border);
    background-color: var(--bg-card);
}

/* Test Accordion (Inner collapsible tabs) */
details.test-accordion {
    border: 1.5px solid var(--border);
    border-radius: 8px;
    margin-bottom: 12px;
    background-color: var(--bg-app);
    overflow: hidden;
    transition: var(--transition);
}

details.test-accordion[open] {
    box-shadow: var(--shadow-sm);
    border-color: var(--secondary);
}

details.test-accordion summary {
    padding: 12px 16px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    background-color: var(--bg-app);
    color: var(--text-main);
    display: flex;
    justify-content: space-between;
    align-items: center;
    list-style: none; /* Hide default triangle */
    transition: var(--transition);
}

details.test-accordion summary::-webkit-details-marker {
    display: none;
}

details.test-accordion summary::after {
    content: "▼";
    font-size: 10px;
    color: var(--text-muted);
    transition: transform 0.3s ease;
}

details.test-accordion[open] summary::after {
    transform: rotate(180deg);
}

details.test-accordion summary:hover {
    background-color: var(--border);
    color: var(--secondary-dark);
}

details.test-accordion .accordion-content {
    padding: 15px;
    border-top: 1.5px solid var(--border);
    background-color: var(--bg-card);
}



