/* ===================================
   SCHOOLA - Main Stylesheet
   Modern School Management System
   =================================== */

/* ========== Global Styles ========== */
:root {
    --primary-color: #667eea;
    --primary-dark: #764ba2;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    --light-color: #f8f9fa;
    --dark-color: #333;
    --border-radius-sm: 8px;
    --border-radius-md: 10px;
    --border-radius-lg: 15px;
    --border-radius-xl: 20px;
    --transition: all 0.3s ease;
    --box-shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.05);
    --box-shadow-md: 0 4px 15px rgba(0, 0, 0, 0.08);
    --box-shadow-lg: 0 8px 25px rgba(0, 0, 0, 0.12);
    --box-shadow-xl: 0 10px 40px rgba(0, 0, 0, 0.2);
}

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

body {
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f0f2f5;
    color: var(--dark-color);
    line-height: 1.6;
}

/* ========== Gradient Backgrounds ========== */
.bg-gradient-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

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

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

.bg-gradient-warning {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
}

.bg-gradient-danger {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%);
}

.bg-gradient-purple {
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
}

.bg-gradient-light-success {
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
}

.bg-gradient-light-warning {
    background: linear-gradient(135deg, #fff3e0 0%, #ffe0b2 100%);
}

.bg-gradient-light-info {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
}

.bg-gradient-light-danger {
    background: linear-gradient(135deg, #ffebee 0%, #ffcdd2 100%);
}

/* ========== Page Header ========== */
.page-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: var(--border-radius-lg);
    color: white;
    padding: 30px;
    margin-bottom: 30px;
    position: relative;
    overflow: hidden;
}

.page-header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 300px;
    height: 300px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
}

.page-header::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -5%;
    width: 200px;
    height: 200px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
}

.welcome-banner {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: var(--border-radius-xl);
    color: white;
    padding: 40px;
    margin-bottom: 30px;
    position: relative;
    overflow: hidden;
}

/* ========== Cards ========== */
.schoola-card {
    border-radius: var(--border-radius-lg);
    border: none;
    box-shadow: var(--box-shadow-md);
    transition: var(--transition);
    overflow: hidden;
    background: white;
}

.schoola-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--box-shadow-lg);
}

.stat-card {
    border-radius: var(--border-radius-lg);
    border: none;
    box-shadow: var(--box-shadow-md);
    padding: 25px;
    transition: var(--transition);
    background: white;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--box-shadow-lg);
}

.filter-card {
    border-radius: var(--border-radius-lg);
    border: none;
    box-shadow: var(--box-shadow-md);
    padding: 25px;
    margin-bottom: 20px;
    background: white;
}

.table-card {
    border-radius: var(--border-radius-lg);
    border: none;
    box-shadow: var(--box-shadow-md);
    overflow: hidden;
    background: white;
}

/* ========== Stat Icons ========== */
.stat-icon {
    width: 70px;
    height: 70px;
    border-radius: var(--border-radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
}

/* ========== Badges ========== */
.status-badge {
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    display: inline-block;
}

.status-active {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    color: #155724;
}

.status-available {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    color: #155724;
}

.status-borrowed {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    color: #856404;
}

.status-overdue {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    color: #721c24;
}

.demo-badge {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    display: inline-block;
}

/* ========== Buttons ========== */
.btn-add-student,
.btn-add-teacher,
.btn-add-grade,
.btn-add-book,
.btn-add-score,
.btn-process-payment,
.btn-save-student,
.btn-save-teacher,
.btn-save-grade {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    padding: 12px 30px;
    border-radius: var(--border-radius-md);
    color: white;
    font-weight: 600;
    transition: var(--transition);
    cursor: pointer;
}

.btn-add-student:hover,
.btn-add-teacher:hover,
.btn-add-grade:hover,
.btn-add-book:hover,
.btn-add-score:hover,
.btn-process-payment:hover,
.btn-save-student:hover,
.btn-save-teacher:hover,
.btn-save-grade:hover {
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
    color: white;
}

.quick-action-btn {
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    border: none;
    transition: var(--transition);
    background: white;
    box-shadow: var(--box-shadow-sm);
    cursor: pointer;
}

.quick-action-btn:hover {
    transform: translateY(-3px);
    box-shadow: var(--box-shadow-md);
}

.action-btn {
    padding: 5px 10px;
    border-radius: var(--border-radius-sm);
    border: none;
    margin: 0 2px;
    transition: var(--transition);
    cursor: pointer;
}

.action-btn:hover {
    transform: scale(1.1);
}

/* ========== Forms ========== */
.form-label {
    font-weight: 600;
    color: var(--dark-color);
    margin-bottom: 8px;
}

.form-control,
.form-select {
    border: 2px solid #e0e0e0;
    border-radius: var(--border-radius-md);
    padding: 10px 15px;
    transition: var(--transition);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
    outline: none;
}

.grade-select,
.subject-select,
.category-select,
.student-select {
    border: 2px solid #e0e0e0;
    border-radius: var(--border-radius-md);
    padding: 10px 20px;
    background: white;
    color: #666;
    font-weight: 600;
    min-width: 200px;
}

.grade-select:focus,
.subject-select:focus,
.category-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

/* ========== Tables ========== */
.table thead th {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    color: var(--dark-color);
    font-weight: 600;
    border: none;
    padding: 15px;
}

.table tbody tr:hover {
    background-color: var(--light-color);
}

.table tbody tr {
    transition: var(--transition);
}

/* ========== Modals ========== */
.modal-content {
    border-radius: var(--border-radius-xl);
    border: none;
    box-shadow: var(--box-shadow-xl);
}

.modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: var(--border-radius-xl) var(--border-radius-xl) 0 0;
    border: none;
    padding: 20px 30px;
}

