/* ============================================
   SCARF THEME
   ============================================ */
body[data-theme="scarf"]:not(.dark) {
    --background: oklch(0.9911 0 0);
    --foreground: oklch(0.2046 0 0);
    --card: oklch(0.9911 0 0);
    --card-foreground: oklch(0.2046 0 0);
    --primary: oklch(0.496 0.1134 159.2071);
    --primary-foreground: oklch(1 0 0);
    --muted: oklch(0.9461 0 0);
    --muted-foreground: oklch(0.2435 0 0);
    --accent: oklch(0.9461 0 0);
    --border: oklch(0.9037 0 0);
    --ring: oklch(0.8348 0.1302 160.908);
    --font-sans: 'Outfit', sans-serif;
    --radius: 0.5rem;
    --shadow-sm: 0px 1px 3px 0px hsl(0 0% 0% / 0.09);
    --shadow: 0px 1px 3px 0px hsl(0 0% 0% / 0.17), 0px 1px 2px -1px hsl(0 0% 0% / 0.17);
    --shadow-md: 0px 1px 3px 0px hsl(0 0% 0% / 0.17), 0px 2px 4px -1px hsl(0 0% 0% / 0.17);
    --shadow-lg: 0px 1px 3px 0px hsl(0 0% 0% / 0.17), 0px 4px 6px -1px hsl(0 0% 0% / 0.17);
    --tracking-normal: 0.025em;
}

body[data-theme="scarf"].dark {
    --background: oklch(0.1822 0 0);
    --foreground: oklch(0.9288 0.0126 255.5078);
    --card: oklch(0.2046 0 0);
    --card-foreground: oklch(0.9288 0.0126 255.5078);
    --primary: oklch(0.4365 0.1044 156.7556);
    --primary-foreground: oklch(0.9213 0.0135 167.1556);
    --muted: oklch(0.2393 0 0);
    --muted-foreground: oklch(0.7122 0 0);
    --accent: oklch(0.3132 0 0);
    --border: oklch(0.2809 0 0);
    --ring: oklch(0.8003 0.1821 151.711);
    --font-sans: 'Outfit', sans-serif;
    --radius: 0.5rem;
    --shadow-sm: 0px 1px 3px 0px hsl(0 0% 0% / 0.09);
    --shadow: 0px 1px 3px 0px hsl(0 0% 0% / 0.17), 0px 1px 2px -1px hsl(0 0% 0% / 0.17);
    --shadow-md: 0px 1px 3px 0px hsl(0 0% 0% / 0.17), 0px 2px 4px -1px hsl(0 0% 0% / 0.17);
    --shadow-lg: 0px 1px 3px 0px hsl(0 0% 0% / 0.17), 0px 4px 6px -1px hsl(0 0% 0% / 0.17);
    --tracking-normal: 0.025em;
}

/* ============================================
   QUIET LUXURY THEME
   ============================================ */
body[data-theme="luxury"]:not(.dark) {
    --background: oklch(0.9582 0.0152 90.2357);
    --foreground: oklch(0.376 0.0225 64.3434);
    --card: oklch(0.9914 0.0098 87.4695);
    --card-foreground: oklch(0.376 0.0225 64.3434);
    --primary: oklch(0.618 0.0778 65.5444);
    --primary-foreground: oklch(1 0 0);
    --muted: oklch(0.9239 0.019 83.0636);
    --muted-foreground: oklch(0.5391 0.0387 71.1655);
    --accent: oklch(0.8348 0.0426 88.8064);
    --border: oklch(0.8606 0.0321 84.5881);
    --ring: oklch(0.618 0.0778 65.5444);
    --font-sans: 'Libre Baskerville', serif;
    --radius: 0.25rem;
    --shadow-sm: 2px 3px 5px 0px hsl(28 13% 20% / 0.06);
    --shadow: 2px 3px 5px 0px hsl(28 13% 20% / 0.12), 2px 1px 2px -1px hsl(28 13% 20% / 0.12);
    --shadow-md: 2px 3px 5px 0px hsl(28 13% 20% / 0.12), 2px 2px 4px -1px hsl(28 13% 20% / 0.12);
    --shadow-lg: 2px 3px 5px 0px hsl(28 13% 20% / 0.12), 2px 4px 6px -1px hsl(28 13% 20% / 0.12);
    --tracking-normal: 0em;
}

