/**
 * GoSeedUp Theme System — 3 variants.
 * Apply via <html data-theme="ios26|apple|dark"> on root element.
 *
 * Default = ios26 (iOS 26 Liquid Glass vibe).
 * Theme toggle in /settings/appearance, persisted to cookie + localStorage.
 *
 * Each theme overrides the design tokens defined in app.blade.php :root.
 * Components stay theme-agnostic — they consume var(--*).
 *
 * Extra theme-specific tokens:
 *   --glass-blur     : backdrop-filter for translucent surfaces
 *   --surface-glass  : translucent variant of --surface
 *   --hairline       : extra-thin border for clean themes
 *   --accent-glow    : box-shadow glow for hover (dark theme)
 *   --radius-pill    : maximum rounded pill (24px+ for ios26)
 *   --motion         : standard transition timing
 */

/* ─────────────────────────────────────────────────────────────────────
   THEME: iOS 26 (Liquid Glass) — default
   Vibe: translucent layers, soft shadows, pill rounded, adaptive tinting
   ──────────────────────────────────────────────────────────────────── */
html[data-theme="ios26"] {
    --primary:        #FF6B35;
    --primary-dark:   #E55A29;
    --primary-soft:   rgba(255, 107, 53, 0.10);
    --secondary:      #0F172A;
    --secondary-2:    #1E293B;
    --accent:         #34C759;   /* iOS green */
    --accent-soft:    rgba(52, 199, 89, 0.10);
    --warning:        #FF9F0A;   /* iOS orange */
    --bg:             #F2F2F7;   /* iOS systemGroupedBackground */
    --surface:        rgba(255, 255, 255, 0.72);
    --surface-glass:  rgba(255, 255, 255, 0.55);
    --surface-solid:  #FFFFFF;
    --text-primary:   #0F172A;
    --text-secondary: rgba(60, 60, 67, 0.78);
    --text-hint:      rgba(60, 60, 67, 0.52);
    --border:         rgba(60, 60, 67, 0.16);
    --border-soft:    rgba(60, 60, 67, 0.08);
    --hairline:       rgba(60, 60, 67, 0.10);
    --danger:         #FF3B30;

    --glass-blur:     saturate(180%) blur(20px);
    --radius-sm:      10px;
    --radius:         14px;
    --radius-lg:      20px;
    --radius-pill:    28px;
    --motion:         cubic-bezier(0.32, 0.72, 0, 1);

    --shadow-xs:  0 1px 2px rgba(15,23,42,0.04);
    --shadow-sm:  0 2px 6px rgba(15,23,42,0.06);
    --shadow-md:  0 4px 16px rgba(15,23,42,0.08);
    --shadow-lg:  0 12px 32px rgba(15,23,42,0.10);
    --shadow-xl:  0 24px 60px rgba(15,23,42,0.14);
}

/* iOS 26 component tweaks */
html[data-theme="ios26"] body {
    background:
        radial-gradient(ellipse 80% 50% at 50% -10%, rgba(255, 107, 53, 0.08), transparent),
        radial-gradient(ellipse 60% 50% at 100% 100%, rgba(52, 199, 89, 0.05), transparent),
        var(--bg);
}
html[data-theme="ios26"] .card,
html[data-theme="ios26"] .form-section,
html[data-theme="ios26"] .lp-side-card {
    background: var(--surface);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--hairline);
    border-radius: var(--radius-lg);
}
html[data-theme="ios26"] .btn {
    /* radius 6px khớp Google sign-in button — đồng bộ toàn site.
       iOS 26 vibe giữ qua surface/blur/motion, không cần pill rounding. */
    border-radius: 6px;
    transition: transform 0.2s var(--motion), box-shadow 0.2s var(--motion), background 0.2s var(--motion);
    font-weight: 600;
}
html[data-theme="ios26"] .btn:hover { transform: translateY(-1px); }
html[data-theme="ios26"] .btn-primary {
    background: linear-gradient(180deg, #FF7A45 0%, var(--primary) 100%);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.25), var(--shadow-sm);
}
html[data-theme="ios26"] .input,
html[data-theme="ios26"] .select,
html[data-theme="ios26"] .textarea {
    border-radius: var(--radius);
    background: var(--surface);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--hairline);
    transition: border-color 0.15s var(--motion);
}
html[data-theme="ios26"] .input:focus,
html[data-theme="ios26"] .select:focus,
html[data-theme="ios26"] .textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(255, 107, 53, 0.12);
    outline: none;
}

/* ─────────────────────────────────────────────────────────────────────
   THEME: Apple Web Clean — minimalist, marketing-page vibe
   Vibe: pure white, hairlines, generous whitespace, SF-like type
   ──────────────────────────────────────────────────────────────────── */
