:root {
    --primary-color: #6f42c1;
    --secondary-color: #495057;
    --musical-color: #8b5a87;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
    --border-radius: 0.375rem;
    --box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    --transition: all 0.15s ease-in-out;
}

/* Global Styles */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f5f5;
    color: var(--dark-color);
    line-height: 1.6;
}

/* Custom Background for Musical Theme */
.bg-musical {
    background: linear-gradient(135deg, var(--musical-color) 0%, var(--primary-color) 100%) !important;
}

/* Navigation Styles */
.navbar-brand {
    font-weight: 600;
    font-size: 1.4rem;
}

.navbar-nav .nav-link {
    font-weight: 500;
    transition: var(--transition);
    border-radius: var(--border-radius);
    margin: 0 0.25rem;
}

.navbar-nav .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
    transform: translateY(-1px);
}

/* Card Styles */
.card {
    border: none;
    border-radius: 0.75rem;
    box-shadow: var(--box-shadow);
    transition: var(--transition);
    overflow: hidden;
}

.card:hover {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.card-header {
    border-bottom: 1px solid rgba(0, 0, 0, 0.125);
    font-weight: 600;
    padding: 1rem 1.25rem;
}

/* Metric Cards */
.metric-card {
    border-radius: 1rem;
    transition: var(--transition);
}

.metric-card:hover {
    transform: scale(1.02);
}

.metric-icon {
    opacity: 0.7;
}

/* Button Styles */
.btn {
    border-radius: var(--border-radius);
    font-weight: 500;
    transition: var(--transition);
    border: none;
    padding: 0.5rem 1rem;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.15);
}

.btn-outline-primary:hover,
.btn-outline-success:hover,
.btn-outline-warning:hover,
.btn-outline-danger:hover,
.btn-outline-info:hover,
.btn-outline-secondary:hover {
    transform: translateY(-1px);
}

/* Table Styles */
.table {
    border-radius: var(--border-radius);
    overflow: hidden;
}

.table thead th {
    border-top: none;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.875rem;
}

.table-hover tbody tr:hover {
    background-color: rgba(0, 123, 255, 0.05);
}

/* Badge Styles */
.badge {
    font-weight: 500;
    padding: 0.375rem 0.75rem;
    border-radius: 0.5rem;
}

/* Form Styles */
.form-control,
.form-select {
    border-radius: var(--border-radius);
    border: 1px solid #dee2e6;
    transition: var(--transition);
    padding: 0.5rem 0.75rem;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(111, 66, 193, 0.25);
}

/* Progress Bar Styles */
.progress {
    border-radius: 0.5rem;
    overflow: hidden;
}

.progress-bar {
    transition: width 0.6s ease;
}

/* Alert Styles */
.alert {
    border: none;
    border-radius: 0.75rem;
    border-left: 4px solid;
}

.alert-success {
    border-left-color: var(--success-color);
    background-color: rgba(40, 167, 69, 0.1);
}

.alert-danger {
    border-left-color: var(--danger-color);
    background-color: rgba(220, 53, 69, 0.1);
}

.alert-warning {
    border-left-color: var(--warning-color);
    background-color: rgba(255, 193, 7, 0.1);
}

.alert-info {
    border-left-color: var(--info-color);
    background-color: rgba(23, 162, 184, 0.1);
}

/* Schedule Grid Styles */
.schedule-grid .schedule-table {
    min-width: 800px;
}

.time-slot {
    background-color: var(--light-color);
    font-weight: 600;
    text-align: center;
    vertical-align: middle;
}

.schedule-cell {
    min-height: 80px;
    vertical-align: top;
    position: relative;
    padding: 0.5rem;
}

.class-block {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    border-left: 4px solid var(--primary-color);
    border-radius: 0.5rem;
    padding: 0.5rem;
    margin-bottom: 0.25rem;
    font-size: 0.875rem;
    position: relative;
    transition: var(--transition);
}