body[data-theme="luxury"].dark {
    --background: oklch(0.2747 0.0139 57.6523);
    --foreground: oklch(0.9239 0.019 83.0636);
    --card: oklch(0.3237 0.0155 59.0603);
    --card-foreground: oklch(0.9239 0.019 83.0636);
    --primary: oklch(0.7264 0.0581 66.6967);
    --primary-foreground: oklch(0.2747 0.0139 57.6523);
    --muted: oklch(0.2939 0.0125 62.1298);
    --muted-foreground: oklch(0.7982 0.0243 82.1078);
    --accent: oklch(0.4186 0.0281 56.3404);
    --border: oklch(0.3795 0.0181 57.128);
    --ring: oklch(0.7264 0.0581 66.6967);
    --font-sans: 'Libre Baskerville', serif;
    --radius: 0.25rem;
    --shadow-sm: 2px 3px 5px 0px hsl(28 13% 20% / 0.06);
    --shadow: 2px 3px 5px 0px hsl(28 13% 20% / 0.12), 2px 1px 2px -1px hsl(28 13% 20% / 0.12);
    --shadow-md: 2px 3px 5px 0px hsl(28 13% 20% / 0.12), 2px 2px 4px -1px hsl(28 13% 20% / 0.12);
    --shadow-lg: 2px 3px 5px 0px hsl(28 13% 20% / 0.12), 2px 4px 6px -1px hsl(28 13% 20% / 0.12);
    --tracking-normal: 0em;
}

/* ============================================
   GOLD THEME
   ============================================ */
body[data-theme="gold"]:not(.dark) {
    --background: oklch(1 0 0);
    --foreground: oklch(0.2686 0 0);
    --card: oklch(1 0 0);
    --card-foreground: oklch(0.2686 0 0);
    --primary: oklch(0.7686 0.1647 70.0804);
    --primary-foreground: oklch(0 0 0);
    --muted: oklch(0.9846 0.0017 247.8389);
    --muted-foreground: oklch(0.551 0.0234 264.3637);
    --accent: oklch(0.9869 0.0214 95.2774);
    --border: oklch(0.9276 0.0058 264.5313);
    --ring: oklch(0.7686 0.1647 70.0804);
    --font-sans: 'Inter', sans-serif;
    --radius: 0.375rem;
    --shadow-sm: 0px 4px 8px -1px hsl(0 0% 0% / 0.05);
    --shadow: 0px 4px 8px -1px hsl(0 0% 0% / 0.1), 0px 1px 2px -2px hsl(0 0% 0% / 0.1);
    --shadow-md: 0px 4px 8px -1px hsl(0 0% 0% / 0.1), 0px 2px 4px -2px hsl(0 0% 0% / 0.1);
    --shadow-lg: 0px 4px 8px -1px hsl(0 0% 0% / 0.1), 0px 4px 6px -2px hsl(0 0% 0% / 0.1);
    --tracking-normal: 0em;
}

body[data-theme="gold"].dark {
    --background: oklch(0.2046 0 0);
    --foreground: oklch(0.9219 0 0);
    --card: oklch(0.2686 0 0);
    --card-foreground: oklch(0.9219 0 0);
    --primary: oklch(0.7686 0.1647 70.0804);
    --primary-foreground: oklch(0 0 0);
    --muted: oklch(0.2393 0 0);
    --muted-foreground: oklch(0.7155 0 0);
    --accent: oklch(0.4732 0.1247 46.2007);
    --border: oklch(0.3715 0 0);
    --ring: oklch(0.7686 0.1647 70.0804);
    --font-sans: 'Inter', sans-serif;
    --radius: 0.375rem;
    --shadow-sm: 0px 4px 8px -1px hsl(0 0% 0% / 0.05);
    --shadow: 0px 4px 8px -1px hsl(0 0% 0% / 0.1), 0px 1px 2px -2px hsl(0 0% 0% / 0.1);
    --shadow-md: 0px 4px 8px -1px hsl(0 0% 0% / 0.1), 0px 2px 4px -2px hsl(0 0% 0% / 0.1);
    --shadow-lg: 0px 4px 8px -1px hsl(0 0% 0% / 0.1), 0px 4px 6px -2px hsl(0 0% 0% / 0.1);
    --tracking-normal: 0em;
}

/* ============================================
   BASE STYLES
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-sans);
    background-color: var(--background);
    color: var(--foreground);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0;
    letter-spacing: var(--tracking-normal);
    position: relative;
    overflow-x: hidden;
    transition: background-color 0.3s ease, color 0.3s ease, font-family 0.3s ease;
}

/* ============================================
   THEME HEADER (Mobile First)
   ============================================ */
.theme-header {
    width: 100%;
    padding: 16px 20px 20px;
    background: var(--card);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    transition: all 0.3s ease;
}

