/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #3498db;
    --secondary-color: #2c3e50;
    --success-color: #27ae60;
    --warning-color: #f39c12;
    --danger-color: #e74c3c;
    --light-color: #ecf0f1;
    --dark-color: #34495e;
    --sidebar-width: 250px;
    --topnav-height: 60px;
    --transition-speed: 0.3s;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    background-color: #f5f7fa;
    color: #333;

    
}
 .school-logo {
            width: 100px;
            height: 100px;
            border-radius: 50%;
            border: 3px solid white;
            overflow: hidden;
            display: flex;
            align-items: center;
            justify-content: center;
            background: white;
        }
        
        .school-logo img {
            max-width: 100%;
            max-height: 100%;
            object-fit: contain;
        }
/* Login Page */
.login-container {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
   
}

.login-box {
    background: white;
    padding: 2.5rem;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 600px;
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-header h1 {
    color: var(--secondary-color);
    margin-bottom: 0.5rem;
}

.login-header p {
    color: #666;
}

.form-group {
    margin-bottom: 0.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--secondary-color);
    font-weight: 500;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
    transition: border-color var(--transition-speed);
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color var(--transition-speed);
    text-decoration: none;
    text-align: center;
}

.btn:hover {
    background-color: #2980b9;
}

.btn-success {
    background-color: var(--success-color);
}

.btn-success:hover {
    background-color: #219a52;
}

.btn-warning {
    background-color: var(--warning-color);
}

.btn-warning:hover {
    background-color: #d68910;
}

.btn-danger {
    background-color: var(--danger-color);
}

.btn-danger:hover {
    background-color: #c0392b;
}

.btn-block {
    width: 100%;
    display: block;
}

.alert {
    padding: 1rem;
    border-radius: 5px;
    margin-bottom: 1rem;
    display: none;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Dashboard Layout */
.dashboard {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: var(--sidebar-width);
    background-color: var(--secondary-color);
    color: white;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    transition: transform var(--transition-speed);
    z-index: 1000;
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-header h2 {
    font-size: 1.5rem;
}

.sidebar-nav {
    padding: 1rem 0;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    padding: 0.75rem 1.5rem;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: all var(--transition-speed);
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
    border-left: 4px solid var(--primary-color);
}

.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    transition: margin-left var(--transition-speed);
       max-width: 100%;
    overflow-x: hidden;
}

.topnav {
    display: none;
    height: var(--topnav-height);
    background-color: white;
    border-bottom: 1px solid #ddd;
    padding: 0 1rem;
    position: sticky;
    top: 0;
    z-index: 999;
}

.topnav-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
}

.hamburger {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 20px;
    cursor: pointer;
}

