/* Sidebar dynamic layout transitions */
.main-content-wrapper {
    transition: margin-left 0.3s ease-in-out;
}

/* Base style for spacing div when Sidebar is open (Default Desktop) */
.sidebar-spacer {
    width: 18rem;
    /* 72 units */
    transition: width 0.3s ease-in-out;
    flex-shrink: 0;
}

/* Collapsed state */
.sidebar-spacer.collapsed {
    width: 4rem;
    /* 16 units */
}

/* Hide on mobile */
@media (max-width: 1023px) {
    .sidebar-spacer {
        display: none !important;
        width: 0 !important;
    }
}


/* Scrollbar Styling */
.scrollbar-thin {
    scrollbar-width: thin;
}

.scrollbar-thumb-slate-600 {
    scrollbar-color: #475569 transparent;
}

.scrollbar-track-transparent {
    scrollbar-track-color: transparent;
}

/* Webkit Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #475569;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #64748b;
}

/* Dark mode scrollbar */
.dark ::-webkit-scrollbar-thumb {
    background: #64748b;
}

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

/* Custom Animations */
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideInLeft {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

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

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

/* Animation Classes */
.animate-slide-in-right {
    animation: slideInRight 0.3s ease-out;
}

.animate-slide-in-left {
    animation: slideInLeft 0.3s ease-out;
}

.animate-fade-in-up {
    animation: fadeInUp 0.3s ease-out;
}

.animate-pulse {
    animation: pulse 2s infinite;
}

/* Glass Effect */
.glass-effect {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.dark .glass-effect {
    background: rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Gradient Backgrounds */
.gradient-primary {
    background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 50%, #6366f1 100%);
}

.gradient-secondary {
    background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 50%, #6366f1 100%);
}

.gradient-success {
    background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 50%, #6366f1 100%);
}

.gradient-warning {
    background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 50%, #6366f1 100%);
}

.gradient-danger {
    background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 50%, #6366f1 100%);
}

/* Card Hover Effects */
.card-hover {
    transition: all 0.3s ease;
}

.card-hover:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.dark .card-hover:hover {
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.3), 0 10px 10px -5px rgba(0, 0, 0, 0.2);
}

/* Button Styles */
.btn-primary {
    @apply bg-blue-600 hover:bg-blue-700 text-white font-medium py-2 px-4 rounded-lg transition-colors duration-200;
}

.btn-secondary {
    @apply bg-gray-200 hover:bg-gray-300 text-gray-800 font-medium py-2 px-4 rounded-lg transition-colors duration-200;
}

.dark .btn-secondary {
    @apply bg-gray-700 hover:bg-gray-600 text-gray-200;
}

.btn-success {
    @apply bg-green-600 hover:bg-green-700 text-white font-medium py-2 px-4 rounded-lg transition-colors duration-200;
}

.btn-warning {
    @apply bg-yellow-600 hover:bg-yellow-700 text-white font-medium py-2 px-4 rounded-lg transition-colors duration-200;
}

.btn-danger {
    @apply bg-red-600 hover:bg-red-700 text-white font-medium py-2 px-4 rounded-lg transition-colors duration-200;
}

/* Form Styles */
.form-input {
    @apply w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-transparent transition-all duration-200;
}

.dark .form-input {
    @apply bg-gray-700 border-gray-600 text-white;
}

.form-label {
    @apply block text-sm font-medium text-gray-700 mb-2;
}

.dark .form-label {
    @apply text-gray-300;
}

/* Loading States */
.loading {
    position: relative;
    overflow: hidden;
}

.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        left: -100%;
    }

    100% {
        left: 100%;
    }
}

/* Notification Styles */
.notification {
    @apply fixed top-4 right-4 z-50 max-w-sm w-full bg-white border border-gray-200 rounded-lg shadow-lg p-4;
    animation: slideInRight 0.3s ease-out;
}

.dark .notification {
    @apply bg-gray-800 border-gray-700;
}

.notification.success {
    @apply border-green-500 bg-green-50;
}

.dark .notification.success {
    @apply bg-green-900 border-green-600;
}

.notification.error {
    @apply border-red-500 bg-red-50;
}

.dark .notification.error {
    @apply bg-red-900 border-red-600;
}

.notification.warning {
    @apply border-yellow-500 bg-yellow-50;
}

