/* View Transitions */
@keyframes fade-in {
    from {
        opacity: 0;
    }
}

@keyframes fade-out {
    to {
        opacity: 0;
    }
}

@keyframes slide-from-right {
    from {
        transform: translateX(100%);
    }
}

@keyframes slide-to-left {
    to {
        transform: translateX(-100%);
    }
}

::view-transition-old(root) {
    animation: 90ms cubic-bezier(0.4, 0, 1, 1) both fade-out,
        300ms cubic-bezier(0.4, 0, 0.2, 1) both slide-to-left;
}

::view-transition-new(root) {
    animation: 210ms cubic-bezier(0, 0, 0.2, 1) 90ms both fade-in,
        300ms cubic-bezier(0.4, 0, 0.2, 1) both slide-from-right;
}

:root {
    --background: #000000;
    --foreground: #ffffff;
    --muted: #27272a;
    --muted-foreground: #a1a1aa;
    --border: #27272a;
    --input: #27272a;
    --primary: #ffffff;
    --primary-foreground: #000000;
    --accent: #18181b;
    --accent-highlight: #27272a;
    --heading-color: #ffffff;
    --text-color: #a1a1aa;
    --link-color: #3b82f6;
    --code-background: #1e1e1e;
    --slide-padding: 2.5rem;
    --slide-width: min(900px, 90vw);
    --dot-size: 0.8px;
    --dot-space: 22px;
    --scrollbar-width: 14px;
    --scrollbar-height: 14px;
    scroll-behavior: smooth;
}

/* Custom Scrollbars */
* {
    scrollbar-width: var(--scrollbar-width);
    scrollbar-color: var(--accent-highlight) var(--accent);
}

/* Webkit Scrollbars */
::-webkit-scrollbar {
    width: var(--scrollbar-width);
    height: var(--scrollbar-height);
}

::-webkit-scrollbar-track {
    background: var(--accent);
    border-radius: 8px;
}

::-webkit-scrollbar-thumb {
    background: var(--accent-highlight);
    border: 3px solid var(--accent);
    border-radius: 8px;
    transition: background 0.2s;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--muted-foreground);
}

::-webkit-scrollbar-corner {
    background: var(--accent);
}

/* Hide scrollbars on mobile devices while preserving functionality */
@media (max-width: 768px) {
    :root {
        --scrollbar-width: 4px;
        --scrollbar-height: 4px;
    }

    ::-webkit-scrollbar-thumb {
        border-width: 1px;
    }
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--background);
    background-image:
        radial-gradient(rgba(39, 39, 42, 0.3) var(--dot-size), transparent var(--dot-size)),
        radial-gradient(rgba(39, 39, 42, 0.3) var(--dot-size), transparent var(--dot-size));
    background-size: var(--dot-space) var(--dot-space);
    background-position: 0 0, calc(var(--dot-space) / 2) calc(var(--dot-space) / 2);
    color: var(--foreground);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    line-height: 1.6;
    padding-top: 5rem;
}

.container {
    flex: 1;
    width: 100%;
    max-width: 500px;
    padding: 2rem;
    margin: 0 auto 4rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.form-container {
    background-color: var(--accent);
    padding: 2rem;
    border-radius: 0.5rem;
    border: 1px solid var(--border);
    width: 100%;
}

h1 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 2rem;
    text-align: center;
}

.form-group {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
    color: var(--muted-foreground);
}

input,
select {
    width: 100%;
    padding: 0.75rem;
    background-color: var(--input);
    border: 1px solid var(--border);
    border-radius: 0.375rem;
    color: var(--foreground);
    font-size: 0.875rem;
    transition: border-color 0.2s;
}

input:focus,
select:focus {
    outline: none;
    border-color: var(--primary);
}

.submit-btn {
    width: 100%;
    padding: 0.75rem;
    background-color: var(--primary);
    color: var(--primary-foreground);
    border: none;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background-color: var(--accent-highlight);
    color: var(--muted-foreground);
}

.submit-btn:disabled:hover {
    transform: none;
    opacity: 0.6;
}

.submit-btn:hover:not(:disabled) {
    opacity: 0.9;
    transform: translateY(-1px);
}

/* Slide styles */
.slides-container {
    padding: 2rem;
    width: 100%;
    max-width: var(--slide-width);
    margin: 0 auto;
}