html[data-theme="apple"] {
    --primary:        #FF6B35;
    --primary-dark:   #E55A29;
    --primary-soft:   #FFF5F0;
    --secondary:      #1D1D1F;
    --secondary-2:    #2D2D2F;
    --accent:         #007AFF;   /* Apple blue */
    --accent-soft:    rgba(0, 122, 255, 0.08);
    --warning:        #FB8C00;
    --bg:             #FFFFFF;
    --surface:        #FFFFFF;
    --surface-glass:  rgba(255, 255, 255, 0.85);
    --surface-solid:  #FFFFFF;
    --text-primary:   #1D1D1F;
    --text-secondary: #424245;
    --text-hint:      #86868B;
    --border:         #D2D2D7;
    --border-soft:    #F5F5F7;
    --hairline:       #D2D2D7;
    --danger:         #E11D2A;

    --glass-blur:     blur(0);
    --radius-sm:      6px;
    --radius:         12px;
    --radius-lg:      18px;
    --radius-pill:    980px;     /* Apple's signature pill button */
    --motion:         ease-out;

    --shadow-xs:  0 0 0 transparent;
    --shadow-sm:  0 1px 0 rgba(0,0,0,0.04);
    --shadow-md:  0 4px 20px rgba(0,0,0,0.06);
    --shadow-lg:  0 8px 32px rgba(0,0,0,0.08);
    --shadow-xl:  0 16px 48px rgba(0,0,0,0.10);
}
html[data-theme="apple"] body {
    background: #FFFFFF;
    font-feature-settings: "ss01", "cv11"; /* SF Pro stylistic alternates if loaded */
}
html[data-theme="apple"] .card,
html[data-theme="apple"] .form-section,
html[data-theme="apple"] .lp-side-card {
    background: var(--surface);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xs);
}
html[data-theme="apple"] h1,
html[data-theme="apple"] h2 {
    letter-spacing: -0.022em;
    font-weight: 700;
}
html[data-theme="apple"] .btn {
    border-radius: var(--radius-pill);
    font-weight: 500;
    padding: 9px 22px;
    transition: background 0.15s var(--motion);
}
html[data-theme="apple"] .btn-primary {
    background: var(--accent);
    color: #FFFFFF;
    border: none;
}
html[data-theme="apple"] .btn-primary:hover { background: #0066D5; }
html[data-theme="apple"] .input,
html[data-theme="apple"] .select,
html[data-theme="apple"] .textarea {
    border-radius: var(--radius);
    background: var(--surface);
    border: 1px solid var(--border);
}
html[data-theme="apple"] .input:focus,
html[data-theme="apple"] .select:focus,
html[data-theme="apple"] .textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(0, 122, 255, 0.15);
    outline: none;
}

/* ─────────────────────────────────────────────────────────────────────
   THEME: Dynamic Dark — Linear/Vercel/Spotify-like
   Vibe: deep navy, vibrant accents, glow on hover, gradient borders
   ──────────────────────────────────────────────────────────────────── */
