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

/* ---- Self-hosted Inter Font ---- */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url('/static/fonts/inter-variable-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ---- Dark Mode Transition ---- */
/* Applied briefly during theme toggle for a smooth crossfade, then removed
   so normal interactions aren't slowed by background-color transitions. */
.theme-transitioning,
.theme-transitioning *,
.theme-transitioning *::before,
.theme-transitioning *::after {
    transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease, box-shadow 0.3s ease, fill 0.3s ease, stroke 0.3s ease !important;
}

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

/* Hide scrollbar but keep scrollability */
.scrollbar-hide {
    -ms-overflow-style: none;
    scrollbar-width: none;
}
.scrollbar-hide::-webkit-scrollbar {
    display: none;
}

/* ---- 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: var(--org-primary-light, #eff6ff);
    color: var(--org-primary-hover, #1d4ed8);
}
.lux-nav-link-active:hover {
    background-color: var(--org-primary-light, #eff6ff);
    color: var(--org-primary-hover, #1d4ed8);
}
.dark .lux-nav-link-active {
    background-color: var(--org-primary-ring, rgba(59, 130, 246, 0.15));
    color: var(--org-primary-light, #93c5fd);
}
.dark .lux-nav-link-active:hover {
    background-color: var(--org-primary-ring, rgba(59, 130, 246, 0.15));
    color: var(--org-primary-light, #93c5fd);
}
.lux-nav-link-active i {
    color: var(--org-primary, #2563eb);
}
.dark .lux-nav-link-active i {
    color: var(--org-primary-light, #60a5fa);
}
.lux-nav-icon-active {
    color: var(--org-primary, #2563eb);
}
.dark .lux-nav-icon-active {
    color: var(--org-primary-light, #60a5fa);
}
.lux-nav-dot-active {
    background-color: var(--org-primary, #3b82f6);
}
.dark .lux-nav-dot-active {
    background-color: var(--org-primary-light, #60a5fa);
}

/* ---- 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: var(--org-primary, #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 3px 0 rgba(0, 0, 0, 0.05), 0 1px 2px -1px rgba(0, 0, 0, 0.05);
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 0.25s cubic-bezier(0.4, 0, 0.2, 1),
                border-color 0.25s ease;
    -webkit-transform: translateZ(0);
    will-change: transform;
}
.lux-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.06), 0 12px 24px -4px rgba(0,0,0,0.1), 0 24px 48px -8px rgba(0,0,0,0.06);
    border-color: #d1d5db;
}
.dark .lux-card {
    background: #1f2937;
    border-color: #374151;
}
.dark .lux-card:hover {
    border-color: #4b5563;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.2), 0 12px 24px -4px rgba(0,0,0,0.3), 0 24px 48px -8px rgba(0,0,0,0.2);
}
.lux-card img {
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.lux-card:hover img {
    transform: scale(1.05);
}

/* ---- Stat Card ---- */
.lux-stat-card {
    padding: 1.5rem;
    border-radius: 1rem;
    background: white;
    border: 1px solid #e5e7eb;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.05);
}
.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:first-child {
    transform: rotate(-90deg);
}
.lux-progress-ring .progress-ring-fill {
    animation: progress-ring-draw 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    stroke-dashoffset: 113.1;
}
@keyframes progress-ring-draw {
    to { stroke-dashoffset: 0; }
}
.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 ---- */
/* Course card sub-components (used inside lux-card) */
.course-thumbnail {
    aspect-ratio: 16 / 9;
    background: linear-gradient(135deg, var(--org-primary, #3b82f6), #8b5cf6);
    position: relative;
    overflow: hidden;
}
.course-body {
    padding: 1.25rem;
}
.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 .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.625rem 1.125rem;
    min-height: 2.75rem; /* 44px WCAG touch target */
    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 var(--org-primary, #3b82f6);
}
.lux-btn-primary {
    background: var(--org-primary, #3b82f6);
    color: white;
    box-shadow: 0 1px 2px var(--org-primary-shadow, rgba(59, 130, 246, 0.3));
}
.lux-btn-primary:hover {
    background: var(--org-primary-hover, #2563eb);
    box-shadow: 0 4px 12px var(--org-primary-shadow, 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, var(--org-primary-hover, #1e40af) 0%, var(--org-primary, #3b82f6) 50%, var(--org-primary-mid, #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); }
}
@keyframes lux-fade-in-opacity {
    from { opacity: 0; }
    to { opacity: 1; }
}
.lux-animate-in {
    animation: lux-fade-in 0.3s ease forwards;
}

/* Staggered children animation — opacity only so transform stays free for :hover (Safari fix) */
.lux-stagger > * {
    opacity: 0;
    animation: lux-fade-in-opacity 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 var(--org-primary, #3b82f6);
    outline-offset: 2px;
    border-radius: 4px;
}

/* ---- Prose Typography ---- */
.prose {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 1.0625rem;
    line-height: 1.8;
    max-width: 72ch;
    color: #1f2937;
    letter-spacing: -0.01em;
}
.prose h1, .prose h2, .prose h3, .prose h4, .prose h5, .prose h6 {
    font-family: 'Inter', system-ui, sans-serif;
    letter-spacing: -0.02em;
    line-height: 1.3;
    margin-top: 1.75em;
    margin-bottom: 0.75em;
    color: #111827;
}
.prose h1 { font-size: 1.875rem; font-weight: 700; }
.prose h2 { font-size: 1.5rem; font-weight: 600; }
.prose h3 { font-size: 1.25rem; font-weight: 600; }
.prose p { margin: 1.25em 0; }
.prose a { color: var(--org-primary, #2563eb); text-decoration: underline; text-underline-offset: 2px; }
.prose a:hover { opacity: 0.8; }
.prose blockquote {
    border-left: 3px solid #d1d5db;
    padding-left: 1.25em;
    font-style: italic;
    color: #4b5563;
    margin: 1.5em 0;
}
.prose code {
    font-size: 0.875em;
    background: #f3f4f6;
    padding: 0.15em 0.4em;
    border-radius: 0.25rem;
    color: #1f2937;
}
.prose pre {
    background: #1f2937;
    color: #e5e7eb;
    padding: 1.25em;
    border-radius: 0.75rem;
    overflow-x: auto;
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 0.875rem;
    line-height: 1.6;
    margin: 1.5em 0;
}
.prose pre code { background: none; padding: 0; color: inherit; font-size: inherit; }
.prose img { border-radius: 0.75rem; margin: 1.5em 0; }
.prose table { width: 100%; border-collapse: collapse; margin: 1.5em 0; font-family: 'Inter', system-ui, sans-serif; font-size: 0.875rem; }
.prose thead th { text-align: left; font-weight: 600; padding: 0.75em 1em; border-bottom: 2px solid #e5e7eb; color: #374151; }
.prose tbody td { padding: 0.75em 1em; border-bottom: 1px solid #f3f4f6; }

/* ---- Prose List Styling ---- */
.prose ul { list-style-type: disc; margin: 1em 0; padding-left: 1.625em; }
.prose ol { list-style-type: decimal; margin: 1em 0; padding-left: 1.625em; }
.prose li { margin: 0.5em 0; }
.prose li::marker { color: #6b7280; }
.prose ul ul { list-style-type: circle; }
.prose ul ul ul { list-style-type: square; }

/* ---- 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; }
/* Force dark text on elements with light inline backgrounds (callouts, tables) */
.dark .prose div[style*="background"], .dark .prose p[style*="background"],
.dark .prose td[style*="background"], .dark .prose th[style*="background"],
.dark .prose tr[style*="background"] { color: #1f2937; }
.dark .prose div[style*="background"] strong, .dark .prose p[style*="background"] strong,
.dark .prose div[style*="background"] em, .dark .prose p[style*="background"] em { color: #1f2937; }

/* ---- 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;
}
/* Desktop: sidebar is static (part of flex layout), no backdrop */
@media (min-width: 1024px) {
    .lux-player-sidebar {
        flex-direction: column;
        position: static !important;
        transform: none !important;
    }
    .lux-player-backdrop {
        display: none !important;
    }
}
/* Mobile: sidebar is fixed overlay, backdrop visible when open */
@media (max-width: 1023px) {
    .lux-player-layout {
        position: relative;
        height: calc(100vh - 4rem);
    }
    .lux-player-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: 85%;
        max-width: 320px;
        z-index: 50;
        border-right: 1px solid #e5e7eb;
        border-bottom: none;
        box-shadow: 4px 0 24px rgba(0,0,0,0.15);
        display: flex;
        flex-direction: column;
    }
    .dark .lux-player-sidebar {
        border-right-color: #374151;
        box-shadow: 4px 0 24px rgba(0,0,0,0.4);
    }
    .lux-player-content {
        width: 100%;
    }
    .lux-player-backdrop {
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.4);
        z-index: 40;
    }
}

/* ---- 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: var(--org-primary-light, #eff6ff);
    border-left-color: var(--org-primary, #3b82f6);
}
.dark .lux-lesson-item.active {
    background-color: var(--org-primary-ring, rgba(59, 130, 246, 0.1));
    border-left-color: var(--org-primary-light, #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;
}
.dark .lux-event-card:hover {
    border-color: #4b5563;
    box-shadow: 0 8px 25px -5px rgba(0, 0, 0, 0.3);
}

/* 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: var(--org-primary, #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%;
    min-height: 2.75rem;
    padding-top: 0.5rem;
    padding-right: 0.75rem;
    padding-bottom: 0.5rem;
    padding-left: 0.75rem;
    font-size: 0.875rem;
    line-height: 1.5;
    color: #111827;
    background: #fafafa;
    border: 1px solid #d1d5db;
    border-radius: 0.75rem;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.lux-input:focus {
    border-color: var(--org-primary, #3b82f6);
    box-shadow: 0 0 0 3px var(--org-primary-ring, 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: var(--org-primary, #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;
}

/* ---- Scroll Reveal ---- */
.scroll-reveal {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}
.scroll-reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* ---- Card Hover Effect ---- */
.lux-card-hover {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.lux-card-hover:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
}
.dark .lux-card-hover:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

/* ---- Button Micro-interactions ---- */
.lux-btn:active {
    transform: scale(0.98);
}

/* ---- Subtle Pulse (CTA emphasis) ---- */
@keyframes lux-subtle-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(14, 165, 233, 0.3); }
    50% { box-shadow: 0 0 0 6px rgba(14, 165, 233, 0); }
}
.lux-pulse {
    animation: lux-subtle-pulse 2s infinite;
}

/* ---- View Transitions (MPA) ---- */
@view-transition {
    navigation: auto;
}
::view-transition-old(root) {
    animation: 0.2s ease-out both vt-fade-out;
}
::view-transition-new(root) {
    animation: 0.2s ease-in 0.1s both vt-fade-in;
}
@keyframes vt-fade-out {
    to { opacity: 0; transform: translateY(-4px); }
}
@keyframes vt-fade-in {
    from { opacity: 0; transform: translateY(4px); }
}
/* Persist sidebar across navigations */
aside {
    view-transition-name: sidebar;
}
::view-transition-old(sidebar),
::view-transition-new(sidebar) {
    animation: none;
}
/* Persist top nav */
header, nav.fixed {
    view-transition-name: topnav;
}
::view-transition-old(topnav),
::view-transition-new(topnav) {
    animation: none;
}

/* ---- Reduced Motion ---- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    @view-transition {
        navigation: none;
    }
}

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