:root {
    /* Light Theme Variables */
    --bg-body: #fff1f2;
    /* Very light pink */
    --bg-sidebar: #ffffff;
    --bg-content: #ffffff;
    --text-primary: #881337;
    /* Deep pinkish maroon */
    --text-secondary: #be123c;
    /* Rose red */
    --accent-color: #f472b6;
    /* Soft pink */
    /* Pink */
    --accent-hover: #db2777;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --border-color: #fce7f3;
    --card-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.5);

    /* Transitions */
    --transition-speed: 0.3s;
}

[data-theme="dark"] {
    /* Dark Theme Variables - Cute Deep Purple */
    --bg-body: #0f172a;
    --bg-sidebar: #1e1b4b;
    /* Deep indigo */
    --bg-content: #1e1b4b;
    --text-primary: #e2e8f0;
    /* Soft light gray */
    --text-secondary: #94a3b8;
    /* Muted gray-blue */
    --accent-color: #f472b6;
    /* Pink accent */
    --accent-hover: #db2777;
    --border-color: #312e81;
    --card-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
    --glass-bg: rgba(30, 27, 75, 0.7);
    --glass-border: rgba(244, 114, 182, 0.2);
}

.main-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url('bg-light.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0.1;
    z-index: -1;
    pointer-events: none;
}

[data-theme="dark"] .main-content::before {
    background-image: url('bg-dark.png');
    opacity: 0.2;
}

[data-theme="dark"] .welcome-banner {
    background: linear-gradient(135deg, #4338ca, #312e81);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.4);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', 'Inter', sans-serif;
}

body {
    background-color: var(--bg-body);
    color: var(--text-primary);
    transition: background-color var(--transition-speed), color var(--transition-speed);
    height: 100vh;
    overflow: hidden;
}

/* Layout */
.app-container {
    display: flex;
    height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background-color: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    transition: all var(--transition-speed);
    z-index: 100;
}

.sidebar-header {
    margin-bottom: 2rem;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--accent-color);
}

.sidebar-logo-img {
    height: 50px;
    width: auto;
    object-fit: contain;
}

.logo-icon {
    font-size: 1.5rem;
    margin-left: auto;
}

.logo-text h1 {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1;
}

.logo-text span {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    border-radius: 12px;
    transition: all 0.2s;
    text-align: left;
}

.nav-item:hover,
.nav-item.active {
    background-color: var(--accent-color);
    color: white;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.nav-item i {
    width: 24px;
    text-align: center;
}

.sidebar-footer {
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.datetime-widget {
    margin-bottom: 1rem;
}

#time {
    font-size: 1.25rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

#date {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.theme-toggle {
    cursor: pointer;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--bg-body);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    transition: all 0.2s;
}

.theme-toggle:hover {
    background-color: var(--border-color);
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 2rem;
    overflow-y: auto;
    position: relative;
    background-color: var(--bg-body);
}


.content-section {
    position: relative;
    /* Ensure content stays above pseudo-element */
    z-index: 1;
    display: none;
    animation: fadeIn 0.4s ease-out;
}

.content-section.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

#student-list .section-header {
    flex-direction: column;
    align-items: stretch;
    gap: 1.5rem;
}

.search-filters {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    width: 100%;
}

.search-filters .search-bar {
    flex: 1;
    min-width: 200px;
    max-width: none;
}

.section-header h2 {
    font-size: 1.75rem;
    color: var(--text-primary);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: var(--bg-content);
    padding: 0.5rem 1rem;
    border-radius: 50px;
    box-shadow: var(--card-shadow);
}

