/* Educational Enterprise Final Touches */
/* Professional empty states, consistent messaging, error handling, accessibility */

/* ========================================
   PROFESSIONAL EMPTY STATES
   ======================================== */

/* Global empty state styling */
.empty-state {
    text-align: center;
    padding: 3rem 2rem;
    color: #64748b;
    background: #f8fafc;
    border-radius: 12px;
    border: 2px dashed #e2e8f0;
    margin: 2rem 0;
}

.empty-state-icon {
    font-size: 3rem;
    color: #94a3b8;
    margin-bottom: 1rem;
    display: block;
}

.empty-state h3 {
    color: #475569;
    font-weight: 600;
    margin-bottom: 0.5rem;
    font-size: 1.25rem;
}

.empty-state p {
    color: #64748b;
    margin-bottom: 1.5rem;
    font-size: 1rem;
    line-height: 1.6;
}

.empty-state .btn {
    margin-top: 1rem;
}

/* Specific empty states */
.empty-lessons {
    background: linear-gradient(135deg, #f1f5f9 0%, #f8fafc 100%);
}

.empty-lessons .empty-state-icon {
    color: #1e3a8a;
}

.empty-timetable {
    background: linear-gradient(135deg, #fefcbf 0%, #fef3c7 100%);
}

.empty-timetable .empty-state-icon {
    color: #d97706;
}

.empty-students {
    background: linear-gradient(135deg, #ecfdf5 0%, #f0fdf4 100%);
}

.empty-students .empty-state-icon {
    color: #059669;
}

.empty-notes {
    background: linear-gradient(135deg, #fef7ff 0%, #faf5ff 100%);
}

.empty-notes .empty-state-icon {
    color: #7c3aed;
}

/* ========================================
   CONSISTENT MESSAGING SYSTEM
   ======================================== */

/* Success messages */
.message-success {
    background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
    border: 1px solid #86efac;
    color: #166534;
    padding: 1rem 1.25rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    font-weight: 500;
}

.message-success i {
    color: #059669;
    margin-right: 0.75rem;
    font-size: 1.1rem;
}

/* Info messages */
.message-info {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    border: 1px solid #93c5fd;
    color: #1e40af;
    padding: 1rem 1.25rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    font-weight: 500;
}

.message-info i {
    color: #2563eb;
    margin-right: 0.75rem;
    font-size: 1.1rem;
}

/* Warning messages */
.message-warning {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border: 1px solid #fbbf24;
    color: #92400e;
    padding: 1rem 1.25rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    font-weight: 500;
}

.message-warning i {
    color: #d97706;
    margin-right: 0.75rem;
    font-size: 1.1rem;
}

/* Error messages */
.message-error {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    border: 1px solid #f87171;
    color: #991b1b;
    padding: 1rem 1.25rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    font-weight: 500;
}

.message-error i {
    color: #dc2626;
    margin-right: 0.75rem;
    font-size: 1.1rem;
}

/* ========================================
   ERROR HANDLING REFINEMENT
   ======================================== */

/* Professional error pages */
.error-container {
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2rem;
}

.error-content {
    max-width: 500px;
    margin: 0 auto;
}

.error-code {
    font-size: 6rem;
    font-weight: 700;
    color: #1e3a8a;
    line-height: 1;
    margin-bottom: 1rem;
}

.error-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #475569;
    margin-bottom: 1rem;
}

.error-description {
    color: #64748b;
    margin-bottom: 2rem;
    line-height: 1.6;
}

.error-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* Form validation errors */
.field-error {
    color: #dc2626;
    font-size: 0.875rem;
    margin-top: 0.25rem;
    display: flex;
    align-items: center;
}

.field-error i {
    margin-right: 0.5rem;
    font-size: 0.875rem;
}

.form-control.is-invalid,
.form-select.is-invalid {
    border-color: #dc2626;
    box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.1);
}

.form-control.is-valid,
.form-select.is-valid {
    border-color: #059669;
    box-shadow: 0 0 0 2px rgba(5, 150, 105, 0.1);
}

/* ========================================
   ACCESSIBILITY IMPROVEMENTS
   ======================================== */

/* Screen reader only content */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Skip navigation links */
.skip-nav {
    position: absolute;
    top: -40px;
    left: 6px;
    background: #1e3a8a;
    color: white;
    padding: 8px 16px;
    text-decoration: none;
    border-radius: 4px;
    z-index: 9999;
    font-weight: 600;
}

.skip-nav:focus {
    top: 6px;
    color: white;
}

/* Enhanced focus indicators */
.focus-visible:focus {
    outline: 2px solid #1e3a8a;
    outline-offset: 2px;
}

/* ARIA live regions for dynamic content */
.live-region {
    position: absolute;
    left: -10000px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* High contrast mode improvements */
@media (prefers-contrast: high) {
    .btn {
        border-width: 2px;
    }
    
    .card {
        border-width: 2px;
    }
    
    .empty-state {
        border-width: 3px;
    }
}

/* ========================================
   LOADING STATES REFINEMENT
   ======================================== */

/* Page loading overlay */
.page-loading {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.page-loading-content {
    text-align: center;
    color: #1e3a8a;
}

.page-loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(30, 58, 138, 0.2);
    border-radius: 50%;
    border-top-color: #1e3a8a;
    animation: spin 1s ease-in-out infinite;
    margin: 0 auto 1rem;
}

.page-loading-text {
    font-weight: 600;
    font-size: 1.1rem;
}

/* Button loading states */
.btn-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.8;
}

.btn-loading .btn-text {
    opacity: 0;
}

.btn-loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    margin: auto;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
}

/* ========================================
   PROFESSIONAL TOOLTIPS
   ======================================== */

/* Custom tooltip styling */
.tooltip {
    font-size: 0.875rem;
    font-weight: 500;
}

.tooltip-inner {
    background-color: #1e293b;
    border-radius: 6px;
    padding: 8px 12px;
    max-width: 200px;
}

.tooltip.bs-tooltip-top .tooltip-arrow::before {
    border-top-color: #1e293b;
}

.tooltip.bs-tooltip-bottom .tooltip-arrow::before {
    border-bottom-color: #1e293b;
}

.tooltip.bs-tooltip-start .tooltip-arrow::before {
    border-left-color: #1e293b;
}

.tooltip.bs-tooltip-end .tooltip-arrow::before {
    border-right-color: #1e293b;
}

/* ========================================
   PROFESSIONAL BADGES AND INDICATORS
   ======================================== */

/* Status indicators */
.status-online {
    background: linear-gradient(135deg, #059669 0%, #10b981 100%);
    color: white;
}

.status-offline {
    background: linear-gradient(135deg, #64748b 0%, #94a3b8 100%);
    color: white;
}

.status-pending {
    background: linear-gradient(135deg, #d97706 0%, #f59e0b 100%);
    color: white;
}

.status-error {
    background: linear-gradient(135deg, #dc2626 0%, #ef4444 100%);
    color: white;
}

/* Progress indicators */
.progress-professional {
    height: 8px;
    border-radius: 4px;
    background-color: #e2e8f0;
    overflow: hidden;
}

.progress-professional .progress-bar {
    background: linear-gradient(90deg, #1e3a8a 0%, #2563eb 100%);
    height: 100%;
    border-radius: 4px;
    transition: width 0.6s ease;
}

/* ========================================
   ENTERPRISE POLISH
   ======================================== */

/* Professional shadows */
.shadow-enterprise {
    box-shadow: 0 4px 16px rgba(30, 58, 138, 0.1), 0 2px 8px rgba(0, 0, 0, 0.06);
}

.shadow-enterprise-hover:hover {
    box-shadow: 0 8px 24px rgba(30, 58, 138, 0.15), 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Professional gradients */
.gradient-primary {
    background: linear-gradient(135deg, #1e3a8a 0%, #1d4ed8 100%);
}

.gradient-secondary {
    background: linear-gradient(135deg, #64748b 0%, #94a3b8 100%);
}

.gradient-success {
    background: linear-gradient(135deg, #059669 0%, #10b981 100%);
}

/* Text selection styling */
::selection {
    background-color: rgba(30, 58, 138, 0.2);
    color: #1e3a8a;
}

::-moz-selection {
    background-color: rgba(30, 58, 138, 0.2);
    color: #1e3a8a;
}

/* Scrollbar styling for webkit browsers */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* ========================================
   ANIMATION REFINEMENTS
   ======================================== */

/* Smooth page transitions */
.page-transition {
    animation: fadeInUp 0.4s ease-out;
}

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

/* Stagger animations for lists */
.stagger-animation > * {
    animation: staggerFadeIn 0.5s ease-out backwards;
}

.stagger-animation > *:nth-child(1) { animation-delay: 0.1s; }
.stagger-animation > *:nth-child(2) { animation-delay: 0.2s; }
.stagger-animation > *:nth-child(3) { animation-delay: 0.3s; }
.stagger-animation > *:nth-child(4) { animation-delay: 0.4s; }
.stagger-animation > *:nth-child(5) { animation-delay: 0.5s; }

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

/* Pulse animations for important elements */
.pulse-important {
    animation: pulseImportant 2s infinite;
}

@keyframes pulseImportant {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(30, 58, 138, 0.4);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(30, 58, 138, 0);
    }
}

/* ========================================
   PRINT STYLES
   ======================================== */

@media print {
    .no-print {
        display: none !important;
    }
    
    .page-break {
        page-break-before: always;
    }
    
    .page-break-inside-avoid {
        page-break-inside: avoid;
    }
    
    .print-friendly {
        background: white !important;
        color: black !important;
        box-shadow: none !important;
    }
}