/* General Design System Styles */
:root {
    --bg-dark: #090d16;
    --bg-card: rgba(17, 25, 40, 0.65);
    --border-glass: rgba(255, 255, 255, 0.08);
    --primary-color: #299cd3;
    --primary-hover: #1d77a1;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    
    --success-color: #10b981;
    --success-bg: rgba(16, 185, 129, 0.12);
    --danger-color: #f43f5e;
    --danger-bg: rgba(244, 63, 94, 0.12);
    --warning-color: #f1ac31;
    --warning-bg: rgba(241, 172, 49, 0.12);
}

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

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

h1, h2, h3, h4, .logo-text {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
}

/* Base Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    font-size: 0.95rem;
    font-weight: 500;
    border-radius: 0.5rem;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), #818cf8);
    color: #fff;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-hover), var(--primary-color));
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(99, 102, 241, 0.45);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border-glass);
    color: var(--text-main);
}

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--text-muted);
}

/* Alert Styles */
.flash-messages {
    margin-bottom: 1.5rem;
}

.alert {
    padding: 0.75rem 1.25rem;
    border-radius: 0.5rem;
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
    border: 1px solid transparent;
}

.alert-success {
    background-color: var(--success-bg);
    border-color: rgba(16, 185, 129, 0.3);
    color: var(--success-color);
}

.alert-danger {
    background-color: var(--danger-bg);
    border-color: rgba(239, 68, 68, 0.3);
    color: var(--danger-color);
}

.alert-info {
    background-color: rgba(99, 102, 241, 0.15);
    border-color: rgba(99, 102, 241, 0.3);
    color: #818cf8;
}

/* ==========================================================================
   LOGIN PORTAL PAGE STYLING
   ========================================================================== */
.login-body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: radial-gradient(circle at top left, #1e1b4b, var(--bg-dark) 50%, #030712);
    position: relative;
}

.login-background-glow {
    position: absolute;
    top: 25%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 450px;
    height: 450px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.15) 0%, transparent 70%);
    pointer-events: none;
    z-index: 1;
}

.login-container {
    width: 100%;
    max-width: 460px;
    padding: 1.5rem;
    z-index: 2;
}

