/* --- Ensure mobile nav is always visible and fixed at bottom --- */
#mobile-nav {
  position: fixed !important;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100vw;
  z-index: 9999;
  background: #fff;
  border-top: 1px solid #e5e7eb;
  box-shadow: 0 -2px 8px rgba(0,0,0,0.04);
}

@media (min-width: 1024px) {
  #mobile-nav {
    display: none !important;
  }
}

body {
  padding-bottom: 64px; /* Make space for mobile nav bar */
}

/* Custom scrollbar for a more modern look */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9; /* slate-100 */
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1; /* slate-300 */
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8; /* slate-400 */
}

.input-error {
    border-color: #ef4444; /* red-500 */
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.2);
}

.badge-retry {
    display: inline-block;
    padding: 0.25em 0.6em;
    font-size: 75%;
    font-weight: 700;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    border-radius: 0.375rem;
    background-color: #fee2e2; /* red-100 */
    color: #b91c1c; /* red-800 */
    cursor: pointer;
    margin-left: 0.5rem;
}

.bg-green-100 {
    background-color: #d1fae5 !important;
}
.bg-green-200 {
    background-color: #a7f3d0 !important;
}
.bg-yellow-100 {
    background-color: #fef9c3 !important;
}
.bg-yellow-200 {
    background-color: #fef08a !important;
}

/* Enhanced Toggle Switch Styles for Download Page */
.toggle-switch-container {
    display: inline-flex;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem; /* rounded-xl */
    padding: 0.375rem; /* p-1.5 */
    box-shadow: 
        0 4px 6px -1px rgba(0, 0, 0, 0.1), 
        0 2px 4px -1px rgba(0, 0, 0, 0.06),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    position: relative;
    overflow: hidden;
    gap: 0.5rem; /* gap-2 equivalent */
}

.toggle-switch-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
    pointer-events: none;
}

.toggle-switch-button {
    padding: 0.75rem 1.75rem; /* px-7 py-3 */
    font-size: 0.875rem; /* text-sm */
    font-weight: 600; /* font-semibold */
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    border-radius: 0.5rem; /* rounded-lg */
    border: none;
    outline: none;
    position: relative;
    overflow: hidden;
    white-space: nowrap;
    min-width: 120px;
    text-align: center;
    z-index: 1;
    flex-shrink: 0; /* Prevent buttons from shrinking */
}

.toggle-switch-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: 0.5rem;
}

.toggle-switch-button.active {
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    color: #ffffff;
    box-shadow: 
        0 4px 6px -1px rgba(0, 0, 0, 0.1),
        0 2px 4px -1px rgba(0, 0, 0, 0.06),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    transform: translateY(-1px);
}

.toggle-switch-button.active::before {
    opacity: 0;
}

.toggle-switch-button.inactive {
    background: transparent;
    color: #64748b; /* slate-500 */
    position: relative;
}

.toggle-switch-button.inactive:hover {
    color: #1e293b; /* slate-800 */
    background: rgba(255, 255, 255, 0.5);
    transform: translateY(-1px);
    box-shadow: 0 2px 4px -1px rgba(0, 0, 0, 0.1);
}

.toggle-switch-button.inactive::before {
    opacity: 0;
}

.toggle-switch-button:active {
    transform: translateY(0);
}

/* Ensure gap-2 works properly */
.toggle-switch-container.gap-2 {
    gap: 0.5rem;
}

