/**
 * Custom CSS Styles
 */

/* Custom Scrollbar */
/* Custom Scrollbar - Sleek & Professional */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.5); /* Slate-400 with opacity */
    border-radius: 10px;
    transition: background 0.3s ease;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(100, 116, 139, 0.8); /* Slate-500, darker */
}

/* Animations */
@keyframes fade-in {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes zoom-in-95 {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes pulse-slow {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.85;
    }
}

/* Rotating Badge Animation */
.rotating-badge-container {
    position: relative !important;
    display: inline-block !important;
    height: 2.5rem !important;
    /* Match badge height (py-1.5 = 0.375rem * 2 + text height) */
    min-width: 5rem !important;
    /* Minimum width to prevent jumping */
}

.rotating-badge {
    transition: opacity 0.5s ease-in-out !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
}

.rotating-badge.fade-out {
    opacity: 0;
}

.rotating-badge.fade-in {
    opacity: 1;
}

.animate-in {
    animation-duration: 300ms;
    animation-fill-mode: both;
}

.fade-in {
    animation-name: fade-in;
}

.zoom-in-95 {
    animation-name: zoom-in-95;
}

.animate-pulse-slow {
    animation: pulse-slow 3s ease-in-out infinite;
}

/* Utility Classes */
.line-clamp-2 {
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
}

/* Custom video watermark overlay */
.watermark-overlay {
    pointer-events: none;
    user-select: none;
}

/* Disable right-click on protected media */
.protected-media {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

.protected-media img,
.protected-media video {
    pointer-events: none;
}

/* Print Styles */
@media print {
    .no-print {
        display: none !important;
    }
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .dynamic-app-container {
        margin: 0 !important;
        border-radius: 0 !important;
    }
}

/* Siri Style - Breathing blend (colors morph smoothly) */
/* Course Card Base & Animations */
.course-card {
    position: relative;
    background: #ffffff !important;
    opacity: 1;
    border-radius: 1rem;
    /* Static shadow and transform to prevent ANY movement or jumps */
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08) !important;
    border: 1px solid rgba(0, 0, 0, 0.15);
    transform: translateZ(0) !important;
    transition: border-color 0.3s ease;
    overflow: hidden;
    isolation: isolate;
    backface-visibility: hidden;
}

/* Dedicated Siri Glow Layer - Separated to prevent flicker and movement */
.course-card::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0;
    z-index: 10;
    transition: opacity 0.4s ease;
    border-radius: inherit;
}