.login-card {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-glass);
    border-radius: 1.25rem;
    padding: 2.5rem;
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.35);
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.logo-icon {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 54px;
    height: 54px;
    background: linear-gradient(135deg, var(--primary-color), #818cf8);
    border-radius: 0.75rem;
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 1.4rem;
    color: #fff;
    margin-bottom: 1rem;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.login-header h1 {
    font-size: 2rem;
    color: var(--text-main);
    margin-bottom: 0.5rem;
}

.login-header p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.login-form .form-group {
    margin-bottom: 1.5rem;
}

.login-form label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.login-form input {
    width: 100%;
    padding: 0.85rem 1rem;
    border-radius: 0.5rem;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border-glass);
    color: var(--text-main);
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.login-form input:focus {
    outline: none;
    border-color: var(--primary-color);
    background: rgba(15, 23, 42, 0.8);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.login-form .btn {
    width: 100%;
    margin-top: 1rem;
}

.login-footer {
    text-align: center;
    margin-top: 2rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* ==========================================================================
   PARENTAL DASHBOARD PAGE STYLING
   ========================================================================== */
.dashboard-body {
    background: radial-gradient(circle at top right, #1e1b4b, var(--bg-dark) 40%, #030712);
    min-height: 100vh;
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 2.5rem;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-glass);
    position: sticky;
    top: 0;
    z-index: 10;
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-badge {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--primary-color), #818cf8);
    border-radius: 0.5rem;
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 1.1rem;
    color: #fff;
}

.logo-text {
    font-size: 1.35rem;
    color: var(--text-main);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.welcome-text {
    font-size: 0.95rem;
    color: var(--text-muted);
}

.welcome-text strong {
    color: var(--text-main);
}

.dashboard-main {
    max-width: 1000px;
    margin: 2.5rem auto;
    padding: 0 1.5rem;
}

/* Stats Section Layout */
.stats-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.25rem;
    margin-bottom: 3rem;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.stat-card:hover {
    transform: translateY(-5px);
    border-color: rgba(99, 102, 241, 0.3);
    box-shadow: 0 12px 40px rgba(99, 102, 241, 0.15);
}

.stat-card h3 {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.stat-value {
    font-family: 'Outfit', sans-serif;
    font-size: 2.25rem;
    font-weight: 700;
}

.text-success { color: var(--success-color); }
.text-danger { color: var(--danger-color); }
.text-warning { color: var(--warning-color); }

/* Timeline Section Layout */
.timeline-section {
    position: relative;
}

.section-title {
    font-size: 1.6rem;
    color: var(--text-main);
    margin-bottom: 2rem;
    position: relative;
}

.timeline-container {
    position: relative;
    padding-left: 2.5rem;
}

/* Vertical Timeline Line */
.timeline-container::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 11px;
    width: 2px;
    background: linear-gradient(to bottom, var(--primary-color) 0%, rgba(99, 102, 241, 0.15) 100%);
    border-radius: 1px;
}

.timeline-item {
    position: relative;
    margin-bottom: 2.5rem;
}

/* Markers */
.timeline-marker {
    position: absolute;
    left: -2.5rem;
    top: 4px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background-color: var(--bg-dark);
    border: 2px solid var(--text-muted);
    color: var(--text-muted);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 0.75rem;
    font-weight: bold;
    z-index: 2;
    transition: all 0.3s ease;
}

.timeline-item.present .timeline-marker {
    border-color: var(--success-color);
    background-color: var(--success-bg);
    color: var(--success-color);
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.3);
}

.timeline-item.absent .timeline-marker {
    border-color: var(--danger-color);
    background-color: var(--danger-bg);
    color: var(--danger-color);
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.3);
}

/* Timeline Cards */
.timeline-card {
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    border-radius: 1rem;
    padding: 1.75rem;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.3);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.timeline-item.present .timeline-card {
    border-left: 4px solid var(--success-color);
}

.timeline-item.absent .timeline-card {
    border-left: 4px solid var(--danger-color);
}

.timeline-card:hover {
    transform: translateX(6px);
    background: rgba(17, 25, 40, 0.85);
    border-color: rgba(99, 102, 241, 0.3);
    box-shadow: 0 20px 48px rgba(99, 102, 241, 0.12);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
}

.session-date {
    font-family: 'Outfit', sans-serif;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-main);
}

.session-class {
    font-size: 0.85rem;
    background: rgba(255, 255, 255, 0.06);
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    color: var(--text-muted);
}

/* Card Dividers */
.card-divider {
    border: 0;
    height: 1px;
    background: var(--border-glass);
    margin: 1.5rem 0;
}

/* Details and Grid Blocks */
.info-block {
    margin-bottom: 1.25rem;
}

.info-block:last-child {
    margin-bottom: 0;
}

.info-block h4 {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.info-block p {
    font-size: 0.95rem;
    color: var(--text-main);
}

.eval-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.eval-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

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

.status-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.85rem;
    font-weight: 500;
    width: fit-content;
}

.status-badge.present {
    background: var(--success-bg);
    color: var(--success-color);
}

.status-badge.absent {
    background: var(--danger-bg);
    color: var(--danger-color);
}

.points-badge {
    background: var(--warning-bg);
    color: var(--warning-color);
    padding: 0.25rem 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.85rem;
    font-weight: 500;
    width: fit-content;
}

/* Empty states */
.empty-timeline-card, .empty-timeline-card p {
    text-align: center;
    padding: 3rem;
    color: var(--text-muted);
    background: var(--bg-card);
    border-radius: 1rem;
    border: 1px dashed var(--border-glass);
}

.dashboard-footer {
    text-align: center;
    padding: 2.5rem;
    border-top: 1px solid var(--border-glass);
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 4rem;
}

/* Responsive queries */
@media (max-width: 768px) {
    .dashboard-header {
        flex-direction: column;
        gap: 1rem;
        padding: 1.25rem 1.5rem;
        text-align: center;
    }
    
    .user-profile {
        flex-direction: column;
        gap: 0.75rem;
        width: 100%;
    }
    
    .user-profile .btn {
        width: 100%;
        margin-right: 0 !important;
        margin-bottom: 0.25rem;
    }
    
    .stats-section {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
        margin-bottom: 2rem;
    }
    
    .stat-card {
        padding: 1rem;
    }
    
    .stat-value {
        font-size: 1.75rem;
    }
    
    .timeline-container {
        padding-left: 1.5rem;
    }
    
    .timeline-container::before {
        left: 5px;
    }
    
    .timeline-marker {
        left: -1.5rem;
        width: 20px;
        height: 20px;
        top: 6px;
        font-size: 0.65rem;
    }
    
    .timeline-card {
        padding: 1.25rem;
    }
    
    .card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .eval-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
}

@media (max-width: 480px) {
    .stats-section {
        grid-template-columns: 1fr;
    }
    .eval-grid {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   ADMIN BAR & IN-LINE EDITING STYLING
   ========================================================================== */
body.has-admin-bar {
    padding-top: 50px;
}
body.has-admin-bar .landing-nav,
body.has-admin-bar .dashboard-header {
    top: 50px;
}

.admin-top-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 50px;
    background: #0f172a;
    border-bottom: 2px solid var(--warning-color);
    z-index: 9999;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 1.5rem;
    color: #f8fafc;
    font-family: 'Nunito', sans-serif;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.admin-bar-brand {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--warning-color);
    letter-spacing: 0.5px;
}

.admin-bar-controls {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.admin-status {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.admin-status strong {
    color: #fff;
}

.edit-mode-toggle-container {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.05);
    padding: 0.35rem 0.75rem;
    border-radius: 2rem;
    border: 1px solid var(--border-glass);
}

/* Toggle Switch Style */
.switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 20px;
}
.switch input { 
  opacity: 0;
  width: 0;
  height: 0;
}
.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #475569;
  transition: .3s;
}
.slider:before {
  position: absolute;
  content: "";
  height: 14px;
  width: 14px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .3s;
}
input:checked + .slider {
  background-color: var(--primary-color);
}
input:checked + .slider:before {
  transform: translateX(20px);
}
.slider.round {
  border-radius: 20px;
}
.slider.round:before {
  border-radius: 50%;
}

/* Inline Editable Elements */
[contenteditable="true"] {
    outline: none;
    transition: all 0.2s ease;
    cursor: text;
}
[contenteditable="true"]:hover {
    background: rgba(41, 156, 211, 0.08);
    box-shadow: 0 0 0 2px rgba(41, 156, 211, 0.3);
    border-radius: 4px;
}
[contenteditable="true"]:focus {
    background: rgba(41, 156, 211, 0.15);
    box-shadow: 0 0 0 3px var(--primary-color);
    border-radius: 4px;
}

/* Toast Notifications */
.toast-notification {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: #1e293b;
    border-left: 4px solid var(--success-color);
    padding: 1rem 1.5rem;
    border-radius: 0.5rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    color: #fff;
    z-index: 10000;
    font-family: 'Nunito', sans-serif;
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.toast-notification.active {
    transform: translateY(0);
    opacity: 1;
}
.toast-notification.error {
    border-left-color: var(--danger-color);
}