/* Add subtle animation for tab switching */
@keyframes tabSlideIn {
    from {
        opacity: 0;
        transform: translateY(4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.toggle-switch-button {
    animation: tabSlideIn 0.3s ease-out;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .toggle-switch-container {
        padding: 0.25rem;
        border-radius: 0.5rem;
        width: 100%;
        justify-content: center;
    }
    
    .toggle-switch-button {
        padding: 0.625rem 1.25rem;
        font-size: 0.8125rem;
        min-width: 100px;
        flex: 1;
    }
}

/* Additional enhancements for better visual hierarchy */
.toggle-switch-container {
    margin-bottom: 1rem;
}

/* Focus states for accessibility */
.toggle-switch-button:focus-visible {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* Improved hover states */
.toggle-switch-button.inactive:hover {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(8px);
}

/* Active state improvements */
.toggle-switch-button.active {
    position: relative;
}

.toggle-switch-button.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 2px;
    background: linear-gradient(90deg, #3b82f6, #1d4ed8);
    border-radius: 1px;
}

/* Smooth content transitions */
.tab-content {
    transition: opacity 0.3s ease-in-out, transform 0.3s ease-in-out;
}

.tab-content[style*="display: none"] {
    opacity: 0;
    transform: translateY(10px);
}

.tab-content:not([style*="display: none"]) {
    opacity: 1;
    transform: translateY(0);
}

/* Animation for modern modals */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

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

/* Toast notification animations */
#lms-toast {
    animation: slideInRight 0.3s ease-out;
}

#lms-toast.opacity-0 {
    animation: slideOutRight 0.3s ease-out;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* Existing file info styles for paper edit modal */
.existing-file-info {
    background-color: #f0fdf4 !important; /* green-50 */
    border: 1px solid #bbf7d0 !important; /* green-200 */
    border-radius: 0.375rem;
    padding: 0.5rem 0.75rem;
    margin-bottom: 0.5rem;
    margin-top: 0.25rem;
    transition: all 0.2s ease-in-out;
}

.existing-file-info .file-download-link {
    color: #059669; /* green-600 */
    font-size: 0.95em;
    font-weight: 500;
    text-decoration: underline;
    word-break: break-all;
}
.existing-file-info .file-download-link:hover {
    color: #166534; /* green-800 */
    text-decoration: underline;
}

.existing-file-info .text-green-600 {
    color: #059669 !important; /* green-600 */
}

.existing-file-info .text-green-800 {
    color: #166534 !important; /* green-800 */
}

.existing-file-info .text-gray-500 {
    color: #6b7280 !important; /* gray-500 */
}

.existing-file-info .text-gray-400 {
    color: #9ca3af !important; /* gray-400 */
}

.existing-file-info .mb-1 {
    margin-bottom: 0.25rem !important;
}
.existing-file-info .mb-2 {
    margin-bottom: 0.5rem !important;
}

.file-view-link {
    display: inline-flex;
    align-items: center;
    gap: 0.18rem;
    background: none;
    border: none;
    padding: 0.08rem 0.08rem;
    margin-left: 0.5rem;
    color: #e11d48;
    font-size: 12px;
    border-radius: 0.25rem;
    cursor: pointer;
    transition: background 0.15s, box-shadow 0.15s, color 0.15s;
}
.file-view-link:hover {
    background: none;
    color: #b91c1c;
}
.file-view-link .file-icon {
    width: 18px;
    height: 18px;
    display: inline-block;
    vertical-align: middle;
    margin-right: 0px;
    transition: filter 0.15s, background 0.15s;
    filter: drop-shadow(0 1px 1px rgba(225,29,72,0.08));
    /* Add circle background */
    background: #fee2e2;
    border-radius: 50%;
    padding: 3px;
    box-sizing: content-box;
    box-shadow: 0 1px 4px 0 rgba(225,29,72,0.07);
}
.file-view-link:hover .file-icon {
    background: #fecaca;
    filter: drop-shadow(0 2px 4px rgba(225,29,72,0.18));
}

/* Remove .file-view-label style if not needed */
.file-view-label { display: none; }

/* Remove old .file-view-btn style if not needed */
.file-view-btn { display: none; } 

.file-delete-btn {
    background: none;
    border: none;
    padding: 0;
    margin-left: 0.2rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    border-radius: 50%;
    transition: background 0.15s;
}
.file-delete-btn .w-4 {
    background: #fee2e2; /* light red */
    border-radius: 50%;
    padding: 3px;
    transition: background 0.15s;
}
.file-delete-btn:hover .w-4 {
    background: #fecaca; /* darker on hover */
}

.delete-icon-bg {
    background: #fee2e2;
    border-radius: 50%;
    padding: 4px;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}
.file-delete-btn:hover .delete-icon-bg {
    background: #fecaca;
}
.delete-icon-bg svg {
    width: 16px;
    height: 16px;
}

/* Modal confirmation dialog improvements */
#lms-confirm-modal {
    backdrop-filter: blur(4px);
    background-color: rgba(0, 0, 0, 0.5);
}

/* Payment Modal Improvements */
#payment-modal,
#group-payment-modal {
    backdrop-filter: blur(4px);
    background-color: rgba(0, 0, 0, 0.5);
}

#payment-modal .bg-white,
#group-payment-modal .bg-white {
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Ensure modal content scrolls properly on mobile */
@media (max-height: 600px) {
    #payment-modal .bg-white,
    #group-payment-modal .bg-white {
        max-height: 95vh;
    }
}