.class-block:hover {
    background: linear-gradient(135deg, #bbdefb 0%, #90caf9 100%);
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.class-header {
    display: flex;
    justify-content: between;
    align-items: center;
    margin-bottom: 0.25rem;
}

.class-details {
    font-size: 0.8rem;
    color: var(--secondary-color);
    line-height: 1.4;
}

.class-actions {
    position: absolute;
    top: 0.25rem;
    right: 0.25rem;
    opacity: 0;
    transition: var(--transition);
}

.class-block:hover .class-actions {
    opacity: 1;
}

/* Teacher Schedule Card Styles */
.teacher-schedule-card .card-header {
    background: var(--primary-color);
    color: white;
}

.schedule-day {
    border-bottom: 1px solid #eee;
    padding-bottom: 1rem;
}

.schedule-day:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.day-header {
    color: var(--primary-color);
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.classes-list {
    margin-left: 1rem;
}

.class-item {
    background-color: var(--light-color);
    border-radius: 0.5rem;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    transition: var(--transition);
}

.class-item:hover {
    background-color: #e9ecef;
    transform: translateX(0.25rem);
}

/* Payroll Table Styles */
.payroll-table .teacher-avatar {
    display: flex;
    align-items: center;
}

.payroll-row:hover {
    background-color: rgba(111, 66, 193, 0.05);
}

/* Level Section Styles for Curriculum */
.level-section {
    border-radius: 0.75rem;
    overflow: hidden;
    box-shadow: var(--box-shadow);
    transition: var(--transition);
}

.level-section:hover {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.level-header {
    position: relative;
    overflow: hidden;
}

.level-content {
    background-color: white;
}

.curriculum-card {
    border-radius: 1rem;
    overflow: hidden;
}

/* Client Type Cards */
.client-type-card {
    transition: var(--transition);
}

.client-type-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 0.75rem 1.5rem rgba(0, 0, 0, 0.15);
}

/* Status Indicators */
.status-indicator {
    position: relative;
}

.status-indicator i {
    font-size: 0.875rem;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

/* Statistics Items */
.stats-item {
    padding: 0.5rem 0;
    border-bottom: 1px solid #eee;
}

.stats-item:last-child {
    border-bottom: none;
}

/* Report Section Styles */
.report-section {
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Modal Styles */
.modal-content {
    border-radius: 1rem;
    border: none;
    box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.175);
}

.modal-header {
    border-bottom: 1px solid #eee;
    border-radius: 1rem 1rem 0 0;
}

.modal-footer {
    border-top: 1px solid #eee;
    border-radius: 0 0 1rem 1rem;
}

/* Toast Styles for Notifications */
.toast {
    border-radius: 0.75rem;
    border: none;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

/* Loading Spinner */
.spinner-border-sm {
    width: 1rem;
    height: 1rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .metric-card {
        margin-bottom: 1rem;
    }
    
    .schedule-grid {
        overflow-x: auto;
    }
    
    .class-block {
        font-size: 0.75rem;
        padding: 0.25rem;
    }
    
    .btn-group-sm .btn {
        font-size: 0.75rem;
        padding: 0.25rem 0.5rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .table-responsive {
        font-size: 0.875rem;
    }
}

@media (max-width: 576px) {
    .container-fluid {
        padding: 0.5rem;
    }
    
    .card {
        border-radius: 0.5rem;
    }
    
    .btn {
        font-size: 0.875rem;
        padding: 0.375rem 0.75rem;
    }
    
    .navbar-brand {
        font-size: 1.1rem;
    }
    
    .h2 {
        font-size: 1.5rem;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    :root {
        --light-color: #343a40;
        --dark-color: #f8f9fa;
    }
    
    body {
        background-color: #1a1a1a;
        color: var(--dark-color);
    }
    
    .card {
        background-color: #2d3748;
        border-color: #4a5568;
    }
    
    .table {
        color: var(--dark-color);
    }
    
    .form-control,
    .form-select {
        background-color: #2d3748;
        border-color: #4a5568;
        color: var(--dark-color);
    }
    
    .class-block {
        background: linear-gradient(135deg, #2d3748 0%, #4a5568 100%);
        color: var(--dark-color);
    }
}

/* Print Styles */
@media print {
    .navbar,
    .btn,
    .class-actions,
    .modal {
        display: none !important;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #dee2e6;
    }
    
    .schedule-grid {
        font-size: 0.75rem;
    }
    
    .class-block {
        background: white !important;
        border: 1px solid #ccc;
        color: black !important;
    }
    
    body {
        background-color: white;
        color: black;
    }
}

/* Accessibility Improvements */
.btn:focus,
.form-control:focus,
.form-select:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .card {
        border: 2px solid #000;
    }
    
    .btn {
        border: 2px solid;
    }
    
    .class-block {
        border: 2px solid #000;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .status-indicator i {
        animation: none;
    }
}