.slide {
    background-color: var(--accent);
    padding: var(--slide-padding);
    margin-bottom: 2rem;
    border-radius: 0.75rem;
    border: 1px solid var(--border);
    transition: transform 0.2s, border-color 0.2s;
    position: relative;
    overflow: hidden;
}

@media (min-width: 768px) {
    .slide {
        aspect-ratio: 16/9;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }

    /* Image-only slides */
    .slide:has(> img:only-child) {
        padding: 0;
    }

    .slide:has(> img:only-child) img {
        position: static;
        margin: 0;
        border-radius: 0.75rem;
        aspect-ratio: 16/9;
        object-fit: cover;
        width: 100%;
        height: 100%;
    }

    /* Regular slides with images */
    .slide img:not(:only-child) {
        width: calc(100% - var(--slide-padding) * 2);
        height: auto;
        margin: 1.5rem auto;
        display: block;
        border-radius: 0.5rem;
        box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    }
}

.slide:hover {
    border-color: var(--accent-highlight);
    transform: translateY(-2px);
}

/* Markdown Content Styles */
.slide h1 {
    color: var(--heading-color);
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1rem;
    text-align: left;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.slide h2 {
    color: var(--heading-color);
    font-size: 1.5rem;
    font-weight: 600;
    margin: 1.5rem 0 1rem;
    line-height: 1.3;
}

.slide h3 {
    color: var(--heading-color);
    font-size: 1.25rem;
    font-weight: 600;
    margin: 1rem 0 0.75rem;
}

.slide p {
    color: var(--text-color);
    font-size: 1rem;
    line-height: 1.7;
    margin-bottom: 1rem;
}

.slide ul,
.slide ol {
    color: var(--text-color);
    margin: 1rem 0;
    padding-left: 1.25rem;
}

.slide li {
    margin-bottom: 0.5rem;
    font-size: 1rem;
    line-height: 1.6;
}

.slide a {
    color: var(--link-color);
    text-decoration: none;
    transition: opacity 0.2s;
}

.slide a:hover {
    opacity: 0.8;
}

.slide img {
    max-width: 100%;
    height: auto;
    border-radius: 0.75rem;
    margin: 1.5rem 0;
    display: block;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.slide code {
    background-color: var(--code-background);
    padding: 0.2em 0.4em;
    border-radius: 0.25rem;
    font-size: 0.875em;
    font-family: monospace;
}

.slide pre {
    background-color: var(--code-background);
    padding: 1rem;
    border-radius: 0.5rem;
    overflow-x: auto;
    margin: 1.5rem 0;
}

.slide pre code {
    background-color: transparent;
    padding: 0;
    font-size: 0.875rem;
    line-height: 1.7;
}

.slide blockquote {
    border-left: 4px solid var(--accent-highlight);
    padding-left: 1rem;
    margin: 1.5rem 0;
    color: var(--muted-foreground);
    font-style: italic;
}

.slide table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    font-size: 0.875rem;
}

.slide th,
.slide td {
    border: 1px solid var(--border);
    padding: 0.75rem;
    text-align: left;
}

.slide th {
    background-color: var(--accent-highlight);
    font-weight: 600;
}

.navigation {
    margin-top: 3rem;
    text-align: center;
}

/* Mobile responsive */
@media (max-width: 768px) {
    :root {
        --slide-padding: 1.5rem;
    }

    .slides-container {
        padding: 1rem;
    }

    .slide {
        margin-bottom: 1rem;
    }

    .slide h1 {
        font-size: 1.75rem;
    }

    .slide h2 {
        font-size: 1.25rem;
    }

    .slide h3 {
        font-size: 1.125rem;
    }

    .slide p,
    .slide li {
        font-size: 0.875rem;
    }
}

@media (max-width: 640px) {
    :root {
        --slide-padding: 1rem;
    }

    .container {
        padding: 1rem;
    }

    .form-container {
        padding: 1.5rem;
    }

    .slide h1 {
        font-size: 1.5rem;
    }

    .slide table {
        font-size: 0.75rem;
    }
}

/* Mobile styles for images */
@media (max-width: 767px) {
    .slide {
        overflow: hidden;
        padding: var(--slide-padding);
    }

    /* Image-only slides */
    .slide:has(> img:only-child) {
        padding: 0;
    }

    .slide:has(> img:only-child) img {
        width: 100%;
        margin: 0;
        border-radius: 0.75rem;
        aspect-ratio: 16/9;
        object-fit: cover;
    }

    /* Regular slides with images */
    .slide img:not(:only-child) {
        width: calc(100% + var(--slide-padding) * 2);
        margin-left: calc(var(--slide-padding) * -1);
        margin-right: calc(var(--slide-padding) * -1);
        margin-top: 1rem;
        margin-bottom: 1rem;
        border-radius: 0;
    }
}

.error-message {
    background-color: rgba(220, 38, 38, 0.1);
    color: #ef4444;
    padding: 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    border: 1px solid rgba(220, 38, 38, 0.2);
    font-size: 0.875rem;
    text-align: center;
}

/* Header and Footer Styles */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background-color: var(--accent);
    border-bottom: 1px solid var(--border);
    padding: 1rem 2rem;
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.site-header .logo {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--foreground);
    text-decoration: none;
    display: flex;
    align-items: center;
}