.theme-container {
    max-width: 680px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.theme-selector {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
}

.theme-toggle-btn {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--muted);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: var(--shadow-sm);
    position: relative;
}

.theme-toggle-btn:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow);
}

.theme-toggle-btn .sun-icon,
.theme-toggle-btn .moon-icon {
    position: absolute;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    color: var(--foreground);
}

.theme-toggle-btn:not(.dark) .moon-icon {
    opacity: 0;
    transform: rotate(-180deg) scale(0.3);
}

.theme-toggle-btn:not(.dark) .sun-icon {
    opacity: 1;
    transform: rotate(0deg) scale(1);
}

.theme-toggle-btn.dark .sun-icon {
    opacity: 0;
    transform: rotate(180deg) scale(0.3);
}

.theme-toggle-btn.dark .moon-icon {
    opacity: 1;
    transform: rotate(0deg) scale(1);
}

.theme-dropdown-wrapper {
    display: none;
    flex-direction: column;
    gap: 6px;
}

.theme-options {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
}

.theme-option {
    padding: 8px 16px;
    background: var(--muted);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    font-family: var(--font-sans);
    font-size: 13px;
    font-weight: 500;
    color: var(--card-foreground);
}

.theme-option:hover {
    background: var(--accent);
    transform: translateY(-1px);
}

.theme-option.active {
    background: var(--primary);
    color: var(--primary-foreground);
    border-color: var(--primary);
}

.theme-label {
    display: none;
    font-size: 11px;
    font-weight: 500;
    color: var(--muted-foreground);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.theme-select {
    display: none;
    padding: 8px 36px 8px 12px;
    background: var(--muted);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--foreground);
    font-family: var(--font-sans);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    outline: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='none' stroke='%23204639' stroke-width='2' d='M2 4l4 4 4-4'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 12px;
}

body.dark .theme-select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='none' stroke='%23e0f2f1' stroke-width='2' d='M2 4l4 4 4-4'/%3E%3C/svg%3E");
}

.theme-select:hover {
    border-color: var(--ring);
}

.theme-select:focus {
    outline: 2px solid var(--ring);
    outline-offset: 2px;
}

.theme-hint {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 12px;
    text-align: center;
}

.theme-hint.show {
    max-height: 50px;
    opacity: 1;
    margin-top: 4px;
}

.hint-text {
    color: var(--muted-foreground);
    line-height: 1.4;
}

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

.hint-close {
    flex-shrink: 0;
    background: transparent;
    border: none;
    color: var(--muted-foreground);
    font-size: 18px;
    cursor: pointer;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
    line-height: 1;
}

.hint-close:hover {
    background: var(--muted);
    color: var(--foreground);
}

/* ============================================
   SNACKBAR
   ============================================ */
.snackbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: var(--card);
    border-bottom: 1px solid var(--border);
    padding: 14px 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    transform: translateY(-100%);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.3s ease, border-color 0.3s ease;
}

.snackbar.show {
    transform: translateY(0);
}

/* Snackbar uses primary color background */
.snackbar {
    --snackbar-bg: var(--primary);
    --snackbar-fg: var(--primary-foreground);
    --snackbar-border: var(--primary);
    --snackbar-muted: var(--primary);
    --snackbar-muted-fg: var(--primary-foreground);
    background: var(--snackbar-bg);
    border-bottom-color: var(--snackbar-border);
}

.snackbar-text {
    font-size: 13px;
    color: var(--snackbar-muted-fg, var(--muted-foreground));
    line-height: 1.5;
}

.snackbar-text a {
    color: #ffffff;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
}

body[data-theme="gold"] .snackbar-text a {
    color: #000000;
}

.snackbar-close {
    flex-shrink: 0;
    background: transparent;
    border: none;
    color: var(--snackbar-muted-fg, var(--muted-foreground));
    font-size: 20px;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
    line-height: 1;
}

.snackbar-close:hover {
    background: var(--snackbar-muted, var(--muted));
    color: var(--snackbar-fg, var(--foreground));
}

/* Add padding to body when snackbar is open to push content down */
body.snackbar-open {
    padding-top: 56px;
}

/* ============================================
   MAIN CONTAINER
   ============================================ */
.container {
    width: 100%;
    max-width: 680px;
    padding: 24px 20px 40px;
    position: relative;
    z-index: 1;
    flex: 1;
}