.course-card:hover::after {
    opacity: 1;
    animation: siri-glow-breathe 4s ease-in-out infinite;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(24px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.premium-card-reveal {
    animation: fadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Siri Style - original concentrated directional glow on pseudo-element */
@keyframes siri-glow-breathe {

    0%,
    100% {
        box-shadow:
            inset 0 10px 20px -10px rgba(59, 130, 246, 0.4),
            inset 10px 0 20px -10px rgba(139, 92, 246, 0.4),
            inset 0 -10px 20px -10px rgba(236, 72, 153, 0.4),
            inset -10px 0 20px -10px rgba(245, 158, 11, 0.4);
    }

    50% {
        box-shadow:
            inset 0 10px 20px -10px rgba(236, 72, 153, 0.4),
            inset 10px 0 20px -10px rgba(245, 158, 11, 0.4),
            inset 0 -10px 20px -10px rgba(16, 185, 129, 0.4),
            inset -10px 0 20px -10px rgba(6, 182, 212, 0.4);
    }
}

.course-card:hover {
    z-index: 50;
    border-color: rgba(79, 70, 229, 0.5);
}



/* Selection / Active logic state */
.course-card:active {
    transform: translateY(0);
    transition: all 0.2s;
}

/* Selected state (if needed for future selection logic) */
.course-card.is-selected {
    box-shadow: 0 0 0 3px #4f46e5;
}

/* Scrollbar Utility */
.hide-scrollbar::-webkit-scrollbar {
    display: none;
}

.hide-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* Sticky Header Glassmorphism */
.mobile-sticky-header {
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.08);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

/* Pulse for the count badge */
@keyframes pulse-indigo {
    0% {
        box-shadow: 0 0 0 0 rgba(79, 70, 229, 0.4);
    }

    70% {
        box-shadow: 0 0 0 6px rgba(79, 70, 229, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(79, 70, 229, 0);
    }
}

.count-pulse {
    animation: pulse-indigo 2s infinite;
}

/* Featured Carousel - Styles handled by utility classes in home.php */

/* ===== Lesson Content Styling ===== */
/* Used in: TinyMCE Editor, Preview Modals, Course Player */
.lesson-content,
.lesson-content-preview {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 15px;
    line-height: 1.7;
    color: #334155;
}

/* Paragraph Spacing */
.lesson-content p,
.lesson-content-preview p {
    margin: 0 0 1em 0;
    min-height: 1em;
}

/* Heading Spacing */
.lesson-content h1,
.lesson-content h2,
.lesson-content h3,
.lesson-content h4,
.lesson-content h5,
.lesson-content h6,
.lesson-content-preview h1,
.lesson-content-preview h2,
.lesson-content-preview h3,
.lesson-content-preview h4,
.lesson-content-preview h5,
.lesson-content-preview h6 {
    margin: 1.5em 0 0.5em 0;
    line-height: 1.3;
    font-weight: 700;
    color: #1e293b;
}

.lesson-content h1,
.lesson-content-preview h1 {
    font-size: 2em;
}

.lesson-content h2,
.lesson-content-preview h2 {
    font-size: 1.5em;
}

.lesson-content h3,
.lesson-content-preview h3 {
    font-size: 1.25em;
}

/* List Spacing */
.lesson-content ul,
.lesson-content ol,
.lesson-content-preview ul,
.lesson-content-preview ol {
    margin: 1em 0;
    padding-left: 2em;
}

.lesson-content li,
.lesson-content-preview li {
    margin: 0.5em 0;
}

/* Image Spacing */
.lesson-content img,
.lesson-content-preview img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 1em 0;
}

/* Material Container */
.lesson-content .material-container,
.lesson-content-preview .material-container {
    margin: 1.5em 0;
}

/* Links */
.lesson-content a,
.lesson-content-preview a {
    color: #4f46e5;
    text-decoration: underline;
}

/* Blockquotes */
.lesson-content blockquote,
.lesson-content-preview blockquote {
    border-left: 4px solid #e2e8f0;
    padding-left: 1em;
    margin: 1em 0;
    color: #64748b;
}

/* Inline Code */
.lesson-content code,
.lesson-content-preview code {
    background: #f1f5f9;
    padding: 0.2em 0.4em;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
}

/* Code Blocks */
.lesson-content pre,
.lesson-content-preview pre {
    background: #1e293b;
    color: #10b981;
    padding: 1em;
    border-radius: 6px;
    overflow-x: auto;
    margin: 1em 0;
}

/* Tables */
.lesson-content table,
.lesson-content-preview table {
    border-collapse: collapse;
    width: 100%;
    margin: 1em 0;
}

.lesson-content th,
.lesson-content td,
.lesson-content-preview th,
.lesson-content-preview td {
    border: 1px solid #e2e8f0;
    padding: 0.5em;
    text-align: left;
}

.lesson-content th,
.lesson-content-preview th {
    background: #f8fafc;
    font-weight: 600;
}

/* Button Loading State */
.btn-loading {
    position: relative !important;
    color: transparent !important;
    pointer-events: none !important;
}

.btn-loading svg,
.btn-loading i,
.btn-loading span {
    visibility: hidden !important;
}

.btn-loading::after {
    content: "";
    position: absolute;
    width: 1.25rem;
    height: 1.25rem;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border: 2px solid rgba(128, 128, 128, 0.2);
    border-top-color: #4f46e5;
    /* Fallback primary color */
    border-radius: 50%;
    animation: btn-loading-spinner 0.6s linear infinite;
}

/* If button has a background (most of our primary buttons do), make spinner white */
.bg-indigo-600.btn-loading::after,
.bg-blue-600.btn-loading::after,
.bg-emerald-600.btn-loading::after,
.bg-rose-600.btn-loading::after,
.bg-amber-600.btn-loading::after {
    border-color: rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
}

/* Glassmorphism/Transparent white buttons */
.bg-white\/20.btn-loading::after,
.bg-white\/10.btn-loading::after,
.bg-white\/30.btn-loading::after {
    border-color: rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
}

@keyframes btn-loading-spinner {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}