/* =========================================================================
   LuxLMS Design System
   Modern, elegant styles for the new LMS shell
   ========================================================================= */

/* ---- Dark Mode ---- */
.dark body {
    background-color: #111827;
    color: #f3f4f6;
}
.dark .card {
    background-color: #1f2937;
    border-color: #374151;
}
.dark .card-header {
    border-color: #374151;
}
.dark input, .dark textarea, .dark select {
    background-color: #1f2937;
    border-color: #4b5563;
    color: #f3f4f6;
}
.dark input::placeholder, .dark textarea::placeholder {
    color: #6b7280;
}
.dark .alert-success { background-color: rgba(22, 163, 74, 0.1); border-color: rgba(22, 163, 74, 0.3); color: #86efac; }
.dark .alert-error   { background-color: rgba(220, 38, 38, 0.1); border-color: rgba(220, 38, 38, 0.3); color: #fca5a5; }
.dark .alert-warning { background-color: rgba(234, 179, 8, 0.1); border-color: rgba(234, 179, 8, 0.3); color: #fde68a; }
.dark .alert-info    { background-color: rgba(59, 130, 246, 0.1); border-color: rgba(59, 130, 246, 0.3); color: #93c5fd; }

/* ---- Custom Scrollbar ---- */
.lux-scrollbar::-webkit-scrollbar {
    width: 6px;
}
.lux-scrollbar::-webkit-scrollbar-track {
    background: transparent;
}
.lux-scrollbar::-webkit-scrollbar-thumb {
    background-color: rgba(156, 163, 175, 0.3);
    border-radius: 3px;
}
.lux-scrollbar::-webkit-scrollbar-thumb:hover {
    background-color: rgba(156, 163, 175, 0.5);
}
.dark .lux-scrollbar::-webkit-scrollbar-thumb {
    background-color: rgba(75, 85, 99, 0.5);
}

/* ---- Mobile Navigation ---- */
.lux-nav-link {
    display: flex;
    align-items: center;
    padding: 0.625rem 0.75rem;
    border-radius: 0.75rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #4b5563;
    transition: all 0.15s ease;
}
.lux-nav-link:hover {
    background-color: #f3f4f6;
    color: #111827;
}
.dark .lux-nav-link {
    color: #9ca3af;
}
.dark .lux-nav-link:hover {
    background-color: rgba(55, 65, 81, 0.5);
    color: #e5e7eb;
}
.lux-nav-link-active {
    background-color: #eff6ff; /* blue-50 */
    color: #1d4ed8; /* blue-700 */
}
.lux-nav-link-active:hover {
    background-color: #eff6ff;
    color: #1d4ed8;
}
.dark .lux-nav-link-active {
    background-color: rgba(30, 58, 138, 0.3); /* blue-900/30 */
    color: #93c5fd; /* blue-300 */
}
.dark .lux-nav-link-active:hover {
    background-color: rgba(30, 58, 138, 0.3);
    color: #93c5fd;
}
.lux-nav-link-active i {
    color: #2563eb; /* blue-600 */
}
.dark .lux-nav-link-active i {
    color: #60a5fa; /* blue-400 */
}

/* ---- Mobile Tab Bar ---- */
.lux-tab-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    padding: 0.375rem 0;
    color: #9ca3af;
    transition: color 0.15s ease;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
}
.lux-tab-item:hover,
.lux-tab-active {
    color: #3b82f6;
}
.dark .lux-tab-item {
    color: #6b7280;
}
.dark .lux-tab-item:hover,
.dark .lux-tab-active {
    color: #60a5fa;
}

/* Safe area for mobile bottom bar */
.safe-area-bottom {
    padding-bottom: env(safe-area-inset-bottom, 0px);
}

/* Give main content enough bottom padding on mobile for tab bar */
@media (max-width: 1023px) {
    main {
        padding-bottom: 5rem;
    }
}

/* ---- LuxLMS Card Variants ---- */
.lux-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 1rem;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.03);
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}
.lux-card:hover {
    box-shadow: 0 4px 12px -2px rgba(0, 0, 0, 0.08);
}
.dark .lux-card {
    background: #1f2937;
    border-color: #374151;
}
.dark .lux-card:hover {
    box-shadow: 0 4px 12px -2px rgba(0, 0, 0, 0.3);
}

/* ---- Stat Card ---- */
.lux-stat-card {
    padding: 1.5rem;
    border-radius: 1rem;
    background: white;
    border: 1px solid #e5e7eb;
}
.dark .lux-stat-card {
    background: #1f2937;
    border-color: #374151;
}
.lux-stat-value {
    font-size: 1.875rem;
    font-weight: 700;
    line-height: 1.2;
    color: #111827;
}
.dark .lux-stat-value {
    color: #f9fafb;
}
.lux-stat-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: #6b7280;
    margin-top: 0.25rem;
}
.dark .lux-stat-label {
    color: #9ca3af;
}

