/* ===========================
   UTILITY CLASSES
   =========================== */

.center {
    display: block;
    margin-left: auto;
    margin-right: auto;
}

/* ===========================
   HERO SECTION STYLES
   =========================== */

.hero {
    text-align: center;
    padding: 4rem 2rem;
    background: linear-gradient(135deg, rgba(255, 167, 38, 0.1) 0%, rgba(255, 111, 0, 0.1) 100%);
    border-radius: 1rem;
    margin: 2rem 0;
}

.hero h1 {
    font-size: 3.5rem !important;
    font-weight: 800 !important;
    letter-spacing: -0.03em !important;
    margin-bottom: 1rem !important;
    line-height: 1.2 !important;
}

.subtitle {
    font-size: 1.5rem;
    color: var(--md-default-fg-color--light);
    margin-bottom: 2rem;
    font-weight: 400;
}

/* Gradient text effect */
.gradient-text {
    background: linear-gradient(90deg, #FFA726 0%, #FF6F00 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: inline-block;
}

[data-md-color-scheme="slate"] .gradient-text {
    background: linear-gradient(90deg, #FFB74D 0%, #FFA726 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ===========================
   CARDS & GRID LAYOUT
   =========================== */

.grid.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.grid.cards > * {
    background: var(--md-default-bg-color);
    border: 1px solid var(--md-default-fg-color--lightest);
    border-radius: 0.5rem;
    padding: 1.5rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.grid.cards > *:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(255, 167, 38, 0.2);
    border-color: var(--md-accent-fg-color);
}

.grid.cards .lg {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.grid.cards .middle {
    vertical-align: middle;
}

/* ===========================
   ENHANCED BUTTONS
   =========================== */

.md-button {
    border-radius: 0.5rem;
    font-weight: 600;
    padding: 0.75rem 2rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-transform: none;
}

.md-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
}

.md-button--primary {
    background: linear-gradient(135deg, #FFA726 0%, #FF6F00 100%);
    border: none;
}

.md-button--primary:hover {
    background: linear-gradient(135deg, #FFB74D 0%, #FFA726 100%);
}

/* ===========================
   CODE BLOCKS ENHANCEMENT
   =========================== */

.md-typeset code {
    border-radius: 0.3rem;
    padding: 0.15rem 0.4rem;
    font-size: 0.85em;
    background-color: var(--md-code-bg-color);
    border: 1px solid var(--md-default-fg-color--lightest);
}

.md-typeset pre > code {
    border: none;
    padding: 1rem;
}

.highlight {
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

/* Default line highlight — green */
.highlight .hll {
    background-color: rgba(76, 175, 80, 0.18) !important;
}

[data-md-color-scheme="slate"] .highlight .hll {
    background-color: rgba(76, 175, 80, 0.22) !important;
}

/* .hl-green — explicit green (same as default, for clarity) */
.hl-green .highlight .hll {
    background-color: rgba(76, 175, 80, 0.18) !important;
}

[data-md-color-scheme="slate"] .hl-green .highlight .hll {
    background-color: rgba(76, 175, 80, 0.22) !important;
}

/* .hl-red — red highlight for removals / warnings */
.hl-red .highlight .hll {
    background-color: rgba(244, 67, 54, 0.15) !important;
}

[data-md-color-scheme="slate"] .hl-red .highlight .hll {
    background-color: rgba(244, 67, 54, 0.20) !important;
}

/* ===========================
   NAVIGATION ENHANCEMENTS
   =========================== */

.md-nav__link {
    transition: transform 0.2s ease, color 0.2s ease;
}

.md-nav__link:hover {
    transform: translateX(4px);
    color: var(--md-accent-fg-color) !important;
}

.md-nav__link--active {
    font-weight: 600;
}

/* ===========================
   TABLE OF CONTENTS
   =========================== */

.md-sidebar--secondary {
    border-left: 1px solid var(--md-default-fg-color--lightest);
}

.md-nav--secondary .md-nav__link--active {
    color: var(--md-accent-fg-color);
    border-left: 3px solid var(--md-accent-fg-color);
    padding-left: calc(1rem - 3px);
}

/* ===========================
   TYPOGRAPHY IMPROVEMENTS
   =========================== */

.md-typeset h1 {
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--md-default-fg-color);
}

.md-typeset h2 {
    font-weight: 600;
    letter-spacing: -0.01em;
    border-bottom: 2px solid var(--md-default-fg-color--lightest);
    padding-bottom: 0.5rem;
    margin-top: 2rem;
}

.md-typeset h3 {
    font-weight: 600;
    color: var(--md-accent-fg-color);
}

/* ===========================
   ADMONITIONS ENHANCEMENT
   =========================== */

.md-typeset .admonition {
    border-radius: 0.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    border-left: 4px solid var(--md-accent-fg-color);
}

/* ===========================
   SEARCH ENHANCEMENT
   =========================== */

.md-search__form {
    border-radius: 2rem;
    background-color: var(--md-default-bg-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.md-search__input {
    border-radius: 2rem;
}

/* ===========================
   FOOTER ENHANCEMENTS
   =========================== */

.md-footer {
    background-color: var(--md-footer-bg-color);
}

.md-footer-meta {
    background-color: var(--md-footer-bg-color);
    border-top: none;
}

/* ===========================
   CUSTOM FEATURE BOXES
   =========================== */

.feature-box {
    padding: 2rem;
    border-radius: 0.75rem;
    background: var(--md-default-bg-color);
    border: 2px solid var(--md-default-fg-color--lightest);
    margin: 1rem 0;
    transition: all 0.3s ease;
}

.feature-box:hover {
    border-color: var(--md-accent-fg-color);
    box-shadow: 0 8px 24px rgba(255, 167, 38, 0.15);
}

.feature-box h3 {
    margin-top: 0;
    color: var(--md-accent-fg-color);
}

/* ===========================
   ANIMATIONS
   =========================== */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

/* ===========================
   COLOR TAGS
   =========================== */

.tag {
    display: inline-block;
    padding: 0.15em 0.55em;
    border-radius: 2rem;
    font-size: 0.78em;
    font-weight: 600;
    font-family: var(--md-code-font-family);
    line-height: 1.6;
    letter-spacing: 0.01em;
    white-space: nowrap;
    margin-left: 0.5em;
}

/* card bottom tags (backtick code in last paragraph) */
.grid.cards > * p:last-child code {
    background: rgba(0, 0, 0, 0.06);
    color: var(--md-default-fg-color--light);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 2rem;
    padding: 0.15em 0.55em;
    font-size: 0.78em;
    font-weight: 600;
}
[data-md-color-scheme="slate"] .grid.cards > * p:last-child code {
    background: rgba(255, 255, 255, 0.07);
    color: var(--md-default-fg-color--light);
    border-color: rgba(255, 255, 255, 0.12);
}

/* orange */
.tag-orange {
    background: rgba(255, 152, 0, 0.14);
    color: #BF6000;
    border: 1px solid rgba(255, 152, 0, 0.35);
}
[data-md-color-scheme="slate"] .tag-orange {
    background: rgba(255, 183, 77, 0.18);
    color: #FFB74D;
    border-color: rgba(255, 183, 77, 0.35);
}

/* blue */
.tag-blue {
    background: rgba(33, 150, 243, 0.12);
    color: #1565C0;
    border: 1px solid rgba(33, 150, 243, 0.3);
}
[data-md-color-scheme="slate"] .tag-blue {
    background: rgba(100, 181, 246, 0.18);
    color: #90CAF9;
    border-color: rgba(100, 181, 246, 0.35);
}

/* green */
.tag-green {
    background: rgba(76, 175, 80, 0.12);
    color: #2E7D32;
    border: 1px solid rgba(76, 175, 80, 0.3);
}
[data-md-color-scheme="slate"] .tag-green {
    background: rgba(129, 199, 132, 0.18);
    color: #A5D6A7;
    border-color: rgba(129, 199, 132, 0.35);
}

/* teal */
.tag-teal {
    background: rgba(0, 150, 136, 0.12);
    color: #00695C;
    border: 1px solid rgba(0, 150, 136, 0.3);
}
[data-md-color-scheme="slate"] .tag-teal {
    background: rgba(77, 182, 172, 0.18);
    color: #80CBC4;
    border-color: rgba(77, 182, 172, 0.35);
}

/* purple */
.tag-purple {
    background: rgba(156, 39, 176, 0.11);
    color: #6A1B9A;
    border: 1px solid rgba(156, 39, 176, 0.28);
}
[data-md-color-scheme="slate"] .tag-purple {
    background: rgba(206, 147, 216, 0.18);
    color: #CE93D8;
    border-color: rgba(206, 147, 216, 0.35);
}

/* gray */
.tag-gray {
    background: rgba(120, 120, 120, 0.11);
    color: #555555;
    border: 1px solid rgba(120, 120, 120, 0.28);
}
[data-md-color-scheme="slate"] .tag-gray {
    background: rgba(180, 180, 180, 0.15);
    color: #BDBDBD;
    border-color: rgba(180, 180, 180, 0.3);
}

/* ===========================
   TUTORIAL CATEGORY SECTIONS
   =========================== */

.tutorial-section {
    border: 1px solid var(--md-default-fg-color--lightest);
    border-radius: 0.75rem;
    padding: 1.5rem 1.5rem 0.5rem;
    margin: 1.5rem 0;
    transition: border-color 0.3s ease;
}

.tutorial-section:hover {
    border-color: var(--md-accent-fg-color);
}

.tutorial-section h2 {
    border-bottom: none;
    margin-top: 0;
    padding-bottom: 0;
}

/* ===========================
   COPY PAGE BUTTON
   =========================== */

.copy-markdown-container {
    display: flex !important;
    justify-content: flex-end !important;
}

.copy-markdown-button {
    background: var(--md-default-fg-color--light) !important;
    color: var(--md-default-bg-color) !important;
}

.copy-markdown-button:hover {
    background: var(--md-default-fg-color) !important;
}

/* ===========================
   HOMEPAGE HERO SPLIT
   =========================== */

/* Hide auto-generated h1 on homepage when hero is present */
.md-typeset .hero-split ~ *,
.md-typeset .hero-split {
    /* ensure hero is recognized */
}
.md-content__inner > h1:first-child:has(+ .hero-split),
.md-content__inner > h1:first-child {
    /* fallback: we hide via JS or markdown */
}
.homepage-title {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.md-typeset .hero-split {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    align-items: center;
    gap: 2rem;
    padding: 3rem 0 1rem;
    min-height: 240px;
}

.md-typeset .hero-left {
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

.md-typeset .hero-left img {
    max-width: 400px;
    height: auto;
    display: block;
}

.md-typeset .hero-right .tagline {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.15;
    margin: 0 0 1.5rem 0;
    color: var(--md-default-fg-color);
}

.md-typeset .hero-right .tagline em {
    font-style: italic;
    color: #F9A825;
    background: linear-gradient(90deg, #FFD54F 0%, #F9A825 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    padding-right: 0.1em;
}

[data-md-color-scheme="slate"] .md-typeset .hero-right .tagline em {
    background: linear-gradient(90deg, #FFEE58 0%, #FFD54F 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ===========================
   RESPONSIVE ADJUSTMENTS
   =========================== */

@media screen and (max-width: 76.1875em) {
    .hero h1 {
        font-size: 2.5rem !important;
    }

    .subtitle {
        font-size: 1.2rem;
    }

    .grid.cards {
        grid-template-columns: 1fr;
    }

    .md-typeset .hero-split {
        grid-template-columns: 1fr;
        text-align: center;
        padding: 2rem 0 0.5rem;
    }

    .md-typeset .hero-left {
        justify-content: center;
    }

    .md-typeset .hero-left img {
        max-width: 320px;
    }

    .md-typeset .hero-right .tagline {
        font-size: 2rem;
    }
}

@media screen and (max-width: 44.9375em) {
    .hero {
        padding: 2rem 1rem;
    }

    .hero h1 {
        font-size: 2rem !important;
    }

    .md-typeset .hero-left img {
        max-width: 220px;
    }

    .md-typeset .hero-right .tagline {
        font-size: 1.6rem;
    }
}