/* Custom scrollbar for payment modals */
#payment-modal .overflow-y-auto::-webkit-scrollbar,
#group-payment-modal .overflow-y-auto::-webkit-scrollbar {
    width: 6px;
}

#payment-modal .overflow-y-auto::-webkit-scrollbar-track,
#group-payment-modal .overflow-y-auto::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 3px;
}

#payment-modal .overflow-y-auto::-webkit-scrollbar-thumb,
#group-payment-modal .overflow-y-auto::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

#payment-modal .overflow-y-auto::-webkit-scrollbar-thumb:hover,
#group-payment-modal .overflow-y-auto::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

#lms-confirm-modal .bg-white {
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Improved button styles for confirmation dialogs */
#lms-confirm-ok {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    transition: all 0.2s ease-in-out;
}

#lms-confirm-ok:hover {
    background: linear-gradient(135deg, #b91c1c 0%, #991b1b 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
}

#lms-confirm-cancel {
    transition: all 0.2s ease-in-out;
}

#lms-confirm-cancel:hover {
    background-color: #e5e7eb;
    transform: translateY(-1px);
}

/* Syllabus file display styles */
/* .existing-syllabus-file-info {
    transition: all 0.2s ease-in-out;
}

.existing-syllabus-file-info:hover {
    transform: translateY(-1px);
} */

.syllabus-file-delete-btn {
    transition: all 0.2s ease-in-out;
}

/* .syllabus-file-delete-btn:hover {
    transform: scale(1.1);
} */

/* Price badge spacing for topic cards */
.bg-yellow-100.ml-2, .bg-green-100.ml-2 {
    margin-left: 0.5rem;
}

.slip-modal-body::-webkit-scrollbar {
    width: 8px;
}

.slip-modal-body::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.slip-modal-body::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 10px;
}

.slip-modal-body::-webkit-scrollbar-thumb:hover {
    background: #555;
}

#slip-modal .bg-white {
    max-height: 90vh;
}

.nav-link-mobile.active {
    color: #3B82F6; /* blue-500 */
}

@media (max-width: 767px) {
    .class-type-toggle {
        display: flex;
        width: 100%;
    }

    .class-type-toggle button {
        flex-grow: 1;
        text-align: center;
    }
}

.zoom-controls {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 1001;
    display: flex;
    gap: 10px;
}

@media (max-width: 1023px) {
  .hide-on-mobile {
    display: none;
  }
}

/* Hide supportive videos elements below pagination on mobile view in lessons page */
@media (max-width: 767px) {
  #supportive-videos-list,
  #supportive-videos-pagination {
    display: none !important;
  }
}

/* Modal Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(-10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

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

/* Modal Backdrop */
#lms-confirm-modal,
#lms-prompt-modal {
    backdrop-filter: blur(4px);
}

/* Modal Content Styling */
#lms-confirm-modal .bg-white,
#lms-prompt-modal .bg-white {
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Button Hover Effects */
#lms-confirm-modal button,
#lms-prompt-modal button {
    transition: all 0.2s ease-in-out;
}

#lms-confirm-modal button:hover,
#lms-prompt-modal button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Input Focus Effects */
#lms-prompt-input:focus {
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    border-color: #3b82f6;
}

/* Icon Animations */
#lms-confirm-modal svg,
#lms-prompt-modal svg {
    transition: transform 0.2s ease-in-out;
}

#lms-confirm-modal:hover svg,
#lms-prompt-modal:hover svg {
    transform: scale(1.1);
}