.profile {
    text-align: center;
    margin-bottom: 32px;
    animation: fadeInDown 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.avatar {
    width: 100px;
    height: 100px;
    margin: 0 auto 16px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid var(--border);
    background: var(--muted);
    box-shadow: var(--shadow-lg);
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.avatar:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 0 0 2px var(--ring), var(--shadow-lg);
}

.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile h1 {
    color: var(--foreground);
    font-size: 22px;
    margin-bottom: 8px;
    font-weight: 600;
}

.bio {
    color: var(--muted-foreground);
    font-size: 14px;
    line-height: 1.6;
}

.links {
    display: flex;
    flex-direction: column;
    gap: 10px;
    animation: fadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    animation-delay: 0.1s;
    animation-fill-mode: both;
}

.link-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 18px;
    display: flex;
    align-items: center;
    gap: 14px;
    text-decoration: none;
    color: var(--card-foreground);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
}

.link-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--primary) 0%, transparent 100%);
    opacity: 0;
    transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: none;
}

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

.link-card:hover::before {
    opacity: 0.05;
}

.link-card:active {
    transform: translateY(0);
}

.link-icon {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
    color: var(--primary);
}

.link-icon svg {
    width: 100%;
    height: 100%;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.link-card:hover .link-icon svg {
    transform: scale(1.1);
}

.link-content {
    flex: 1;
    position: relative;
    z-index: 1;
}

.link-content strong {
    display: block;
    color: var(--card-foreground);
    font-size: 15px;
    margin-bottom: 2px;
    font-weight: 500;
}

.link-content span {
    color: var(--muted-foreground);
    font-size: 13px;
    display: block;
    line-height: 1.4;
}

/* Featured card styling */
.link-card.featured {
    padding: 18px;
}

.arrow-icon {
    color: var(--muted-foreground);
    flex-shrink: 0;
    opacity: 0;
    transform: translateX(-8px);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    z-index: 1;
}

.link-card:hover .arrow-icon {
    opacity: 1;
    transform: translateX(0);
    color: var(--primary);
}

/* ============================================
   FOOTER
   ============================================ */
footer {
    margin-top: 5vh;
    animation: fadeIn 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    animation-delay: 0.2s;
    animation-fill-mode: both;
}

.social-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
}

.social-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.edu-section,
.scarf-section {
    align-items: center;
}

.social-label {
    font-size: 10px;
    font-weight: 600;
    color: var(--muted-foreground);
    text-transform: uppercase;
    letter-spacing: 0.2em;
    opacity: 0.7;
}

.social-links {
    display: flex;
    align-items: center;
    gap: 8px;
}

.social-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    color: var(--foreground);
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    border-radius: 50%;
    background: var(--muted);
    border: 1px solid var(--border);
}

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

.social-icon {
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    stroke: var(--foreground);
    width: 18px;
    height: 18px;
}

.social-link:hover .social-icon {
    transform: scale(1.15);
}

.social-divider-vertical {
    width: 1px;
    height: 60px;
    background: var(--border);
    opacity: 0.5;
    flex-shrink: 0;
}

/* Stagger animations for links */
.links .link-card:nth-child(1) { animation-delay: 0.1s; }
.links .link-card:nth-child(2) { animation-delay: 0.15s; }
.links .link-card:nth-child(3) { animation-delay: 0.2s; }

/* ============================================
   DESKTOP OPTIMIZATIONS
   ============================================ */
@media (min-width: 600px) {
    .theme-header {
        padding: 20px 24px 24px;
    }

    .theme-container {
        max-width: 680px;
        flex-direction: row;
        justify-content: space-between;
    }

    .theme-selector {
        gap: 20px;
    }

    /* Hide theme buttons on desktop */
    .theme-options {
        display: none;
    }

    /* Show dropdown on desktop */
    .theme-dropdown-wrapper {
        display: flex;
        flex-direction: row;
        align-items: center;
        gap: 12px;
    }

    .theme-label {
        display: block;
        margin-bottom: 0;
    }

    .theme-select {
        display: block;
        min-width: 160px;
    }

    .container {
        padding: 40px 24px 60px;
    }

    .profile {
        margin-bottom: 40px;
    }

    .profile h1 {
        font-size: 28px;
    }

    .bio {
        font-size: 15px;
    }

    .links {
        gap: 12px;
    }

    .link-card {
        padding: 18px 22px;
    }

    .link-content strong {
        font-size: 16px;
    }

    .link-content span {
        font-size: 14px;
    }

    .link-card.featured {
        padding: 22px;
    }

    footer {
        margin-top: 6vh;
    }

    .social-container {
        gap: 24px;
    }

    .social-divider-vertical {
        height: 70px;
    }

    .theme-hint {
        font-size: 13px;
    }
}

/* Animations */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}