.logo-image {
    height: 32px;
    width: auto;
    display: block;
}

@media (max-width: 768px) {
    .logo-image {
        height: 28px;
    }
}

.site-header .nav-links {
    display: flex;
    gap: 1.5rem;
}

.site-header .nav-links a {
    color: var(--muted-foreground);
    text-decoration: none;
    font-size: 0.875rem;
    transition: color 0.2s;
}

.site-header .nav-links a:hover {
    color: var(--foreground);
}

.site-footer {
    background-color: var(--accent);
    border-top: 1px solid var(--border);
    padding: 1rem 2rem;
    text-align: center;
    margin-top: auto;
}

.site-footer p {
    color: var(--muted-foreground);
    font-size: 0.875rem;
}

.site-footer a {
    color: var(--muted-foreground);
    text-decoration: none;
    transition: color 0.2s ease;
    padding: 0 0.5rem;
}

.site-footer a:hover {
    color: var(--foreground);
}

/* Adjust footer for mobile */
@media (max-width: 768px) {
    .site-footer {
        padding: 1rem;
    }
    
    .site-footer p {
        font-size: 0.8rem;
    }
    
    .site-footer a {
        padding: 0 0.3rem;
    }
}

/* Adjust main content for header and footer */
body {
    padding: 5rem 0;
}

@media (max-width: 768px) {
    .site-header {
        padding: 1rem;
    }

    .site-header .nav-links {
        gap: 1rem;
    }

    .site-footer {
        padding: 1rem;
    }
}

/* Adjust main content for header only */
body {
    padding-top: 5rem;
    padding-bottom: 0;
}

/* Lazy Loading Image Styles */
.image-placeholder,
.image-container {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--accent-highlight);
    border-radius: 0.75rem;
    overflow: hidden;
    position: relative;
    aspect-ratio: 16/9;
}

.skeleton-loader {
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg,
            var(--accent-highlight) 25%,
            var(--accent) 50%,
            var(--accent-highlight) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
    transition: opacity 0.3s ease-out;
}

.image-container.loaded .skeleton-loader {
    opacity: 0;
    pointer-events: none;
}

@keyframes shimmer {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

.slide-image {
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: relative;
    z-index: 2;
}

.slide-image.loaded {
    opacity: 1;
    display: block !important;
    width: 100% !important;
}

/* Adjust image placeholder for mobile */
@media (max-width: 767px) {

    .image-placeholder,
    .image-container {
        margin: 0;
        border-radius: 0;
    }

    .image-placeholder:not(:only-child),
    .image-container:not(:only-child) {
        width: calc(100% + var(--slide-padding) * 2);
        margin-left: calc(var(--slide-padding) * -1);
        margin-right: calc(var(--slide-padding) * -1);
        margin-top: 1rem;
        margin-bottom: 1rem;
    }
}

/* Features Section */
.features {
    padding: 2rem 2rem 6rem;
    max-width: 1200px;
    margin: 0 auto;
}

.features h2 {
    text-align: center;
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 3rem;
    background: linear-gradient(to right, #fff, #a1a1aa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    padding: 0 1rem;
}

.feature-card {
    background-color: var(--accent);
    padding: 2rem;
    border-radius: 1rem;
    border: 1px solid var(--border);
    transition: transform 0.2s, border-color 0.2s;
}

.feature-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
}

.feature-icon {
    width: 48px;
    height: 48px;
    background-color: var(--accent-highlight);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.feature-icon svg {
    color: var(--primary);
}

.feature-card h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--foreground);
}