html[data-theme="dark"] {
    --primary:        #FF8C5A;       /* brighter orange for dark bg */
    --primary-dark:   #FF6B35;
    --primary-soft:   rgba(255, 140, 90, 0.12);
    --secondary:      #FFFFFF;
    --secondary-2:    #E2E8F0;
    --accent:         #65E2A0;       /* electric green */
    --accent-soft:    rgba(101, 226, 160, 0.10);
    --warning:        #FACC15;
    --bg:             #0A0F1E;       /* deep navy */
    --surface:        #131A2B;
    --surface-glass:  rgba(19, 26, 43, 0.7);
    --surface-solid:  #1A2236;
    --text-primary:   #F1F5F9;
    --text-secondary: #94A3B8;
    --text-hint:      #64748B;
    --border:         rgba(255, 255, 255, 0.08);
    --border-soft:    rgba(255, 255, 255, 0.04);
    --hairline:       rgba(255, 255, 255, 0.06);
    --danger:         #F87171;

    --glass-blur:     saturate(140%) blur(14px);
    --radius-sm:      8px;
    --radius:         12px;
    --radius-lg:      16px;
    --radius-pill:    99px;
    --accent-glow:    0 0 24px rgba(255, 140, 90, 0.35);
    --motion:         cubic-bezier(0.34, 1.56, 0.64, 1);

    --shadow-xs:  0 1px 2px rgba(0,0,0,0.4);
    --shadow-sm:  0 4px 12px rgba(0,0,0,0.4);
    --shadow-md:  0 8px 24px rgba(0,0,0,0.5);
    --shadow-lg:  0 16px 48px rgba(0,0,0,0.6);
    --shadow-xl:  0 32px 80px rgba(0,0,0,0.7);
}
html[data-theme="dark"] body {
    background:
        radial-gradient(ellipse 60% 40% at 20% 0%,    rgba(255, 107, 53, 0.18), transparent 60%),
        radial-gradient(ellipse 50% 40% at 100% 30%,  rgba(101, 226, 160, 0.10), transparent 60%),
        radial-gradient(ellipse 60% 40% at 50% 100%,  rgba(99, 102, 241, 0.12), transparent 60%),
        var(--bg);
    color: var(--text-primary);
}
html[data-theme="dark"] .card,
html[data-theme="dark"] .form-section,
html[data-theme="dark"] .lp-side-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    position: relative;
}
html[data-theme="dark"] .card::before,
html[data-theme="dark"] .form-section::before,
html[data-theme="dark"] .lp-side-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(135deg, rgba(255,140,90,0.4), rgba(101,226,160,0.15) 50%, transparent);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor; mask-composite: exclude;
    pointer-events: none;
    opacity: 0.5;
}
html[data-theme="dark"] .btn {
    border-radius: var(--radius-pill);
    transition: transform 0.2s var(--motion), box-shadow 0.2s var(--motion);
    font-weight: 600;
}
html[data-theme="dark"] .btn:hover { transform: translateY(-1px); }
html[data-theme="dark"] .btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, #FF6B35 100%);
    color: #FFFFFF;
    border: none;
    box-shadow: var(--accent-glow);
}
html[data-theme="dark"] .btn-primary:hover {
    box-shadow: 0 0 32px rgba(255, 140, 90, 0.5);
}
html[data-theme="dark"] .input,
html[data-theme="dark"] .select,
html[data-theme="dark"] .textarea {
    background: var(--surface-glass);
    border: 1px solid var(--border);
    color: var(--text-primary);
    border-radius: var(--radius);
}
html[data-theme="dark"] .input::placeholder,
html[data-theme="dark"] .textarea::placeholder { color: var(--text-hint); }
html[data-theme="dark"] .input:focus,
html[data-theme="dark"] .select:focus,
html[data-theme="dark"] .textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(255, 140, 90, 0.20);
    outline: none;
}
html[data-theme="dark"] a:hover { color: var(--primary); }

/* ─────────────────────────────────────────────────────────────────────
   Universal: theme picker chip styles (used in /settings/appearance)
   ──────────────────────────────────────────────────────────────────── */
.theme-pick-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}
@media (max-width: 720px) { .theme-pick-grid { grid-template-columns: 1fr; } }
.theme-pick {
    padding: 16px 18px;
    border: 2px solid var(--border);
    border-radius: 16px;
    background: var(--surface);
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    transition: border-color 0.15s ease, transform 0.15s ease;
    text-align: left;
    display: block;
}
.theme-pick:hover { transform: translateY(-2px); }
.theme-pick.is-active { border-color: var(--primary); }
.theme-pick .swatch {
    height: 60px;
    border-radius: 10px;
    margin-bottom: 12px;
    border: 1px solid rgba(0,0,0,0.06);
    background: linear-gradient(135deg, var(--bg) 0%, var(--surface) 50%, var(--primary-soft) 100%);
    position: relative; overflow: hidden;
}
.theme-pick .swatch::after {
    content: '';
    position: absolute;
    right: 8px; bottom: 8px;
    width: 22px; height: 22px;
    border-radius: 50%;
    background: var(--primary);
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}
.theme-pick .name { font-weight: 700; font-size: 14px; margin-bottom: 2px; }
.theme-pick .desc { font-size: 12px; color: var(--text-hint); line-height: 1.45; }

/* iOS 26 swatch variant */
.theme-pick.swatch-ios26 .swatch {
    background: linear-gradient(135deg, #F2F2F7 0%, rgba(255,107,53,0.18) 100%);
    backdrop-filter: blur(8px);
}
/* Apple Web swatch variant */
.theme-pick.swatch-apple .swatch {
    background: #FFFFFF;
    border-color: #D2D2D7;
}
.theme-pick.swatch-apple .swatch::after { background: #007AFF; }
/* Dark swatch variant */
.theme-pick.swatch-dark .swatch {
    background: radial-gradient(ellipse at 30% 30%, rgba(255,107,53,0.4), transparent 60%), #0A0F1E;
    border-color: rgba(255,255,255,0.08);
}
.theme-pick.swatch-dark .swatch::after {
    background: linear-gradient(135deg, #FF8C5A, #FF6B35);
    box-shadow: 0 0 12px rgba(255, 140, 90, 0.6);
}
