@keyframes slide-up {
    0% {
        transform: translateY(100%);
        opacity: 0;
    }
    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

.animate-slide-up {
    animation: slide-up 0.3s ease-out;
}

/* Add to existing Tailwind classes */
.backdrop-blur-sm {
    backdrop-filter: blur(8px);
}

/* Add these styles to your existing styles.css */
.user-menu-container {
    position: relative;
}

#userMenu {
    transform-origin: top right;
    transition: all 0.1s ease-out;
}

#userMenu:not(.hidden) {
    animation: scale-in 0.15s ease-out;
}

@keyframes scale-in {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Add a subtle hover effect for menu items */
#userMenu a:hover, 
#userMenu button:hover {
    background-color: rgba(255, 255, 255, 0.05);
} 

/* Question drag and drop styles */
.question-item {
    transition: all 0.2s ease;
    user-select: none;
}

.question-item.sortable-ghost {
    opacity: 0.4;
    background-color: #1e293b !important;
    border: 2px dashed #3b82f6;
}

.question-item.sortable-drag {
    background-color: #1e293b !important;
    cursor: grabbing !important;
    transform: scale(1.02);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
}

.question-drag-handle {
    cursor: grab;
    padding: 0.5rem;
    border-radius: 0.375rem;
    transition: all 0.2s ease;
}

.question-drag-handle:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.question-drag-handle:active {
    cursor: grabbing;
    background-color: rgba(255, 255, 255, 0.15);
}

/* Smooth animations for question reordering */
.question-item {
    animation: question-appear 0.3s ease-out;
}

@keyframes question-appear {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.certificate-stats {
    margin-top: 1rem;
    padding: 1rem;
    background-color: #f8f9fa;
    border-radius: 0.5rem;
}

.award-history {
    margin-top: 1rem;
    max-height: 300px;
    overflow-y: auto;
}

.award-entry {
    padding: 0.5rem;
    border-bottom: 1px solid #dee2e6;
}

.award-entry:last-child {
    border-bottom: none;
}

.user-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.award-date {
    font-size: 0.875rem;
    color: #6c757d;
}

.user-stats {
    font-size: 0.875rem;
    color: #28a745;
}

.category-header {
    cursor: pointer;
    user-select: none;
}

.category-header svg {
    transition: transform 0.3s ease;
}

.category-header.active svg {
    transform: rotate(180deg);
}

.category-content {
    background-color: rgba(30, 41, 59, 0.5);
}

.category-content > div {
    transition: max-height 0.3s ease-out;
    overflow: hidden;
}

.category-row {
    position: relative;
}

.category-header:hover {
    background-color: rgba(51, 65, 85, 0.5);
}

.category-header:active {
    background-color: rgba(51, 65, 85, 0.7);
}

.rotate-180 {
    transform: rotate(180deg);
}

/* Ensure smooth transitions */
.category-content[style*="display: table-row"] > td > div {
    max-height: none;
}

/* Ensure text is readable in all lesson contexts */
.lesson-text-content,
.lesson-text-content * {
    color: white !important;
    line-height: 1.6;
}

/* Additional comprehensive lesson text styling */
.prose.prose-invert,
.prose.prose-invert *,
.prose-invert,
.prose-invert * {
    color: white !important;
}

/* Target all possible lesson content containers */
[id*="content"],
[id*="lesson"],
[class*="lesson"],
[class*="content"] {
    color: white !important;
}

[id*="content"] *,
[id*="lesson"] *,
[class*="lesson"] *,
[class*="content"] * {
    color: white !important;
}

/* Override any Tailwind prose defaults */
.prose p,
.prose div,
.prose span,
.prose li,
.prose td,
.prose th,
.prose h1,
.prose h2,
.prose h3,
.prose h4,
.prose h5,
.prose h6 {
    color: white !important;
}

/* Specific targeting for lesson pages */
body[class*="lesson"] *,
div[id*="lesson"] *,
div[class*="lesson"] * {
    color: white !important;
}

/* TTS word spans styling */
.tts-word {
    color: white !important;
}

/* Additional fallback for any remaining black text */
* {
    color: inherit;
}

/* Force white text on lesson pages */
.lesson-page *,
.lesson-content *,
.content-text *,
#lesson-content *,
#content-container *,
#content-text * {
    color: white !important;
}

/* ==================== DRAG AND DROP STYLES ==================== */

/* Draggable section items */
.section-item {
    transition: all 0.2s ease;
    user-select: none;
}

.section-item:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
}