.hamburger div {
    height: 3px;
    background-color: var(--secondary-color);
    border-radius: 3px;
    transition: var(--transition-speed);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.content-area {
    padding: 2rem;
    margin-top: -21pt;
}

/* Cards */
.card {
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
    overflow: hidden;
}

.card-header {
    padding: 1.5rem;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header h3 {
    color: var(--secondary-color);
}

.card-body {
    padding: 1.5rem;
}

/* Tables */
.table-responsive {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.table th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: var(--secondary-color);
}

.table tbody tr:hover {
    background-color: #f8f9fa;
}

/* Forms */
.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

/* Report Card */
.report-card {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.report-header {
    text-align: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--primary-color);
}

.student-info {
    margin-bottom: 2rem;
}

.student-info table {
    width: 100%;
}

.grades-table {
    margin-bottom: 2rem;
}

.remarks {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid #eee;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1100;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: white;
    border-radius: 10px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-body {
    padding: 1.5rem;
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #666;
}

/* Responsive Design */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .topnav {
        display: block;
    }
    
    .content-area {
        padding: 1rem;
    }
    
    .card-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
}

      .footer {
            padding: 20px 30px;
            background: white;
            border-top: 1px solid #e1e5ee;
            display: flex;
            justify-content: space-between;
            align-items: center;
            color: #6c757d;
            font-size: 14px;
            margin-left: 250px;
        }

        .footer-links a {
            color: var(--primary-color);
            text-decoration: none;
            margin-left: 20px;
        }
@media (max-width: 576px) {
    .login-box {
        padding: 1.5rem;
        margin: 1rem;
    }
    
    .table th,
    .table td {
        padding: 0.5rem;
    }

       .footer {
                flex-direction: column;
                gap: 10px;
                text-align: center;
                margin-left: 0pt;
            }
            
            .footer-links a {
                margin: 0 10px;
            }
}

/* Loading Spinner */
.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Bulk upload styles */
.bulk-upload-section {
    margin: 2rem 0;
}

.upload-area {
    border: 2px dashed #3498db;
    border-radius: 10px;
    padding: 3rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    background: #f8fafc;
    margin-bottom: 1rem;
}

.upload-area:hover {
    border-color: #2980b9;
    background: #e3f2fd;
}

.upload-area i {
    font-size: 3rem;
    color: #3498db;
    margin-bottom: 1rem;
}

.upload-instructions {
    margin-top: 1rem;
    font-size: 0.9rem;
    color: #666;
}

.preview-table {
    margin-top: 2rem;
    overflow-x: auto;
}

.preview-table table {
    width: 100%;
    border-collapse: collapse;
}

.preview-table th {
    background: #3498db;
    color: white;
    padding: 0.75rem;
}

.preview-table td {
    padding: 0.75rem;
    border-bottom: 1px solid #ddd;
}

/* Multi-student entry form */
.multi-entry-form {
    background: white;
    border-radius: 10px;
    padding: 2rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.student-score-row {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr 1fr;
    gap: 1rem;
    padding: 1rem;
    border-bottom: 1px solid #eee;
    align-items: center;
}

.student-score-row:last-child {
    border-bottom: none;
}

.student-score-row:nth-child(even) {
    background: #f9f9f9;
}

.score-input {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 5px;
    text-align: center;
}

.score-input:focus {
    outline: none;
    border-color: #3498db;
}

.total-score {
    font-weight: bold;
    color: #2c3e50;
    text-align: center;
}

.class-selector {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.class-btn {
    padding: 0.75rem 1.5rem;
    background: #ecf0f1;
    border: 2px solid #bdc3c7;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s;
}

.class-btn:hover {
    background: #3498db;
    color: white;
    border-color: #2980b9;
}

.class-btn.active {
    background: #2980b9;
    color: white;
    border-color: #2980b9;
}

/* Score summary */
.score-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-top: 2rem;
}

.summary-card {
    background: white;
    padding: 1.5rem;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    text-align: center;
}

.summary-card h4 {
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

.summary-card .value {
    font-size: 1.5rem;
    font-weight: bold;
    color: #3498db;
}

/* Print styles */
@media print {
    .no-print {
        display: none !important;
    }
    
    .report-card {
        box-shadow: none !important;
        border: 1px solid #000;
        page-break-inside: avoid;
    }
    
    .content-area {
        padding: 0 !important;
    }
}

/* Responsive tables */
@media (max-width: 768px) {
    .student-score-row {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
    
    .class-selector {
        flex-direction: column;
    }
    
    .class-btn {
        width: 100%;
    }
}

      /* Charts Section */
        .charts-section {
            display: grid;
            grid-template-columns: 2fr 1fr;
            gap: 30px;
            margin-bottom: 40px;
        }

        .chart-card {
            background: white;
            border-radius: 15px;
            padding: 25px;
            box-shadow: var(--card-shadow);
        }

        .chart-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 25px;
        }
          .chart-card {
    background: #fff;
    padding: 20px;
    margin-top: 30px;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0,0,0,.08);
}

.chart-card h3 {
    margin-bottom: 15px;
    font-size: 1.1rem;
    color: #111827;
}

/* Make canvas responsive */
canvas {
    max-width: 100%;
}

        .chart-header h3 {
            font-size: 20px;
            font-weight: 600;
            color: var(--dark-color);
        }

        .chart-options select {
            padding: 8px 15px;
            border-radius: 8px;
            border: 1px solid #e1e5ee;
            background-color: white;
            font-size: 14px;
            color: #5a6c7d;
        }

        .chart-container {
            height: 300px;
            position: relative;
        }

        /* Promotion Status Styles */
.status-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 500;
    margin-left: 5px;
}

.status-promoted {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.status-not-promoted {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Promotion hierarchy */
.class-hierarchy {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 20px 0;
    padding: 15px;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

.class-hierarchy > div {
    text-align: center;
    flex: 1;
}

.class-hierarchy .arrow {
    font-size: 2rem;
    color: #6c757d;
    margin: 0 20px;
}

/* Quick stats cards */
.promotion-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.stat-card {
    background: white;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    text-align: center;
}

.stat-card h4 {
    margin: 0 0 10px 0;
    color: #495057;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-card p {
    margin: 0;
    font-size: 1.8rem;
    font-weight: bold;
    color: #007bff;
}

.stat-card small {
    color: #6c757d;
    font-size: 0.85rem;
}
    

        .nav-icon {
    width: 20px;
    height: 20px;
    margin-right: 10px;
    vertical-align: middle;
}

/* ===== Global Page Loader ===== */
#global-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
}

/* Spinner */
.spinner {
    width: 55px;
    height: 55px;
    border: 6px solid #e0e0e0;
    border-top: 6px solid #2c7be5; /* school blue */
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Excel Preview Table */
#previewTable table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

#previewTable th, #previewTable td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: center;
}

#previewTable th {
    background-color: #3498db;
    color: white;
}

#previewTable tr:nth-child(even) {
    background-color: #f2f2f2;
}

/* Student score row adjustments for new columns */
.student-score-row {
    display: grid;
    grid-template-columns: 2fr repeat(8, 1fr);
    gap: 10px;
    padding: 10px;
    border-bottom: 1px solid #eee;
    align-items: center;
}

.student-score-row:nth-child(even) {
    background-color: #f9f9f9;
}

.student-score-row:hover {
    background-color: #f0f0f0;
}

.class-score-display {
    font-weight: bold;
    color: #3498db;
    font-size: 14px;
}

/* Responsive adjustments */
@media (max-width: 1200px) {
    .student-score-row {
        grid-template-columns: 2fr repeat(4, 1fr);
        grid-template-rows: auto auto;
    }
    
    .student-score-row > div:first-child {
        grid-column: 1 / -1;
    }
}
