/* Global Styles */
:root {
    --primary-color: #0d6efd;
    --secondary-color: #6c757d;
    --success-color: #198754;
    --info-color: #0dcaf0;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f8f9fa;
    overflow-x: hidden;
}

/* Sidebar Styles */
#sidebar {
    min-width: 280px;
    max-width: 280px;
    transition: all 0.3s;
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    overflow-y: auto;
}

#sidebar.d-none {
    margin-left: -280px;
}

#sidebar .nav-link {
    padding: 0.8rem 1rem;
    border-radius: 5px;
    margin-bottom: 0.2rem;
    transition: all 0.3s;
}

#sidebar .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

#sidebar .nav-link.active {
    background-color: var(--primary-color);
}

#sidebar .nav-link i {
    width: 24px;
    text-align: center;
}

/* Main Content */
#page-content-wrapper {
    margin-left: 280px;
    transition: all 0.3s;
    min-height: 100vh;
}

#page-content-wrapper.full-width {
    margin-left: 0;
}

/* Cards */
.card {
    border: none;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(0,0,0,0.05);
    transition: transform 0.3s, box-shadow 0.3s;
}

.card:hover {
    box-shadow: 0 5px 25px rgba(0,0,0,0.1);
}

.stats-card {
    border-left: 4px solid;
    transition: all 0.3s;
}

.stats-card:hover {
    transform: translateY(-5px);
}

/* Buttons */
.btn {
    border-radius: 5px;
    padding: 0.5rem 1.5rem;
    font-weight: 500;
    transition: all 0.3s;
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background-color: #0b5ed7;
    border-color: #0b5ed7;
    transform: translateY(-2px);
}

/* Forms */
.form-control, .form-select {
    border-radius: 5px;
    border: 1px solid #dee2e6;
    padding: 0.5rem 0.75rem;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

/* Tables */
.table {
    margin-bottom: 0;
}

.table thead th {
    background-color: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
    color: #495057;
    font-weight: 600;
}

.table-hover tbody tr:hover {
    background-color: rgba(13, 110, 253, 0.05);
}

/* Badges */
.badge {
    padding: 0.5em 0.8em;
    font-weight: 500;
    border-radius: 5px;
}

/* Alerts */
.alert {
    border: none;
    border-radius: 10px;
    padding: 1rem 1.5rem;
}

.alert-success {
    background-color: #d1e7dd;
    color: #0f5132;
}

.alert-warning {
    background-color: #fff3cd;
    color: #856404;
}

.alert-danger {
    background-color: #f8d7da;
    color: #842029;
}

.alert-info {
    background-color: #cff4fc;
    color: #055160;
}

/* Result Sheet Styles */
.result-sheet {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(0,0,0,0.1);
}

.school-header {
    text-align: center;
    border-bottom: 3px solid var(--primary-color);
    padding-bottom: 1.5rem;
    margin-bottom: 2rem;
}

.school-logo {
    max-width: 100px;
    margin-bottom: 1rem;
}

.student-info {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 2rem;
}

.result-table th {
    background: var(--primary-color);
    color: white;
    padding: 12px;
    font-weight: 500;
}

.result-table td {
    padding: 10px;
    border-bottom: 1px solid #dee2e6;
}

.grade-a { background-color: #d4edda; }
.grade-b { background-color: #cce5ff; }
.grade-c { background-color: #fff3cd; }
.grade-d { background-color: #f8d7da; }
.grade-e { background-color: #e2d1c6; }
.grade-f { background-color: #f5c6cb; }

.position-badge {
    display: inline-block;
    padding: 5px 10px;
    border-radius: 20px;
    background: var(--success-color);
    color: white;
    font-weight: bold;
}

/* Print Styles */
@media print {
    .no-print, .sidebar, .navbar, .btn, footer {
        display: none !important;
    }
    
    #page-content-wrapper {
        margin-left: 0 !important;
    }
    
    .result-sheet {
        box-shadow: none;
        padding: 0;
    }
    
    .card {
        box-shadow: none;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    #sidebar {
        margin-left: -280px;
    }
    
    #sidebar.show {
        margin-left: 0;
    }
    
    #page-content-wrapper {
        margin-left: 0;
    }
    
    .stats-card {
        margin-bottom: 1rem;
    }
}

/* Loading Spinner */
.spinner-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255,255,255,0.8);
    z-index: 9999;
    display: none;
    justify-content: center;
    align-items: center;
}

.spinner-wrapper.show {
    display: flex;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #0b5ed7;
}