/* ============================================
   Gift Idea Spinner — Design System
   ============================================ */
:root {
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-card: rgba(30, 41, 59, 0.85);
    --border-glass: rgba(255, 255, 255, 0.08);
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --accent: #f472b6;
    --accent-glow: rgba(244, 114, 182, 0.3);
    --accent-2: #8b5cf6;
    --success: #4ade80;
    --radius: 12px;
    --radius-sm: 8px;
    --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --font: 'Inter', -apple-system, sans-serif;
}

[data-theme="light"] {
    --bg-primary: #fdf2f8;
    --bg-secondary: #ffffff;
    --bg-card: rgba(255, 255, 255, 0.9);
    --border-glass: rgba(0, 0, 0, 0.08);
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
}

*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    transition: background var(--transition);
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    background: radial-gradient(ellipse 600px 400px at 50% 30%, rgba(244, 114, 182, 0.06) 0%, transparent 70%);
    pointer-events: none;
    z-index: -1;
}

.app {
    max-width: 640px;
    margin: 0 auto;
    padding: 0 16px 40px;
}

.header {
    padding: 16px 0 8px;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    font-size: 1.5rem;
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    border-radius: var(--radius);
    box-shadow: 0 4px 16px var(--accent-glow);
}

.logo h1 {
    font-size: 1.1rem;
    font-weight: 700;
}

.tagline {
    font-size: 0.66rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.icon-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: var(--bg-secondary);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
}

.icon-btn:hover {
    color: var(--accent);
}

.icon {
    width: 18px;
    height: 18px;
}

.moon-icon {
    display: none;
}

[data-theme="light"] .sun-icon {
    display: none;
}

[data-theme="light"] .moon-icon {
    display: block;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: 0.84rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: #fff;
    box-shadow: 0 2px 12px var(--accent-glow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px var(--accent-glow);
}

.btn-secondary {
    background: var(--bg-secondary);
    border: 1px solid var(--border-glass);
    color: var(--text-secondary);
}

.btn-secondary:hover {
    color: var(--text-primary);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.76rem;
}

.btn-lg {
    padding: 14px 36px;
    font-size: 1.1rem;
    font-weight: 800;
}

.section {
    margin-bottom: 20px;
}

.section h2 {
    font-size: 0.92rem;
    font-weight: 700;
    margin-bottom: 8px;
}

/* Filters */
.filter-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.filter-card {
    padding: 10px;
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.filter-card label {
    font-size: 0.66rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
}

.filter-card select {
    padding: 7px 8px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-glass);
    border-radius: 6px;
    color: var(--text-primary);
    font-family: var(--font);
    font-size: 0.8rem;
}

.filter-card select:focus {
    outline: none;
    border-color: var(--accent);
}

/* Wheel */
.wheel-section {
    text-align: center;
}

.wheel-wrapper {
    position: relative;
    display: inline-block;
    margin-bottom: 16px;
}

.wheel-pointer {
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 1.4rem;
    color: var(--accent);
    text-shadow: 0 2px 8px var(--accent-glow);
    z-index: 2;
}

/* Result */
.result-card {
    padding: 24px;
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius);
    text-align: center;
    animation: slideUp 0.4s ease;
}

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

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

.result-emoji {
    font-size: 2.5rem;
    display: block;
    margin-bottom: 8px;
}

.result-card h2 {
    font-size: 1.2rem;
    font-weight: 800;
    margin-bottom: 8px;
}

.result-tags {
    display: flex;
    gap: 6px;
    justify-content: center;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.tag {
    padding: 3px 10px;
    background: rgba(139, 92, 246, 0.15);
    color: var(--accent-2);
    border-radius: 999px;
    font-size: 0.66rem;
    font-weight: 600;
}

.result-actions {
    display: flex;
    gap: 8px;
    justify-content: center;
}

/* Favorites */
.fav-count {
    font-size: 0.7rem;
    color: var(--accent);
    background: rgba(244, 114, 182, 0.15);
    padding: 2px 8px;
    border-radius: 999px;
}

.fav-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.fav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-sm);
    transition: all var(--transition);
}

.fav-item:hover {
    border-color: var(--accent);
}

.fav-item .fav-emoji {
    font-size: 1.2rem;
}

.fav-item .fav-name {
    flex: 1;
    font-size: 0.84rem;
    font-weight: 600;
}

.fav-item .fav-budget {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.fav-item .fav-remove {
    width: 24px;
    height: 24px;
    border: none;
    background: rgba(248, 113, 113, 0.1);
    color: #f87171;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.7rem;
}

.empty-msg {
    font-size: 0.82rem;
    color: var(--text-muted);
    text-align: center;
    padding: 20px;
}

.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    padding: 10px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-size: 0.82rem;
    opacity: 0;
    transition: all 0.35s ease;
    z-index: 100;
    pointer-events: none;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.hidden {
    display: none !important;
}

@media (max-width: 480px) {
    .filter-row {
        grid-template-columns: 1fr;
    }

    .result-actions {
        flex-direction: column;
    }
}