.feature-card p {
    color: var(--muted-foreground);
    line-height: 1.6;
}

/* About Section */
.about {
    padding: 6rem 2rem;
    background-color: var(--accent);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.about-content {
    max-width: 800px;
    margin: 0 auto;
}

.about h2 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 2rem;
    background: linear-gradient(to right, #fff, #a1a1aa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.about p {
    color: var(--muted-foreground);
    line-height: 1.8;
    margin-bottom: 1.5rem;
    font-size: 1.125rem;
}

/* FAQ Section */
.faq {
    padding: 6rem 2rem;
    max-width: 1000px;
    margin: 0 auto;
}

.faq h2 {
    text-align: center;
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 3rem;
    background: linear-gradient(to right, #fff, #a1a1aa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.faq-grid {
    display: grid;
    gap: 1.5rem;
}

.faq-item {
    background-color: var(--accent);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    padding: 1.5rem;
    transition: border-color 0.2s;
}

.faq-item:hover {
    border-color: var(--primary);
}

.faq-item h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--foreground);
    margin-bottom: 1rem;
}

.faq-content p {
    color: var(--muted-foreground);
    line-height: 1.6;
}

/* Responsive Adjustments */
@media (max-width: 768px) {

    .features,
    .about,
    .faq {
        padding: 4rem 1.5rem;
    }

    .features h2,
    .about h2,
    .faq h2 {
        font-size: 1.75rem;
    }

    .feature-card {
        padding: 1.5rem;
    }

    .about p {
        font-size: 1rem;
    }
}

@media (max-width: 640px) {

    .features,
    .about,
    .faq {
        padding: 3rem 1rem;
    }

    .features h2,
    .about h2,
    .faq h2 {
        font-size: 1.5rem;
    }

    .features-grid {
        grid-template-columns: 1fr;
    }

    .feature-card {
        padding: 1.25rem;
    }
}

.hero {
    text-align: center;
    padding: 4rem 2rem 2rem;
    max-width: 800px;
    margin: 0 auto;
    animation: fadeIn 0.5s ease-out;
}

/* Image Loading and Error Styles */
.image-container {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--accent-highlight);
    border-radius: 0.75rem;
    overflow: hidden;
    position: relative;
    aspect-ratio: 16/9;
}

.skeleton-loader {
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg,
            var(--accent-highlight) 25%,
            var(--accent) 50%,
            var(--accent-highlight) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
    transition: opacity 0.3s ease-out;
}

.image-container.loaded .skeleton-loader {
    opacity: 0;
    pointer-events: none;
}

.slide-image {
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: relative;
    z-index: 2;
}

.slide-image.loaded {
    opacity: 1;
    display: block !important;
}

.error-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 2rem;
    text-align: center;
    height: 100%;
}

.error-icon {
    width: 2.5rem;
    height: 2.5rem;
    color: #ef4444;
}

.error-message {
    color: var(--muted-foreground);
    font-size: 0.875rem;
}

.retry-button {
    padding: 0.5rem 1rem;
    background-color: var(--accent-highlight);
    color: var(--foreground);
    border: 1px solid var(--border);
    border-radius: 0.375rem;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s;
}

.retry-button:hover {
    background-color: var(--muted);
}

.retry-message {
    color: var(--muted-foreground);
    font-size: 0.75rem;
    margin-top: 0.5rem;
    text-align: center;
}

