@import url('/assets/css/tokens.css');

:root {
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.5);
    --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.07);
    --shadow-inner: inset 0 2px 4px 0 rgba(0, 0, 0, 0.06);
}

[data-theme="dark"] {
    --glass-bg: rgba(23, 23, 23, 0.7);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
    --shadow-inner: inset 0 2px 4px 0 rgba(0, 0, 0, 0.5);
}

*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

body {
    min-height: 100vh;
    background: var(--bg-body);
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    color: var(--text-primary);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2rem 1rem;
    transition: background 0.4s cubic-bezier(0.4, 0, 0.2, 1), color 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    background-image:
        radial-gradient(circle at 15% 50%, rgba(37, 99, 235, 0.03), transparent 25%),
        radial-gradient(circle at 85% 30%, rgba(96, 165, 250, 0.03), transparent 25%);
    background-attachment: fixed;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Glassmorphism Utilities */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    border-radius: 1.5rem;
}

/* Header & Navigation */
/* Header & Navigation */
header {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    grid-template-areas:
        "back logo actions"
        "subtitle subtitle subtitle";
    align-items: center;
    gap: 1rem;
    margin-bottom: 3rem;
    padding: 0 1rem;
    max-width: 1200px;
}

header .app-logo {
    grid-area: logo;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    text-decoration: none;
    white-space: nowrap;
}

header .app-logo i,
header .app-logo svg {
    font-size: 1.5rem;
    color: var(--accent);
}

.header-actions {
    grid-area: actions;
    justify-self: end;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.back-link {
    grid-area: back;
    justify-self: start;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    padding: 0.6rem 1.2rem;
    border: 1px solid var(--border-subtle);
    border-radius: 2rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 500;
    background: var(--bg-card);
    box-shadow: var(--shadow-sm);
}

.back-link svg {
    width: 16px;
    height: 16px;
    transition: transform 0.3s ease;
}

.back-link:hover {
    color: var(--accent);
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.back-link:hover svg {
    transform: translateX(-3px);
}

header h1 {
    grid-area: logo;
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-primary);
    text-align: center;
    justify-self: center;
    margin: 0;
}

.subtitle {
    grid-area: subtitle;
    justify-self: center;
    text-align: center;
    font-size: 1rem;
    color: var(--text-secondary);
    font-weight: 400;
    margin-top: 0.25rem;
}

/* Theme Toggle - Modern Switch */
.theme-switch-wrapper {
    grid-area: actions;
    justify-self: end;
    display: flex;
    align-items: center;
}

.theme-toggle {
    width: 64px;
    height: 32px;
    padding: 0;
    border-radius: 20px;
    border: 1px solid var(--border-subtle);
    background: var(--bg-card);
    cursor: pointer;
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-inner);
}

.theme-toggle:hover {
    border-color: var(--accent);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.theme-toggle-track {
    position: absolute;
    inset: 3px;
    border-radius: 18px;
    display: flex;
    align-items: center;
}

.theme-toggle-thumb {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.3s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
}

[data-theme="dark"] .theme-toggle-thumb {
    transform: translateX(32px);
    background: var(--text-primary);
}

.theme-toggle svg {
    position: absolute;
    width: 14px;
    height: 14px;
    transition: opacity 0.3s ease, transform 0.3s ease, color 0.3s ease;
    stroke-width: 2.5;
}

.theme-toggle .sun-icon {
    color: #fff;
    opacity: 1;
}

.theme-toggle .moon-icon {
    color: var(--bg-body);
    opacity: 0;
    transform: scale(0.5) rotate(-45deg);
}

[data-theme="dark"] .theme-toggle .sun-icon {
    opacity: 0;
    transform: scale(0.5) rotate(45deg);
}

[data-theme="dark"] .theme-toggle .moon-icon {
    opacity: 1;
    transform: scale(1) rotate(0);
}

/* Footer */
footer {
    width: 100%;
    max-width: 1200px;
    margin-top: 3rem;
    padding: 1.5rem 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
    text-align: center;
    border-top: 1px solid var(--border-subtle);
}

footer a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

footer a:hover {
    color: var(--accent-hover);
}

/* Responsive */
@media (max-width: 768px) {
    body {
        padding: 1rem;
    }

    header {
        margin-bottom: 2rem;
        padding: 0;
        grid-template-columns: auto 1fr auto;
        gap: 0.5rem;
    }

    header .back-link {
        padding: 0.5rem;
        width: 36px;
        height: 36px;
        justify-content: center;
        border-radius: 50%;
    }

    header .back-link span {
        display: none;
    }

    header .app-logo {
        justify-self: center;
        font-size: 1.1rem;
    }

    header .theme-toggle,
    header .header-actions {
        justify-self: end;
    }

    footer {
        margin-top: 2rem;
        padding: 1rem;
        font-size: 0.8rem;
        flex-direction: column;
        gap: 0.25rem;
    }
}