/* ==========================================================================
   TUTORIALS.CSS - MODERN KNOWLEDGE BASE UI (2026)
   ========================================================================== */

.main-content {
    padding-top: 5rem;
    padding-bottom: 6rem;
}

.hidden {
    display: none !important;
}

/* --- Hero & Search --- */
.tutorials-hero {
    text-align: center;
    max-width: 800px;
    margin: 0 auto 4rem;
}

.badge-outline {
    display: inline-block;
    padding: 0.4rem 1.2rem;
    border: 1px solid var(--accent, #3b82f6);
    border-radius: 9999px;
    color: var(--accent, #3b82f6);
    font-size: 0.85rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    background: rgba(59, 130, 246, 0.05);
}

.hero-title {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 800;
    margin-bottom: 1rem;
    line-height: 1.1;
    letter-spacing: -0.02em;
}

.hero-subtitle {
    font-size: 1.15rem;
    color: var(--fg-muted, #9ca3af);
    line-height: 1.6;
    margin-bottom: 3rem;
}

/* Modern Search Bar */
.search-wrapper {
    position: relative;
    max-width: 600px;
    margin: 0 auto;
}

.search-icon {
    position: absolute;
    left: 1.2rem;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    color: var(--fg-muted);
}

.search-input {
    width: 100%;
    padding: 1.2rem 1.5rem 1.2rem 3.5rem !important;
    font-size: 1.1rem !important;
    border-radius: 9999px !important;
    background: var(--bg-secondary, #1f2937) !important;
    border: 2px solid var(--border-color, #374151) !important;
    color: var(--fg) !important;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.search-input:focus {
    border-color: var(--accent) !important;
    box-shadow: 0 0 0 4px var(--accent-glow, rgba(59, 130, 246, 0.2)), 0 10px 25px -5px rgba(0, 0, 0, 0.2) !important;
    transform: translateY(-2px);
}

/* --- Tutorials Grid & Accordion --- */
.tutorials-container {
    max-width: 900px;
    margin: 0 auto 5rem;
}

.tutorials-grid {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.tutorial-card {
    padding: 0;
    overflow: hidden;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.tutorial-card:hover {
    border-color: var(--accent);
}

/* Header Trigger */
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    cursor: pointer;
    user-select: none;
    background: transparent;
    transition: background 0.2s;
}

.card-header:hover {
    background: rgba(255, 255, 255, 0.02);
}

.card-title-group {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.card-icon {
    width: 48px;
    height: 48px;
    background: var(--bg, #111827);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    display: grid;
    place-items: center;
    font-size: 1.5rem;
}

.card-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0 0 0.3rem 0;
    color: var(--fg);
}

.card-desc {
    margin: 0;
    font-size: 0.95rem;
}

.expand-btn {
    background: transparent;
    border: none;
    color: var(--fg-muted);
    display: grid;
    place-items: center;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), color 0.2s;
    pointer-events: none;
}

/* Accordion Body */
.card-body {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    background: rgba(0, 0, 0, 0.1);
}

.card-body-inner {
    overflow: hidden;
    padding: 0 2rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.card-footer {
    padding: 1.5rem 2rem 2rem;
    border-top: 1px dashed var(--border-color);
    margin-top: 1rem;
    display: flex;
    justify-content: flex-end;
}

/* Active State */
.tutorial-card.active .expand-btn {
    transform: rotate(180deg);
    color: var(--accent);
}

.tutorial-card.active .card-body {
    grid-template-rows: 1fr;
}

.tutorial-card.active .card-body-inner {
    opacity: 1;
    padding-top: 1rem;
}

/* --- Rich Text Formatting inside Tutorials --- */
.rich-text {
    line-height: 1.8;
    color: var(--fg-muted);
}
.rich-text h3 {
    color: var(--fg);
    font-size: 1.1rem;
    margin: 1.5rem 0 0.5rem;
}
.rich-text ol, .rich-text ul {
    padding-left: 1.2rem;
    margin-bottom: 1.5rem;
}
.rich-text li {
    margin-bottom: 0.5rem;
}
.rich-text li strong {
    color: var(--accent);
}
.rich-text code {
    background: var(--bg);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    font-family: monospace;
    font-size: 0.9em;
    color: var(--fg);
}

/* Tutorial Images Formatting */
.tutorial-image {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 1.5rem 0 2.5rem 0;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3);
    background-color: var(--bg-secondary);
}

/* --- CTA Section --- */
.tutorials-cta {
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(145deg, var(--bg-secondary), rgba(59, 130, 246, 0.05));
    border-color: var(--accent);
}

.cta-content h2 {
    font-size: 1.4rem;
    margin-bottom: 0.5rem;
}
.cta-content p {
    margin: 0;
}

/* --- Empty State --- */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    background: transparent;
    border: 1px dashed var(--border-color);
}
.empty-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* --- Animations --- */
.animate-fade-in { opacity: 0; animation: fadeIn 0.8s ease-out forwards; }
.animate-slide-up { opacity: 0; transform: translateY(30px); animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards; animation-delay: var(--delay, 0s); }

@keyframes fadeIn { to { opacity: 1; } }
@keyframes slideUp { to { opacity: 1; transform: translateY(0); } }

/* Responsive */
@media (max-width: 768px) {
    .card-header { padding: 1.5rem; }
    .card-body-inner { padding: 0 1.5rem; }
    .card-title-group { gap: 1rem; }
    .tutorials-cta { flex-direction: column; text-align: center; gap: 2rem; }
}