.avatar {
    width: 35px;
    height: 35px;
    background-color: var(--accent-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
}

/* Introduction Banner */
.welcome-banner {
    background: linear-gradient(135deg, #f472b6, #ec4899);
    color: white;
    padding: 2rem;
    border-radius: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    box-shadow: 0 10px 20px rgba(79, 70, 229, 0.2);
    position: relative;
    overflow: hidden;
}

.banner-text h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.banner-decoration i {
    font-size: 5rem;
    opacity: 0.2;
    transform: rotate(-15deg);
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
}

.stat-card {
    background: var(--bg-content);
    padding: 1.5rem;
    border-radius: 16px;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    box-shadow: var(--card-shadow);
    transition: transform 0.2s;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-card .icon {
    width: 60px;
    height: 60px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
}

.stat-card.blue .icon {
    background-color: rgba(79, 70, 229, 0.1);
    color: var(--accent-color);
}

.stat-card.green .icon {
    background-color: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.stat-card .info {
    display: flex;
    flex-direction: column;
}

.stat-card .info h3 {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.stat-card .info span {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* Form Styles */
.form-container {
    background: var(--bg-content);
    padding: 2rem;
    border-radius: 20px;
    box-shadow: var(--card-shadow);
    max-width: 800px;
    margin: 0 auto;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group.full-width {
    grid-column: span 2;
}

label {
    font-weight: 500;
    font-size: 0.95rem;
    color: var(--text-primary);
}

input,
select,
textarea {
    padding: 0.75rem 1rem;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background-color: var(--bg-body);
    color: var(--text-primary);
    font-size: 1rem;
    transition: all 0.2s;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.form-actions {
    margin-top: 2rem;
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

.btn {
    padding: 0.75rem 1.5rem;
    border-radius: 10px;
    border: none;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary {
    background-color: var(--accent-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--accent-hover);
    transform: translateY(-1px);
}

.btn-secondary {
    background-color: var(--bg-body);
    color: var(--text-secondary);
}

.btn-secondary:hover {
    background-color: var(--border-color);
}

.btn-danger {
    background-color: var(--danger);
    color: white;
}

.btn-danger:hover {
    opacity: 0.9;
}

/* Table Styles */
.search-bar {
    position: relative;
    width: 300px;
}

.search-bar i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
}

.search-bar input,
.search-bar select {
    padding-left: 2.5rem;
    width: 100%;
}

#student-list .search-bar select {
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
}

.table-container {
    background: var(--bg-content);
    border-radius: 20px;
    box-shadow: var(--card-shadow);
    overflow: hidden;
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 1rem 1.5rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.data-table th {
    background-color: rgba(79, 70, 229, 0.05);
    color: var(--accent-color);
    font-weight: 600;
}

.data-table tr:hover {
    background-color: rgba(0, 0, 0, 0.02);
}

.action-buttons {
    display: flex;
    gap: 0.5rem;
}

.btn-sm {
    padding: 0.4rem 0.6rem;
    font-size: 0.85rem;
    border-radius: 6px;
}

/* Settings Sections */
.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
    margin-top: 1rem;
}

.settings-card {
    background: var(--bg-content);
    padding: 2rem;
    border-radius: 24px;
    box-shadow: var(--card-shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid transparent;
}

.settings-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent-color);
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
}

.switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
}

input:checked+.slider {
    background-color: var(--accent-color);
}

input:checked+.slider:before {
    transform: translateX(26px);
}

.slider.round {
    border-radius: 34px;
}

.slider.round:before {
    border-radius: 50%;
}

/* About Page */
.about-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
}

.about-card {
    background: var(--bg-content);
    padding: 3rem;
    border-radius: 24px;
    box-shadow: var(--card-shadow);
    text-align: center;
    max-width: 600px;
}

.about-logo {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.about-logo i {
    font-size: 3.5rem;
    color: var(--accent-color);
}

.about-school-logo {
    height: 80px;
    width: auto;
    object-fit: contain;
}

.about-card h2 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.version {
    color: var(--text-secondary);
    margin-bottom: 2rem;
    font-size: 0.8rem;
    background: rgba(0, 0, 0, 0.05);
    padding: 0.2rem 0.6rem;
    border-radius: 6px;
    display: inline-block;
}

.about-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1rem;
    margin-top: 2rem;
    text-align: left;
}

.about-item {
    background: rgba(255, 255, 255, 0.5);
    padding: 1rem;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border: 1px solid var(--border-color);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.about-item:hover {
    transform: translateY(-3px);
    border-color: var(--accent-color);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.about-item i,
.about-stick-figure {
    font-size: 1.25rem;
    color: var(--accent-color);
    background: var(--bg-body);
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    flex-shrink: 0;
    object-fit: contain;
    padding: 2px;
}

.about-item:hover .about-stick-figure {
    transform: scale(1.1);
}

.about-item h3 {
    font-size: 0.95rem !important;
    margin: 0 !important;
    color: var(--text-primary) !important;
    font-weight: 600 !important;
}

.about-item p {
    font-size: 0.7rem;
    color: var(--text-secondary);
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

[data-theme="dark"] .about-item {
    background: rgba(0, 0, 0, 0.2);
}

.about-description {
    margin-top: 2rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.6;
    max-width: 80%;
    margin-left: auto;
    margin-right: auto;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

/* Responsive */
@media (max-width: 768px) {
    .app-container {
        flex-direction: column;
        height: auto;
        min-height: 100vh;
    }

    .sidebar {
        width: 100%;
        height: auto;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        padding: 1rem;
    }

    .sidebar-nav {
        flex-direction: row;
        overflow-x: auto;
        padding-bottom: 0.5rem;
    }

    .nav-item span {
        display: none;
    }

    .logo-container {
        justify-content: center;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }
}

/* New Stats Colors */
.stat-card.orange .icon {
    background-color: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}

.stat-card.purple .icon {
    background-color: rgba(147, 51, 234, 0.1);
    color: #9333ea;
}

.stat-card.red .icon {
    background-color: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.stat-detail {
    margin-top: 5px;
    line-height: 1.4;
}

.stat-detail small {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.stat-detail strong {
    color: var(--text-primary);
}

/* New Stats Colors */
.stat-card.orange .icon {
    background-color: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}

.stat-card.purple .icon {
    background-color: rgba(147, 51, 234, 0.1);
    color: #9333ea;
}

.stat-card.red .icon {
    background-color: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.stat-detail {
    margin-top: 5px;
    line-height: 1.4;
}

.stat-detail small {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.stat-detail strong {
    color: var(--text-primary);
}

/* Cyan Card for Quick Actions */
.stat-card.cyan .icon {
    background-color: rgba(6, 182, 212, 0.1);
    color: #06b6d4;
}

.quick-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.btn-xs {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.btn-xs.btn-primary {
    background-color: var(--accent-color);
    color: white;
}

.btn-xs.btn-secondary {
    background-color: var(--border-color);
    color: var(--text-primary);
}

.btn-xs:hover {
    transform: translateY(-1px);
    opacity: 0.9;
}

/* Gray Card for Info */
.stat-card.gray .icon {
    background-color: rgba(107, 114, 128, 0.1);
    color: #6b7280;
}

/* Footer Style */
.app-footer {
    margin-top: 3rem;
    padding-top: 1.5rem;
    padding-bottom: 1rem;
    border-top: 1px solid var(--border-color);
    text-align: center;
}

.app-footer p {
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
}