@keyframes shimmer {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* Adjust image container for mobile */
@media (max-width: 767px) {
    .image-container {
        margin: 0;
        border-radius: 0;
    }

    .image-container:not(:only-child) {
        width: calc(100% + var(--slide-padding) * 2);
        margin-left: calc(var(--slide-padding) * -1);
        margin-right: calc(var(--slide-padding) * -1);
        margin-top: 1rem;
        margin-bottom: 1rem;
    }
}

.button-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.loading-state {
    display: none;
    align-items: center;
    gap: 0.5rem;
}

.normal-state {
    display: inline-block;
}

.submit-btn.htmx-request .loading-state {
    display: inline-flex;
}

.submit-btn.htmx-request .normal-state {
    display: none;
}

.submit-btn {
    position: relative;
}

.submit-btn[disabled] {
    opacity: 0.7;
    cursor: not-allowed;
}

.spinner {
    animation: spin 1s linear infinite;
    width: 1.2em;
    height: 1.2em;
}

.spinner-circle {
    stroke: currentColor;
    stroke-linecap: round;
    animation: spinner 1.5s ease-in-out infinite;
}

@keyframes spin {
    100% {
        transform: rotate(360deg);
    }
}

@keyframes spinner {
    0% {
        stroke-dasharray: 1, 150;
        stroke-dashoffset: 0;
    }

    50% {
        stroke-dasharray: 90, 150;
        stroke-dashoffset: -35;
    }

    100% {
        stroke-dasharray: 90, 150;
        stroke-dashoffset: -124;
    }
}

.hero {
    text-align: center;
    padding: 4rem 2rem;
    max-width: 800px;
    margin: 0 auto;
    animation: fadeIn 0.5s ease-out;
}

.hero-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.hero h1 {
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1.2;
    background: linear-gradient(to right, #fff, #a1a1aa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin: 0;
}

.hero p {
    font-size: 1.25rem;
    color: var(--muted-foreground);
    max-width: 600px;
    margin: 0;
}

.cta-button {
    display: inline-block;
    background: linear-gradient(to right, var(--primary), var(--link-color));
    color: var(--background);
    padding: 1rem 2rem;
    border-radius: 0.5rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
    border: none;
    cursor: pointer;
}

.cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 768px) {
    .hero {
        padding: 3rem 1.5rem;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .hero p {
        font-size: 1.125rem;
    }
}

@media (max-width: 640px) {
    .hero {
        padding: 2rem 1rem;
    }

    .hero h1 {
        font-size: 1.75rem;
    }

    .hero p {
        font-size: 1rem;
    }
}

.message-container {
    background-color: var(--accent);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    padding: 2rem;
    margin-bottom: 2rem;
    text-align: center;
}

.message-content h3 {
    color: var(--foreground);
    font-size: 1.25rem;
    margin-bottom: 1rem;
}

.message-content p {
    color: var(--muted-foreground);
    margin-bottom: 1.5rem;
}

.message-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.secondary-btn {
    padding: 0.75rem 1.5rem;
    background-color: var(--accent-highlight);
    color: var(--foreground);
    border: 1px solid var(--border);
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.secondary-btn:hover {
    background-color: var(--muted);
}

.form-container {
    transition: opacity 0.3s ease;
}

.form-container.hidden {
    opacity: 0;
    pointer-events: none;
}

.theme-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem;
    color: var(--muted-foreground);
}

.navigation {
    display: flex;
    gap: 1rem;
    align-items: center;
    justify-content: center;
}

.theme-selector {
    position: relative;
}

.theme-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background-color: var(--accent);
    border: 1px solid var(--border);
    border-radius: 0.375rem;
    color: var(--foreground);
    cursor: pointer;
    transition: all 0.2s;
}

.theme-btn:hover {
    background-color: var(--accent-highlight);
}

.theme-dropdown {
    position: absolute;
    bottom: 100%;
    left: 0;
    margin-bottom: 0.5rem;
    background-color: var(--accent);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    padding: 1rem;
    min-width: 300px;
    display: none;
    z-index: 10;
}

.theme-dropdown.show {
    display: block;
}

.theme-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    max-height: 400px;
    overflow-y: auto;
}

.theme-option {
    cursor: pointer;
}

.theme-preview {
    aspect-ratio: 16/9;
    border-radius: 0.375rem;
    border: 1px solid var(--border);
    overflow: hidden;
    display: flex;
    align-items: flex-end;
    padding: 0.5rem;
    background-size: cover;
    background-position: center;
    transition: all 0.2s;
}

.theme-preview:hover {
    transform: scale(1.05);
}

.theme-preview span {
    font-size: 0.75rem;
    color: var(--foreground);
    background-color: rgba(0, 0, 0, 0.7);
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.theme-option.selected .theme-preview {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary);
}

/* Scrollbar styles for theme grid */
.theme-grid::-webkit-scrollbar {
    width: 8px;
}

.theme-grid::-webkit-scrollbar-track {
    background: var(--accent);
    border-radius: 4px;
}

.theme-grid::-webkit-scrollbar-thumb {
    background: var(--accent-highlight);
    border-radius: 4px;
}

