/*
 * JoesTechs – Custom styles
 * Tailwind CDN handles utilities; this file adds only custom non-Tailwind rules.
 */

/* ── Accessibility ──────────────────────────────────────────────────────── */
*:focus-visible {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

/* Skip to main content (WCAG 2.2) */
.skip-link {
    position: absolute;
    top: -40px;
    left: 1rem;
    z-index: 9999;
    padding: 8px 16px;
    background: #2563eb;
    color: white;
    border-radius: 0 0 8px 8px;
    font-weight: 600;
    transition: top 0.2s;
}
.skip-link:focus {
    top: 0;
}

/* ── Smooth transitions ──────────────────────────────────────────────────── */
* {
    transition-property: color, background-color, border-color, text-decoration-color, fill, stroke;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    transition-duration: 150ms;
}

/* ── Video player container ───────────────────────────────────────────────── */
.video-container {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 */
    height: 0;
    overflow: hidden;
    background: #000;
    border-radius: 8px;
}
.video-container iframe,
.video-container video {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
}

/* ── Progress bar ────────────────────────────────────────────────────────── */
.progress-ring {
    transform: rotate(-90deg);
}

/* ── Line clamp fallback (for older browsers) ─────────────────────────────── */
.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;
}

/* ── Prose content (lesson text) ─────────────────────────────────────────── */
.prose-content h1, .prose-content h2, .prose-content h3 {
    font-weight: 700;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}
.prose-content h1 { font-size: 1.875rem; }
.prose-content h2 { font-size: 1.5rem; }
.prose-content h3 { font-size: 1.25rem; }
.prose-content p { margin-bottom: 1rem; line-height: 1.75; }
.prose-content ul, .prose-content ol { margin-left: 1.5rem; margin-bottom: 1rem; }
.prose-content ul { list-style-type: disc; }
.prose-content ol { list-style-type: decimal; }
.prose-content li { margin-bottom: 0.25rem; }
.prose-content code {
    background: #f3f4f6;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.875em;
    font-family: 'Courier New', monospace;
}
.prose-content pre {
    background: #1f2937;
    color: #f9fafb;
    padding: 1rem;
    border-radius: 8px;
    overflow-x: auto;
    margin-bottom: 1rem;
}
.prose-content pre code {
    background: transparent;
    color: inherit;
    padding: 0;
}
.prose-content blockquote {
    border-left: 4px solid #2563eb;
    padding-left: 1rem;
    color: #6b7280;
    font-style: italic;
    margin: 1rem 0;
}
.prose-content a { color: #2563eb; text-decoration: underline; }
.prose-content img { max-width: 100%; border-radius: 8px; margin: 1rem 0; }
.prose-content table { width: 100%; border-collapse: collapse; margin-bottom: 1rem; }
.prose-content th, .prose-content td { border: 1px solid #e5e7eb; padding: 8px 12px; text-align: left; }
.prose-content th { background: #f9fafb; font-weight: 600; }

/* ── AI Chat bounce animation ─────────────────────────────────────────────── */
@keyframes bounce-dot {
    0%, 80%, 100% { transform: translateY(0); }
    40%            { transform: translateY(-6px); }
}
.animate-bounce {
    animation: bounce-dot 1.4s infinite ease-in-out both;
}

/* ── Loading spinner ─────────────────────────────────────────────────────── */
.spinner {
    width: 20px; height: 20px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ── Scrollbar styling ───────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #f1f5f9; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }
