/* ===== CSS CUSTOM PROPERTIES ===== */
:root {
    --color-primary: #8560f5;
    --color-primary-hover: #526cfe;
    --color-gradient-start: #bc00ff;
    --color-gradient-end: #00eeff;
    
    /* Use MkDocs Material's color variables */
    --page-bg: var(--md-default-bg-color);
    --page-text: var(--md-default-fg-color);
    --section-bg-dark: var(--md-code-bg-color);
    --section-bg-light: var(--md-default-bg-color);
    --border-color: var(--md-default-fg-color--lightest);
    --shadow-color: var(--md-shadow-z1);
    
    /* Shadow colors for light/dark mode */
    --shadow-light: rgba(0, 0, 0, 0.1);
    --shadow-medium: rgba(0, 0, 0, 0.06);
    --shadow-hover-light: rgba(0, 0, 0, 0.15);
    --shadow-hover-medium: rgba(0, 0, 0, 0.1);
}

/* Dark mode shadow overrides */
[data-md-color-scheme="slate"] {
    --shadow-light: rgba(255, 255, 255, 0.1);
    --shadow-medium: rgba(255, 255, 255, 0.06);
    --shadow-hover-light: rgba(255, 255, 255, 0.15);
    --shadow-hover-medium: rgba(255, 255, 255, 0.1);
}

/* ===== BASE STYLES ===== */
body {
    margin: 0;
    font-family: "Inter", sans-serif;
}

/* ===== LAYOUT RESETS ===== */
/* DON'T change header position - this causes palette jump! */
/* .md-header {
    position: initial;
} */

.md-content__inner {
    margin: 0;
}

.md-main__inner.md-grid,
.md-grid {
    max-width: initial;
}

/* Hide sidebars on large screens for hero layout */
@media screen and (min-width: 60em) {
    .md-sidebar--secondary {
        display: none;
    }
}

@media screen and (min-width: 76.25em) {
    .md-sidebar--primary {
        display: none;
    }
}

/* ===== HERO SECTION ===== */
.hero {
    display: flex;
    text-align: center;
    justify-content: center;
    padding: clamp(2rem, 10vmax, 10rem) 1rem;
}

.hero h1 {
    font-weight: 600;
    font-size: clamp(2.5rem, 8vw, 4rem);
    margin-bottom: 1rem;
}

.hero p {
    font-size: 1.15rem;
    max-width: 600px;
    margin: 0 auto 1.5rem;
    line-height: 1.6;
}