.modal-header .btn-close {
    filter: brightness(0) invert(1);
}

/* ========== Progress Bars ========== */
.progress-custom {
    height: 10px;
    border-radius: 10px;
}

/* ========== Activities & History ========== */
.recent-activity {
    max-height: 400px;
    overflow-y: auto;
}

.activity-item {
    padding: 15px;
    border-left: 3px solid var(--primary-color);
    margin-bottom: 15px;
    background: var(--light-color);
    border-radius: var(--border-radius-sm);
    transition: var(--transition);
}

.activity-item:hover {
    background: #e9ecef;
    transform: translateX(5px);
}

.payment-history-item {
    padding: 15px;
    border-left: 3px solid var(--primary-color);
    margin-bottom: 15px;
    background: var(--light-color);
    border-radius: var(--border-radius-sm);
}

/* ========== Info Boxes ========== */
.info-box {
    padding: 20px;
    border-radius: var(--border-radius-lg);
    margin-bottom: 20px;
}

.student-info-box,
.book-info-box {
    border-left: 4px solid var(--primary-color);
    padding: 15px;
    background: var(--light-color);
    border-radius: var(--border-radius-sm);
    margin-bottom: 15px;
}

/* ========== Score Badges ========== */
.score-badge {
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
}

.score-excellent {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    color: #155724;
}

.score-good {
    background: linear-gradient(135deg, #d1ecf1 0%, #bee5eb 100%);
    color: #0c5460;
}

.score-average {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    color: #856404;
}

.score-poor {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    color: #721c24;
}

/* ========== Select2 Customization ========== */
.select2-container--default .select2-selection--single {
    height: 45px !important;
    border: 2px solid #e0e0e0 !important;
    border-radius: var(--border-radius-md) !important;
    padding: 0 !important;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 41px !important;
    padding-left: 15px !important;
    color: #666 !important;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 41px !important;
    right: 10px !important;
}

.select2-container--default.select2-container--focus .select2-selection--single,
.select2-container--default.select2-container--open .select2-selection--single {
    border-color: var(--primary-color) !important;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25) !important;
}

.select2-dropdown {
    border: 2px solid var(--primary-color) !important;
    border-radius: var(--border-radius-md) !important;
    box-shadow: var(--box-shadow-md) !important;
}

.select2-container--default .select2-results__option--highlighted[aria-selected] {
    background-color: var(--primary-color) !important;
}

.select2-container--default .select2-results__option[aria-selected=true] {
    background-color: #f0f0f0 !important;
    color: var(--dark-color) !important;
}

.select2-search--dropdown .select2-search__field {
    border: 2px solid #e0e0e0 !important;
    border-radius: var(--border-radius-sm) !important;
    padding: 8px 12px !important;
}

.select2-search--dropdown .select2-search__field:focus {
    border-color: var(--primary-color) !important;
    outline: none !important;
}

/* ========== Tabs Navigation ========== */
.nav-tabs {
    border-bottom: 2px solid #e0e0e0;
}

.nav-tabs .nav-link {
    color: #666;
    font-weight: 600;
    border: none;
    padding: 12px 25px;
    border-radius: var(--border-radius-md) var(--border-radius-md) 0 0;
}

.nav-tabs .nav-link.active {
    color: var(--primary-color);
    background: white;
    border-bottom: 3px solid var(--primary-color);
}

.tab-content {
    padding: 25px;
    background: white;
    border-radius: 0 0 var(--border-radius-lg) var(--border-radius-lg);
}

/* ========== Animations ========== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease-in-out;
}

/* ========== Utilities ========== */
.text-gradient-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.shadow-sm {
    box-shadow: var(--box-shadow-sm) !important;
}

.shadow-md {
    box-shadow: var(--box-shadow-md) !important;
}

.shadow-lg {
    box-shadow: var(--box-shadow-lg) !important;
}

/* ========== Responsive Design ========== */
@media (max-width: 768px) {
    .page-header {
        padding: 20px;
    }

    .welcome-banner {
        padding: 30px 20px;
    }

    .stat-icon {
        width: 50px;
        height: 50px;
        font-size: 1.5rem;
    }

    .filter-card,
    .stat-card {
        padding: 15px;
    }

    .quick-action-btn {
        padding: 15px;
    }
}

@media (max-width: 576px) {
    .page-header {
        padding: 15px;
    }

    .stat-card {
        margin-bottom: 15px;
    }
}

/* ========== Print Styles ========== */
@media print {
    .page-header,
    .filter-card,
    .action-btn,
    .btn-add-student,
    .btn-add-teacher,
    .sidebar {
        display: none !important;
    }

    body {
        background: white;
    }

    .schoola-card,
    .table-card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}