.dark .notification.warning {
    @apply bg-yellow-900 border-yellow-600;
}

/* Responsive Utilities */
@media (max-width: 768px) {
    .mobile-hidden {
        display: none;
    }

    .mobile-full {
        width: 100%;
    }
}

/* Print Styles */
@media print {
    .no-print {
        display: none !important;
    }

    .print-break {
        page-break-after: always;
    }

    .print-break-inside {
        page-break-inside: avoid;
    }
}

/* Accessibility */
.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;
}

/* Focus Styles */
.focus-visible:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .card-hover:hover {
        border: 2px solid currentColor;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Online Learning Page Specific Styles */
.online-learning-container {
    margin-top: 20px;
}

.online-learning-header,
.bg-gradient-to-r.from-blue-600.via-purple-600.to-indigo-600.online-learning-header {
    background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 50%, #6366f1 100%) !important;
    background-image: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 50%, #6366f1 100%) !important;
    color: white !important;
}

.online-learning-title,
.online-learning-header .online-learning-title,
.online-learning-header h1 {
    color: white !important;
    font-size: 2rem !important;
}

.online-learning-subtitle,
.online-learning-header .online-learning-subtitle,
.online-learning-header p {
    color: rgba(219, 234, 254, 1) !important;
}

/* Force override any Tailwind background utilities */
.online-learning-header * {
    color: inherit !important;
}

/* Documents Page Specific Styles */
.documents-container {
    margin-top: 20px;
}

.documents-header,
.bg-gradient-to-r.from-emerald-600.via-teal-600.to-cyan-600.documents-header {
    background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 50%, #6366f1 100%) !important;
    background-image: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 50%, #6366f1 100%) !important;
    color: white !important;
}

.documents-title,
.documents-header .documents-title,
.documents-header h1 {
    color: white !important;
    font-size: 2rem !important;
}

.documents-subtitle,
.documents-header .documents-subtitle,
.documents-header p {
    color: rgba(219, 234, 254, 1) !important;
}

/* Force override any Tailwind background utilities */
.documents-header * {
    color: inherit !important;
}

/* Custom Orange Color Palette for Tailwind CSS v2 */
.bg-orange-50 { background-color: #fff7ed !important; }
.bg-orange-100 { background-color: #ffedd5 !important; }
.bg-orange-500 { background-color: #f97316 !important; }
.bg-orange-600 { background-color: #ea580c !important; }
.hover\:bg-orange-700:hover { background-color: #c2410c !important; }
.text-orange-500 { color: #f97316 !important; }
.text-orange-600 { color: #ea580c !important; }
.text-orange-700 { color: #c2410c !important; }
.border-orange-200 { border-color: #fed7aa !important; }
/* ============================================================
   Toggle switches
   Tailwind 2.2.19 (CDN) does not generate the peer-checked:* or
   after:* utilities these switches rely on, so the knob and the
   "on" state never render. Recreate them with plain CSS keyed off
   the existing markup (input.sr-only.peer + div.w-11.h-6 ...).
   ============================================================ */
input.sr-only.peer + .w-11.h-6 {
    position: relative;
    transition: background-color 0.2s ease;
}
input.sr-only.peer + .w-11.h-6::after {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    height: 1.25rem;
    width: 1.25rem;
    background: #ffffff;
    border: 1px solid #d1d5db;
    border-radius: 9999px;
    transition: all 0.2s ease;
}
input.sr-only.peer:checked + .w-11.h-6::after {
    transform: translateX(1.25rem);
    border-color: #ffffff;
}
/* Activate the checked track colour the markup already declares */
input.sr-only.peer:checked + .peer-checked\:bg-blue-600   { background-color: #2563eb !important; }
input.sr-only.peer:checked + .peer-checked\:bg-green-600  { background-color: #16a34a !important; }
input.sr-only.peer:checked + .peer-checked\:bg-orange-500 { background-color: #f97316 !important; }
input.sr-only.peer:checked + .peer-checked\:bg-indigo-600 { background-color: #4f46e5 !important; }
input.sr-only.peer:checked + .peer-checked\:bg-purple-600 { background-color: #9333ea !important; }
/* Focus ring for keyboard users */
input.sr-only.peer:focus-visible + .w-11.h-6 {
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.35);
}