/* Dragging state */
.section-item.dragging {
    transform: rotate(2deg) scale(1.02);
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.3);
    z-index: 1000;
    border-color: rgba(59, 130, 246, 0.8) !important;
}

/* Drag over state */
.section-item.drag-over {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(147, 51, 234, 0.2)) !important;
    border-color: rgba(59, 130, 246, 0.8) !important;
    transform: scale(1.02);
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.4);
}

/* Drop indicator */
.drop-indicator {
    pointer-events: none;
    box-shadow: 0 0 8px rgba(59, 130, 246, 0.8);
}

/* Drag cursor */
.section-item[draggable="true"] {
    cursor: grab;
}

.section-item[draggable="true"]:active {
    cursor: grabbing;
}

/* Smooth transitions for all drag states */
.section-item,
.section-item * {
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Prevent text selection during drag */
.section-item.dragging,
.section-item.dragging * {
    user-select: none !important;
    -webkit-user-select: none !important;
    -moz-user-select: none !important;
    -ms-user-select: none !important;
}

/* Enhanced hover effects for better UX */
.section-item:not(.dragging):hover {
    border-color: rgba(59, 130, 246, 0.6);
}

/* Drag handle visual cue */
.section-item::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 16px;
    background: linear-gradient(to bottom, 
        transparent 0%, 
        rgba(148, 163, 184, 0.3) 25%, 
        rgba(148, 163, 184, 0.6) 50%, 
        rgba(148, 163, 184, 0.3) 75%, 
        transparent 100%);
    border-radius: 2px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.section-item:hover::before {
    opacity: 1;
}

.section-item.dragging::before {
    opacity: 0;
}

/* Adjust padding to accommodate drag handle */
.section-item .flex.items-center {
    padding-left: 16px;
}

/* Animation for successful drop */
@keyframes drop-success {
    0% {
        transform: scale(1.05);
        background: linear-gradient(135deg, rgba(34, 197, 94, 0.3), rgba(59, 130, 246, 0.3));
    }
    100% {
        transform: scale(1);
        background: linear-gradient(135deg, rgba(30, 41, 59, 0.5), rgba(51, 65, 85, 0.5));
    }
}

.section-item.drop-success {
    animation: drop-success 0.5s ease-out;
}

/* Prevent drag on action buttons */
.section-item button,
.section-item .opacity-0 {
    pointer-events: auto;
    -webkit-user-drag: none;
    -khtml-user-drag: none;
    -moz-user-drag: none;
    -o-user-drag: none;
    user-drag: none;
}

/* Responsive drag handle */
@media (max-width: 768px) {
    .section-item::before {
        width: 3px;
        height: 12px;
        left: 6px;
    }
    
    .section-item .flex.items-center {
        padding-left: 12px;
    }
}

/* Enhanced animations for drag and drop */
.section-item {
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.section-item:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.section-item.dragging {
    animation: dragPulse 1s ease-in-out infinite alternate;
    z-index: 1000;
}

@keyframes dragPulse {
    0% {
        box-shadow: 0 4px 20px rgba(59, 130, 246, 0.3);
        transform: scale(1.02);
    }
    100% {
        box-shadow: 0 8px 30px rgba(59, 130, 246, 0.5);
        transform: scale(1.05);
    }
}

.drop-indicator {
    animation: dropIndicatorGlow 1s ease-in-out infinite alternate;
}

@keyframes dropIndicatorGlow {
    0% {
        background-color: #3b82f6;
        box-shadow: 0 0 10px rgba(59, 130, 246, 0.5);
    }
    100% {
        background-color: #1d4ed8;
        box-shadow: 0 0 20px rgba(59, 130, 246, 0.8);
    }
}

.section-item.drag-over-child {
    animation: childDropZone 0.6s ease-in-out infinite alternate;
}

@keyframes childDropZone {
    0% {
        background-color: rgba(34, 197, 94, 0.1);
        border-left: 4px solid #22c55e;
    }
    100% {
        background-color: rgba(34, 197, 94, 0.2);
        border-left: 4px solid #16a34a;
    }
}

/* Smooth expansion/collapse animations */
.section-children {
    transition: max-height 0.3s ease-in-out, opacity 0.2s ease-in-out;
    overflow: hidden;
}

.section-children.hidden {
    max-height: 0;
    opacity: 0;
}

.section-children:not(.hidden) {
    max-height: 2000px;
    opacity: 1;
}

/* Expand icon rotation animation */
.expand-icon {
    transition: transform 0.2s ease-in-out;
}

.expand-icon.rotated {
    transform: rotate(90deg);
}
  