.theme-grid::-webkit-scrollbar-thumb:hover {
    background: var(--muted);
}

.button-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.loading-state {
    display: none;
    align-items: center;
    gap: 0.5rem;
}

.normal-state {
    display: inline-block;
}

.submit-btn.loading .loading-state {
    display: inline-flex;
}

.submit-btn.loading .normal-state {
    display: none;
}

.spinner {
    animation: spin 1s linear infinite;
    width: 1.2em;
    height: 1.2em;
}

.spinner-circle {
    stroke: currentColor;
    stroke-linecap: round;
    animation: spinner 1.5s ease-in-out infinite;
}

@keyframes spin {
    100% {
        transform: rotate(360deg);
    }
}

@keyframes spinner {
    0% {
        stroke-dasharray: 1, 150;
        stroke-dashoffset: 0;
    }

    50% {
        stroke-dasharray: 90, 150;
        stroke-dashoffset: -35;
    }

    100% {
        stroke-dasharray: 90, 150;
        stroke-dashoffset: -124;
    }
}

.color-selector {
    position: relative;
}

.color-dropdown {
    position: absolute;
    bottom: 100%;
    left: 0;
    margin-bottom: 0.5rem;
    background-color: var(--accent);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    padding: 1rem;
    min-width: 300px;
    display: none;
    z-index: 10;
}

@media (max-width: 768px) {
    .color-dropdown {
        position: fixed;
        bottom: auto;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        margin: 0;
        width: 90%;
        max-width: 350px;
        min-width: auto;
    }

    .color-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .color-preview {
        aspect-ratio: auto;
        padding: 0.75rem;
    }
}

.color-dropdown.show {
    display: block;
}

.color-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.color-option {
    cursor: pointer;
}

.color-preview {
    aspect-ratio: 16/9;
    border-radius: 0.375rem;
    border: 1px solid var(--border);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    transition: all 0.2s;
}

.color-preview:hover {
    transform: scale(1.05);
}

.color-preview span {
    font-size: 0.875rem;
    color: var(--foreground);
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    background-color: var(--accent);
}

.color-option.selected .color-preview {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary);
}

.theme-option.hidden {
    display: none;
}

.show-more-btn {
    grid-column: 1 / -1;
    padding: 0.75rem;
    background-color: var(--accent-highlight);
    border: 1px solid var(--border);
    border-radius: 0.375rem;
    color: var(--foreground);
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 0.5rem;
    text-align: center;
}

.show-more-btn:hover {
    background-color: var(--muted);
}

.image-error {
    background-color: var(--accent);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    padding: 2rem;
    text-align: center;
}

.error-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.error-icon {
    width: 2.5rem;
    height: 2.5rem;
    color: #ef4444;
}

.error-message {
    color: var(--muted-foreground);
    font-size: 0.875rem;
}

.retry-button {
    padding: 0.5rem 1rem;
    background-color: var(--accent-highlight);
    border: 1px solid var(--border);
    border-radius: 0.375rem;
    color: var(--foreground);
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s;
}

.retry-button:hover {
    background-color: var(--muted);
}

.retry-message {
    color: var(--muted-foreground);
    font-size: 0.75rem;
    margin-top: 0.5rem;
    text-align: center;
}

/* Legal Pages Styles */
.legal-content {
    background-color: var(--accent);
    padding: 2rem;
    border-radius: 0.75rem;
    border: 1px solid var(--border);
}

.legal-content h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--heading-color);
    text-align: left;
}

.legal-content h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 2rem 0 1rem;
    color: var(--heading-color);
}

.legal-content p {
    color: var(--text-color);
    line-height: 1.7;
    margin-bottom: 1rem;
}

.legal-content section {
    margin-bottom: 2rem;
}

.legal-content ul {
    list-style-type: disc;
    margin: 1rem 0;
    padding-left: 1.5rem;
}

.legal-content li {
    color: var(--text-color);
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

.legal-content a {
    color: var(--link-color);
    text-decoration: none;
    transition: opacity 0.2s;
}

.legal-content a:hover {
    opacity: 0.8;
}

@media (max-width: 768px) {
    .legal-content {
        padding: 1.5rem;
    }

    .legal-content h1 {
        font-size: 1.75rem;
    }

    .legal-content h2 {
        font-size: 1.25rem;
    }
}