/* ==========================================
   SCHOOL DEMO - COMPLETE STYLES
   ========================================== */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #f8f9fa;
    color: #1e293b;
}

/* ==========================================
   LOGIN PAGE STYLES
   ========================================== */
.demo-login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #E9D5FF 0%, #ffffff 100%);
    padding: 20px;
}

.demo-login-box {
    background: white;
    padding: 50px 40px;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
    max-width: 450px;
    width: 100%;
}

.demo-logo {
    text-align: center;
    margin-bottom: 30px;
}

/* Logo Icon */
.logo-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #8B5CF6 0%, #7C3AED 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
}

.logo-icon svg {
    color: white;
}

.demo-logo h1 {
    font-size: 1.75rem;
    color: #8B5CF6;
    margin-bottom: 10px;
}

.demo-logo p {
    color: #64748b;
    font-size: 1rem;
}

.demo-credentials {
    background: #fef3c7;
    border: 2px solid #f59e0b;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 30px;
}

.demo-credentials strong {
    display: block;
    color: #1e293b;
    margin-bottom: 15px;
    font-size: 0.95rem;
    text-align: center;
}

/* Account Icons */
.demo-account {
    background: white;
    padding: 12px 15px;
    border-radius: 8px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.demo-account:last-child {
    margin-bottom: 0;
}

.account-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.account-icon.coordinator {
    background: linear-gradient(135deg, #8B5CF6 0%, #7C3AED 100%);
}

.account-icon.teacher {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.account-icon.parent {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.account-icon svg {
    color: white;
}

.account-details {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.demo-account .role {
    font-weight: 600;
    color: #1e293b;
    font-size: 0.9rem;
}

.demo-account code {
    background: #f1f5f9;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.85rem;
    color: #64748b;
    font-family: 'Courier New', monospace;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Form Group */
.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
    font-size: 0.95rem;
}

.form-group label svg {
    color: #8B5CF6;
}

.form-group input {
    padding: 12px 14px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-group input:focus {
    outline: none;
    border-color: #8B5CF6;
}

/* Button with Icon */
.btn-login {
    background: #8B5CF6;
    color: white;
    padding: 14px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-login:hover {
    background: #7C3AED;
    transform: translateY(-2px);
}

.btn-login svg {
    flex-shrink: 0;
}

/* Error Message with Icon */
.error-message {
    background: #fee2e2;
    color: #991b1b;
    padding: 12px;
    border-radius: 8px;
    font-size: 0.95rem;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.error-message svg {
    flex-shrink: 0;
}

/* Back Link with Icon */
.back-link {
    text-align: center;
    margin-top: 20px;
}

.back-link a {
    color: #8B5CF6;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: color 0.3s;
}

.back-link a:hover {
    color: #7C3AED;
}

/* ==========================================
   DASHBOARD LAYOUT
   ========================================== */
.dashboard-container {
    display: flex;
    min-height: 100vh;
}

/* ==========================================
   SIDEBAR
   ========================================== */
.sidebar {
    width: 260px;
    background: #1e293b;
    color: white;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    z-index: 1000;
    transition: transform 0.3s ease;
}

.sidebar-header {
    padding: 24px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-header .logo-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 12px;
}

.sidebar-header h2 {
    font-size: 1.2rem;
    text-align: center;
    margin: 0;
}

.sidebar-nav {
    flex: 1;
    padding: 20px 0;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: #cbd5e1;
    text-decoration: none;
    transition: all 0.3s;
    font-weight: 500;
}

.nav-item:hover {
    background: rgba(255,255,255,0.1);
    color: white;
}

.nav-item.active {
    background: linear-gradient(135deg, #8B5CF6 0%, #7C3AED 100%);
    color: white;
}

.nav-item svg {
    flex-shrink: 0;
}

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

.logout-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: rgba(239, 68, 68, 0.1);
    color: #fca5a5;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.3s;
}

.logout-btn:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

/* ==========================================
   MOBILE MENU TOGGLE
   ========================================== */
.mobile-menu-toggle {
    display: none;
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1001;
    background: #8B5CF6;
    color: white;
    border: none;
    padding: 12px;
    border-radius: 8px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.mobile-menu-toggle:active {
    transform: scale(0.95);
}

/* ==========================================
   MAIN CONTENT
   ========================================== */
.main-content {
    flex: 1;
    margin-left: 260px;
    padding: 30px;
    background: #f8f9fa;
    transition: margin-left 0.3s ease;
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.top-bar h1 {
    font-size: 1.8rem;
    color: #1e293b;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #8B5CF6 0%, #7C3AED 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.user-name {
    font-weight: 600;
    color: #1e293b;
}

.user-role {
    font-size: 0.85rem;
    color: #64748b;
}

/* ==========================================
   STATS GRID
   ========================================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    transition: transform 0.3s;
}

.stat-card:hover {
    transform: translateY(-4px);
}

.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-icon.purple {
    background: linear-gradient(135deg, #8B5CF6 0%, #7C3AED 100%);
    color: white;
}

.stat-icon.blue {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
}

.stat-icon.pink {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

.stat-icon.green {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
}

.stat-info h3 {
    font-size: 2rem;
    color: #1e293b;
    margin-bottom: 4px;
}

.stat-info p {
    color: #64748b;
    font-size: 0.9rem;
}

/* ==========================================
   CONTENT SECTIONS
   ========================================== */
.content-section {
    background: white;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.section-header h2 {
    font-size: 1.3rem;
    color: #1e293b;
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: linear-gradient(135deg, #8B5CF6 0%, #7C3AED 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.3s;
}

.btn-primary:hover {
    transform: translateY(-2px);
}

.btn-text {
    color: #8B5CF6;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s;
}

.btn-text:hover {
    color: #7C3AED;
}

/* ==========================================
   ANNOUNCEMENTS
   ========================================== */
.announcements-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.announcement-item {
    padding: 16px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #8B5CF6;
}

.announcement-item.urgent {
    border-left-color: #ef4444;
    background: #fef2f2;
}

.announcement-item.high {
    border-left-color: #f59e0b;
    background: #fffbeb;
}

.announcement-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 8px;
}

.announcement-header h3 {
    font-size: 1.05rem;
    color: #1e293b;
}

.announcement-date {
    font-size: 0.85rem;
    color: #64748b;
}

.announcement-item p {
    color: #64748b;
    line-height: 1.6;
    margin-bottom: 12px;
}

.announcement-meta {
    display: flex;
    gap: 8px;
}

.badge {
    display: inline-block;
    padding: 4px 12px;
    background: #e0e7ff;
    color: #4f46e5;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: capitalize;
}

.priority-badge {
    display: inline-block;
    padding: 4px 12px;
    background: #fef3c7;
    color: #d97706;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: capitalize;
}

/* ==========================================
   SCHEDULE
   ========================================== */
.schedule-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.schedule-item {
    display: flex;
    gap: 16px;
    padding: 16px;
    background: #f8f9fa;
    border-radius: 8px;
}

.schedule-time {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #8B5CF6;
    font-weight: 600;
    min-width: 180px;
}

.schedule-details h3 {
    font-size: 1.05rem;
    color: #1e293b;
    margin-bottom: 4px;
}

.schedule-details p {
    color: #64748b;
    font-size: 0.9rem;
}

/* ==========================================
   TABLES
   ========================================== */
.table-container {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table thead {
    background: #f8f9fa;
}

.data-table th {
    padding: 12px;
    text-align: left;
    font-weight: 600;
    color: #64748b;
    font-size: 0.9rem;
    border-bottom: 2px solid #e2e8f0;
}

.data-table td {
    padding: 12px;
    border-bottom: 1px solid #e2e8f0;
    color: #1e293b;
}

.data-table tbody tr:hover {
    background: #f8f9fa;
}

.badge-warning {
    background: #fef3c7;
    color: #d97706;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
}

/* ==========================================
   STUDENT CARD (Parent Dashboard)
   ========================================== */
.student-card {
    background: linear-gradient(135deg, #8B5CF6 0%, #7C3AED 100%);
    color: white;
    padding: 24px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 30px;
}

.student-avatar {
    width: 72px;
    height: 72px;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.student-info {
    flex: 1;
}

.student-info h2 {
    font-size: 1.5rem;
    margin-bottom: 8px;
}

.student-info p {
    opacity: 0.9;
}

.student-stats {
    display: flex;
    gap: 24px;
}

.stat-mini {
    text-align: center;
}

.stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.stat-label {
    display: block;
    font-size: 0.85rem;
    opacity: 0.9;
}

/* ==========================================
   GRADE BADGES
   ========================================== */
.grade-badge {
    display: inline-block;
    padding: 6px 16px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 0.9rem;
}

.grade-badge.grade-a {
    background: #d1fae5;
    color: #065f46;
}

.grade-badge.grade-b {
    background: #dbeafe;
    color: #1e40af;
}

/* ==========================================
   UTILITIES
   ========================================== */
.no-data {
    text-align: center;
    color: #94a3b8;
    padding: 40px 20px;
    font-style: italic;
}

/* ==========================================
   RESPONSIVE DESIGN
   ========================================== */

/* Tablet View */
@media (max-width: 1024px) {
    .sidebar {
        width: 70px;
    }

    .sidebar-header h2,
    .nav-item span,
    .logout-btn span {
        display: none;
    }

    .main-content {
        margin-left: 70px;
        padding: 24px;
    }

    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
}

/* Mobile View */
@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: block;
    }

    .sidebar {
        width: 260px;
        transform: translateX(-100%);
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .sidebar-header h2,
    .nav-item span,
    .logout-btn span {
        display: block;
    }

    .main-content {
        margin-left: 0;
        padding: 80px 20px 20px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .top-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    .top-bar h1 {
        font-size: 1.5rem;
    }

    .student-card {
        flex-direction: column;
        text-align: center;
        padding: 20px;
    }

    .student-stats {
        justify-content: center;
        flex-wrap: wrap;
    }

    .schedule-item {
        flex-direction: column;
        gap: 12px;
    }

    .schedule-time {
        min-width: auto;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .data-table {
        min-width: 600px;
    }
}

/* Small Mobile View */
@media (max-width: 480px) {
    .demo-login-box {
        padding: 30px 20px;
    }

    .demo-logo h1 {
        font-size: 1.5rem;
    }

    .demo-credentials {
        padding: 16px;
    }

    .demo-account {
        flex-direction: row;
        align-items: center;
        gap: 12px;
        padding: 10px;
    }

    .account-icon {
        width: 32px;
        height: 32px;
    }

    .demo-account .role {
        font-size: 0.85rem;
    }

    .demo-account code {
        font-size: 0.8rem;
        padding: 3px 8px;
    }

    .main-content {
        padding: 70px 16px 16px;
    }

    .top-bar h1 {
        font-size: 1.3rem;
    }

    .stat-card {
        padding: 16px;
    }

    .stat-icon {
        width: 48px;
        height: 48px;
    }

    .stat-info h3 {
        font-size: 1.5rem;
    }

    .content-section {
        padding: 16px;
    }

    .section-header h2 {
        font-size: 1.1rem;
    }

    .btn-primary {
        width: 100%;
        justify-content: center;
    }

    .announcement-header {
        flex-direction: column;
        gap: 8px;
    }

    .student-card {
        padding: 16px;
    }

    .student-avatar {
        width: 56px;
        height: 56px;
    }

    .student-info h2 {
        font-size: 1.3rem;
    }

    .stat-mini {
        flex: 1;
    }
}

/* Very Small Devices */
@media (max-width: 360px) {
    .stats-grid {
        gap: 12px;
    }

    .stat-card {
        flex-direction: column;
        text-align: center;
        gap: 12px;
    }

    .student-stats {
        width: 100%;
    }

    .demo-credentials strong {
        font-size: 0.9rem;
    }
}