.gradient-text {
    background: linear-gradient(to right, var(--color-gradient-start), var(--color-gradient-end));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ===== BUTTONS ===== */
.cta-buttons {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 0.75rem;
}

.cta-buttons button {
    background-color: var(--color-primary);
    color: white;
    border: none;
    width: 100%;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 400;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.cta-buttons button:hover {
    background-color: var(--color-primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(133, 96, 245, 0.3);
}

.cta-buttons button:active {
    transform: translateY(0);
}

.cta-buttons-2 {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.cta-buttons-2 a {
    width: 100%;
}

.cta-buttons-2 button {
    width: 100%;
    color: var(--color-primary);
    border: 2px solid var(--color-primary);
    background: transparent;
    padding: 0.6rem 2rem;
    font-size: 0.9rem;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 400;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.cta-buttons-2 button:hover {
    color: #fff;
    background-color: var(--color-primary-hover);
    border-color: var(--color-primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(133, 96, 245, 0.3);
}

.cta-buttons-2 button:active {
    transform: translateY(0);
}

/* ===== FEATURE SECTIONS ===== */
.feature-section {
    background-color: var(--md-code-bg-color);
    color: var(--md-typeset-color);
    padding: 3rem 1rem 4rem;
}

.feature-section.light {
    background-color: var(--md-default-bg-color);
    color: var(--md-typeset-color);
    padding: 2.5rem 1rem 3rem;
}

@media screen and (min-width: 768px) {
    .feature-section {
        padding: 6rem 10vw 7rem;
    }

    .feature-section.light {
        padding: 5rem 10vw 6rem;
    }
}

h1.feature-label {
    padding: 0 20px;
    font-family: Roboto, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    color: var(--md-default-fg-color--light);
}

h1.feature-label.light {
    color: var(--md-default-fg-color--light);
}

/* ===== FEATURE CARDS ===== */
.feature {
    display: flex;
    flex-wrap: wrap;
    margin-bottom: 20px;
    opacity: 0;
    transition: opacity .75s ease-out 125ms;
}

.feature.visible {
    opacity: 1;
}

.feature.right {
    flex-direction: row-reverse;
}

.feature-text {
    flex: 5 1 400px;
    padding: 20px;
    transform: translateX(-3rem);
    opacity: 0;
    transition: transform .75s cubic-bezier(0.34, 1.56, 0.64, 1) 250ms, 
                opacity .75s ease-out 250ms;
    line-height: 1.7;
}

.feature.right .feature-text {
    transform: translateX(3rem);
}

.feature.visible .feature-text {
    transform: translateX(0);
    opacity: 1;
}

.feature-text h2 {
    margin-bottom: 1rem;
}

.feature-text a {
    color: var(--color-primary);
    text-decoration: none;
    font-weight: 500;
}

.feature-text a:hover {
    color: var(--color-primary-hover);
}

.feature-image-container {
    align-content: center;
    flex: 2 1 400px;
    padding: 20px;
    transform: translateY(3rem) scale(0.95);
    opacity: 0;
    transition: transform .8s cubic-bezier(0.34, 1.56, 0.64, 1) 350ms,
                opacity .8s ease-out 350ms;
}

.feature.visible .feature-image-container {
    transform: translateY(0) scale(1);
    opacity: 1;
}

.feature-image {
    max-width: 100%;
    border-radius: 12px;
    box-shadow: 0 4px 20px var(--shadow-light), 0 2px 8px var(--shadow-medium);
    transition: transform .3s cubic-bezier(0.34, 1.56, 0.64, 1),
                box-shadow .3s ease;
}

.feature-image:hover {
    cursor: pointer;
    transform: scale(1.05);
    box-shadow: 0 8px 30px var(--shadow-hover-light), 0 4px 12px var(--shadow-hover-medium);
}

.left .feature-image-container .feature-image {
    float: right;
}

.right .feature-image-container .feature-image {
    float: left;
}

/* ===== ANKI FEATURE ===== */
.anki-feature {
    opacity: 0;
    transform: translateY(2rem);
    transition: transform .8s cubic-bezier(0.34, 1.56, 0.64, 1) 200ms, 
                opacity .8s ease-out 200ms;
}

.anki-feature.visible {
    opacity: 1;
    transform: translateY(0);
}

.anki-feature .feature-label {
    transform: translateY(-1rem) scale(0.95);
    opacity: 0;
    transition: transform .8s cubic-bezier(0.34, 1.56, 0.64, 1) 300ms,
                opacity .8s ease-out 300ms;
}

.anki-feature.visible .feature-label {
    transform: translateY(0) scale(1);
    opacity: 1;
}

.anki-feature-text,
.anki-feature-video {
    transform: translateY(2rem) scale(0.98);
    opacity: 0;
    transition: transform .8s cubic-bezier(0.34, 1.56, 0.64, 1) 400ms,
                opacity .8s ease-out 400ms;
}

.anki-feature.visible .anki-feature-text,
.anki-feature.visible .anki-feature-video {
    transform: translateY(0) scale(1);
    opacity: 1;
}

/* ===== SLIDESHOW ===== */
.slideshow-container {
    max-width: 1000px;
    position: relative;
    margin: auto;
}

.mySlides {
    position: relative;
    z-index: 1;
    display: none;
}

.prev,
.next {
    cursor: pointer;
    position: absolute;
    top: 50%;
    width: auto;
    margin-top: -36px;
    padding: 16px;
    color: var(--md-typeset-color);
    background-color: var(--md-code-bg-color);
    font-weight: bold;
    font-size: 18px;
    transition: transform 0.2s ease, opacity 0.3s ease;
    border-radius: 3px;
    user-select: none;
    opacity: 0.7;
}

.prev {
    left: -50px;
}

.next {
    right: -50px;
}

.prev:hover,
.next:hover {
    opacity: 1;
    transform: scale(1.1);
}

.dot {
    cursor: pointer;
    height: 15px;
    width: 15px;
    margin: 0 2px;
    background-color: var(--md-default-fg-color--lighter);
    border-radius: 50%;
    display: inline-block;
    transition: background-color 0.3s ease;
}

.active,
.dot:hover {
    background-color: var(--md-default-fg-color--light);
}

/* ===== THEME TOGGLE ===== */
.theme-image {
    transition: transform .15s ease-out;
    border-radius: 12px;
    box-shadow: 0 4px 20px var(--shadow-light), 0 2px 8px var(--shadow-medium);
}

.theme-image:hover {
    transform: scale(1.02);
    cursor: pointer;
    box-shadow: 0 8px 30px var(--shadow-hover-light), 0 4px 12px var(--shadow-hover-medium);
}

/* Default: light mode - hide dark images */
.theme-image.dark {
    display: none !important;
}

.theme-image:not(.dark) {
    display: block !important;
}

/* Dark mode: hide light images, show dark images */
[data-md-color-scheme="slate"] .theme-image.dark {
    display: block !important;
}

[data-md-color-scheme="slate"] .theme-image:not(.dark) {
    display: none !important;
}

/* ===== TOOLTIP ===== */
.tooltip {
    position: absolute;
    top: -32px;
    left: 0;
    right: 0;
    margin-inline: auto;
    width: fit-content;
    opacity: 0;
    visibility: hidden;
    transition: visibility .2s, opacity .2s;
    background: var(--md-default-bg-color);
    border: 1px solid var(--md-default-fg-color--lightest);
    box-shadow: var(--md-shadow-z2);
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 10px;
    color: var(--md-typeset-color);
}

.tooltip-container {
    position: relative;
}

.tooltip-container:hover .tooltip {
    visibility: visible;
    opacity: 1;
}

/* ===== UTILITIES ===== */
.demo {
    padding: 1rem;
    text-align: center;
}

.ext-link-icon {
    display: inline-flex;
    align-items: center;
    margin-left: 3px;
    color: var(--color-primary);
    transition: color 0.2s ease;
}

.ext-link-icon:hover {
    color: var(--color-primary-hover);
}

.bounce-icon {
    animation: bounce 0.5s cubic-bezier(0.5, 0.05, 1, 0.5) infinite alternate;
}

/* ===== ANIMATIONS ===== */
@keyframes bounce {
    from {
        transform: translateY(0.5px);
    }
    to {
        transform: translateY(-1px);
    }
}

/* ===== RESPONSIVE ===== */
@media screen and (min-width: 64rem) {
    .cta-buttons {
        grid-template-columns: repeat(3, 1fr);
    }

    .cta-buttons-2 a {
        width: auto;
    }
}

@media screen and (max-width: 768px) {
    .prev,
    .next {
        padding: 12px;
        font-size: 14px;
    }

    .prev {
        left: -10px;
    }

    .next {
        right: -10px;
    }
}