/* ---- Progress Ring ---- */
.lux-progress-ring {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.lux-progress-ring svg {
    transform: rotate(-90deg);
}
.lux-progress-ring .progress-text {
    position: absolute;
    font-size: 0.75rem;
    font-weight: 700;
    color: #111827;
}
.dark .lux-progress-ring .progress-text {
    color: #f9fafb;
}

/* ---- Course Card ---- */
.lux-course-card {
    border-radius: 1rem;
    overflow: hidden;
    background: white;
    border: 1px solid #e5e7eb;
    transition: all 0.2s ease;
}
.lux-course-card:hover {
    box-shadow: 0 8px 25px -5px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}
.dark .lux-course-card {
    background: #1f2937;
    border-color: #374151;
}
.lux-course-card .course-thumbnail {
    aspect-ratio: 16 / 9;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    position: relative;
    overflow: hidden;
}
.lux-course-card .course-body {
    padding: 1.25rem;
}
.lux-course-card .course-title {
    font-size: 1rem;
    font-weight: 600;
    color: #111827;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.dark .lux-course-card .course-title {
    color: #f3f4f6;
}

/* ---- Badge ---- */
.lux-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.125rem 0.625rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
}
.lux-badge-blue   { background: #eff6ff; color: #1e40af; }
.lux-badge-green  { background: #f0fdf4; color: #166534; }
.lux-badge-yellow { background: #fefce8; color: #854d0e; }
.lux-badge-red    { background: #fef2f2; color: #991b1b; }
.lux-badge-gray   { background: #f3f4f6; color: #374151; }
.lux-badge-purple { background: #faf5ff; color: #6b21a8; }

.dark .lux-badge-blue   { background: rgba(59, 130, 246, 0.15); color: #93c5fd; }
.dark .lux-badge-green  { background: rgba(34, 197, 94, 0.15); color: #86efac; }
.dark .lux-badge-yellow { background: rgba(234, 179, 8, 0.15); color: #fde68a; }
.dark .lux-badge-red    { background: rgba(239, 68, 68, 0.15); color: #fca5a5; }
.dark .lux-badge-gray   { background: rgba(107, 114, 128, 0.15); color: #d1d5db; }
.dark .lux-badge-purple { background: rgba(168, 85, 247, 0.15); color: #d8b4fe; }

/* ---- Button Refinements ---- */
.lux-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    border-radius: 0.75rem;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.15s ease;
    cursor: pointer;
    border: none;
    outline: none;
}
.lux-btn:focus-visible {
    box-shadow: 0 0 0 2px white, 0 0 0 4px #3b82f6;
}
.lux-btn-primary {
    background: #3b82f6;
    color: white;
    box-shadow: 0 1px 2px rgba(59, 130, 246, 0.3);
}
.lux-btn-primary:hover {
    background: #2563eb;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.35);
}
.lux-btn-secondary {
    background: white;
    color: #374151;
    border: 1px solid #d1d5db;
}
.lux-btn-secondary:hover {
    background: #f9fafb;
    border-color: #9ca3af;
}
.dark .lux-btn-secondary {
    background: #374151;
    color: #e5e7eb;
    border-color: #4b5563;
}
.dark .lux-btn-secondary:hover {
    background: #4b5563;
}
.lux-btn-ghost {
    background: transparent;
    color: #6b7280;
}
.lux-btn-ghost:hover {
    background: #f3f4f6;
    color: #111827;
}
.dark .lux-btn-ghost {
    color: #9ca3af;
}
.dark .lux-btn-ghost:hover {
    background: #374151;
    color: #e5e7eb;
}

/* ---- Empty State ---- */
.lux-empty-state {
    text-align: center;
    padding: 3rem 1rem;
}
.lux-empty-state .empty-icon {
    width: 4rem;
    height: 4rem;
    margin: 0 auto 1rem;
    color: #d1d5db;
}
.dark .lux-empty-state .empty-icon {
    color: #4b5563;
}
.lux-empty-state .empty-title {
    font-size: 1rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.5rem;
}
.dark .lux-empty-state .empty-title {
    color: #e5e7eb;
}
.lux-empty-state .empty-description {
    font-size: 0.875rem;
    color: #9ca3af;
    margin-bottom: 1.5rem;
}

/* ---- Continue Learning Card ---- */
.lux-continue-card {
    position: relative;
    overflow: hidden;
    border-radius: 1rem;
    background: linear-gradient(135deg, #1e40af 0%, #3b82f6 50%, #60a5fa 100%);
    color: white;
    padding: 1.5rem;
}
.lux-continue-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 60%;
    height: 200%;
    background: rgba(255, 255, 255, 0.05);
    transform: rotate(15deg);
    pointer-events: none;
}

/* ---- Animations ---- */
@keyframes lux-fade-in {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}
.lux-animate-in {
    animation: lux-fade-in 0.3s ease forwards;
}

/* Staggered children animation */
.lux-stagger > * {
    opacity: 0;
    animation: lux-fade-in 0.3s ease forwards;
}
.lux-stagger > *:nth-child(1) { animation-delay: 0.05s; }
.lux-stagger > *:nth-child(2) { animation-delay: 0.1s; }
.lux-stagger > *:nth-child(3) { animation-delay: 0.15s; }
.lux-stagger > *:nth-child(4) { animation-delay: 0.2s; }
.lux-stagger > *:nth-child(5) { animation-delay: 0.25s; }
.lux-stagger > *:nth-child(6) { animation-delay: 0.3s; }

/* ---- Focus Styles (Accessibility) ---- */
*:focus-visible {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
    border-radius: 4px;
}

/* ---- Prose Dark Mode ---- */
.dark .prose { color: #d1d5db; }
.dark .prose h1, .dark .prose h2, .dark .prose h3, .dark .prose h4 { color: #f3f4f6; }
.dark .prose a { color: #60a5fa; }
.dark .prose strong { color: #f9fafb; }
.dark .prose code { color: #e5e7eb; background: rgba(55, 65, 81, 0.5); }
.dark .prose blockquote { border-color: #4b5563; color: #9ca3af; }
.dark .prose hr { border-color: #374151; }
.dark .prose thead th { color: #e5e7eb; border-color: #4b5563; }
.dark .prose tbody td { border-color: #374151; }
.dark .prose li::marker { color: #6b7280; }

/* ---- Course Player Layout ---- */
.lux-player-layout {
    display: flex;
    height: calc(100vh - 4rem);
}
.lux-player-sidebar {
    width: 300px;
    flex-shrink: 0;
    overflow-y: auto;
    border-right: 1px solid #e5e7eb;
    background: white;
}
.dark .lux-player-sidebar {
    border-color: #374151;
    background: #1f2937;
}
.lux-player-content {
    flex: 1;
    overflow-y: auto;
}
@media (max-width: 1023px) {
    .lux-player-layout {
        flex-direction: column;
        height: auto;
    }
    .lux-player-sidebar {
        width: 100%;
        max-height: none;
        border-right: none;
        border-bottom: 1px solid #e5e7eb;
    }
    .dark .lux-player-sidebar {
        border-bottom-color: #374151;
    }
}

/* ---- Line Clamp Utilities ---- */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ---- Course Grid/List Toggle ---- */
.lux-course-list-item {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    padding: 1.25rem;
    border-bottom: 1px solid #e5e7eb;
    transition: background-color 0.15s ease;
}
.lux-course-list-item:hover {
    background-color: #f9fafb;
}
.dark .lux-course-list-item {
    border-color: #374151;
}
.dark .lux-course-list-item:hover {
    background-color: rgba(55, 65, 81, 0.3);
}
.lux-course-list-item .course-thumb {
    width: 120px;
    height: 68px;
    border-radius: 0.5rem;
    flex-shrink: 0;
    object-fit: cover;
}

/* ---- Success/Green Button ---- */
.lux-btn-success {
    background: #16a34a;
    color: white;
    box-shadow: 0 1px 2px rgba(22, 163, 74, 0.3);
}
.lux-btn-success:hover {
    background: #15803d;
    box-shadow: 0 4px 12px rgba(22, 163, 74, 0.35);
}
.lux-btn-success:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ---- Lesson Player Item ---- */
.lux-lesson-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    transition: background-color 0.15s ease;
    text-decoration: none;
    color: inherit;
    border-left: 3px solid transparent;
}
.lux-lesson-item:hover {
    background-color: #f3f4f6;
}
.dark .lux-lesson-item:hover {
    background-color: rgba(55, 65, 81, 0.3);
}
.lux-lesson-item.active {
    background-color: #eff6ff;
    border-left-color: #3b82f6;
}
.dark .lux-lesson-item.active {
    background-color: rgba(59, 130, 246, 0.1);
    border-left-color: #60a5fa;
}
.lux-lesson-item.locked {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ---- Event Card ---- */
.lux-event-card {
    position: relative;
    border-radius: 1rem;
    overflow: hidden;
    background: white;
    border: 1px solid #e5e7eb;
    transition: all 0.2s ease;
}
.lux-event-card:hover {
    box-shadow: 0 8px 25px -5px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}
.dark .lux-event-card {
    background: #1f2937;
    border-color: #374151;
}

/* Event date badge */
.lux-event-date-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 0.75rem;
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
}
.dark .lux-event-date-badge {
    background: #374151;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}
.lux-event-date-badge .month {
    font-size: 0.625rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #3b82f6;
    line-height: 1;
}
.lux-event-date-badge .day {
    font-size: 1.25rem;
    font-weight: 700;
    color: #111827;
    line-height: 1.2;
}
.dark .lux-event-date-badge .day {
    color: #f9fafb;
}

/* ---- Status Dot ---- */
.lux-status-dot {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 9999px;
    display: inline-block;
    flex-shrink: 0;
}
.lux-status-dot-green { background: #22c55e; }
.lux-status-dot-yellow { background: #eab308; }
.lux-status-dot-blue { background: #3b82f6; }
.lux-status-dot-red { background: #ef4444; }
.lux-status-dot-gray { background: #9ca3af; }

/* ---- Check-in Animation ---- */
@keyframes lux-checkin-pop {
    0% { transform: scale(0.8); opacity: 0; }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}
.lux-checkin-success {
    animation: lux-checkin-pop 0.4s ease-out forwards;
}

/* ---- Danger Button ---- */
.lux-btn-danger {
    background: #ef4444;
    color: white;
    box-shadow: 0 1px 2px rgba(239, 68, 68, 0.3);
}
.lux-btn-danger:hover {
    background: #dc2626;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.35);
}

/* ---- Warning Button ---- */
.lux-btn-warning {
    background: #f59e0b;
    color: white;
    box-shadow: 0 1px 2px rgba(245, 158, 11, 0.3);
}
.lux-btn-warning:hover {
    background: #d97706;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.35);
}

/* ---- Form Input Styles (for Lux forms) ---- */
.lux-input {
    display: block;
    width: 100%;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    line-height: 1.5;
    color: #111827;
    background: white;
    border: 1px solid #d1d5db;
    border-radius: 0.75rem;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.lux-input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
    outline: none;
}
.lux-input.lux-input-icon {
    padding-left: 2.5rem;
}
.lux-input::placeholder {
    color: #9ca3af;
}
.dark .lux-input {
    background: #1f2937;
    border-color: #4b5563;
    color: #f3f4f6;
}
.dark .lux-input:focus {
    border-color: #60a5fa;
    box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.15);
}
.dark .lux-input::placeholder {
    color: #6b7280;
}
.lux-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.375rem;
}
.dark .lux-label {
    color: #d1d5db;
}
.lux-checkbox {
    width: 1rem;
    height: 1rem;
    border-radius: 0.25rem;
    border: 1px solid #d1d5db;
    color: #3b82f6;
}
.dark .lux-checkbox {
    background: #1f2937;
    border-color: #4b5563;
}

/* ---- Quill Rich Text Editor ---- */
.ql-toolbar.ql-snow {
    border: none !important;
    border-bottom: 1px solid #e5e7eb !important;
    background: #f9fafb;
    border-radius: 0.75rem 0.75rem 0 0;
}
.ql-container.ql-snow {
    border: none !important;
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 0.875rem;
}
.ql-editor {
    min-height: 120px;
    padding: 1rem 1.25rem;
    line-height: 1.6;
}
.ql-editor.ql-blank::before {
    font-style: normal;
    color: #9ca3af;
}
.dark .ql-toolbar.ql-snow {
    border-bottom-color: #4b5563 !important;
    background: #1f2937;
}
.dark .ql-toolbar .ql-stroke {
    stroke: #9ca3af;
}
.dark .ql-toolbar .ql-fill {
    fill: #9ca3af;
}
.dark .ql-toolbar .ql-picker-label {
    color: #9ca3af;
}
.dark .ql-toolbar button:hover .ql-stroke,
.dark .ql-toolbar .ql-picker-label:hover .ql-stroke {
    stroke: #f3f4f6;
}
.dark .ql-toolbar button:hover .ql-fill,
.dark .ql-toolbar .ql-picker-label:hover .ql-fill {
    fill: #f3f4f6;
}
.dark .ql-toolbar button.ql-active .ql-stroke {
    stroke: #60a5fa;
}
.dark .ql-toolbar button.ql-active .ql-fill {
    fill: #60a5fa;
}
.dark .ql-editor {
    color: #f3f4f6;
}
.dark .ql-editor.ql-blank::before {
    color: #6b7280;
}
.dark .ql-picker-options {
    background: #1f2937 !important;
    border-color: #4b5563 !important;
}
.dark .ql-picker-item {
    color: #d1d5db !important;
}
.dark .ql-picker-item:hover {
    color: #f3f4f6 !important;
}

/* ---- Print Styles ---- */
@media print {
    nav, aside, .lux-tab-item, button { display: none !important; }
    main { margin: 0 !important; padding: 0 !important; }
}
