/* ============================================
   WHEEL SPINNER - STYLES
   ============================================ */

/* --- CSS Variables --- */
:root {
    --bg: #faf9f7;
    --bg-elevated: #ffffff;
    --card: #ffffff;
    --border: #e5e3df;
    --border-hover: #d4d1cb;
    --fg: #1a1817;
    --muted: #6b6560;
    --accent: #f59e0b;
    --accent-light: rgba(245, 158, 11, 0.15);
    --accent-glow: rgba(245, 158, 11, 0.2);
    --secondary: #2563eb;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --input-bg: #ffffff;
    --pattern-opacity: 0.3;
}

[data-theme="dark"] {
    --bg: #0a0a0f;
    --bg-elevated: #12121a;
    --card: #16161f;
    --border: #2a2a3a;
    --border-hover: #3a3a4a;
    --fg: #e8e8ed;
    --muted: #6b6b7a;
    --accent: #fbbf24;
    --accent-light: rgba(251, 191, 36, 0.15);
    --accent-glow: rgba(251, 191, 36, 0.2);
    --secondary: #3b82f6;
    --success: #34d399;
    --danger: #f87171;
    --warning: #fbbf24;
    --input-bg: #0f0f14;
    --pattern-opacity: 0.05;
}

/* --- Reset --- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg);
    color: var(--fg);
    min-height: 100vh;
    overflow-x: hidden;
    transition: background-color 0.4s ease, color 0.4s ease;
}

/* ============================================
   BACKGROUND DECORATION
   ============================================ */

.bg-decoration {
    position: fixed;
    inset: 0;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.bg-pattern {
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle, var(--muted) 1px, transparent 1px);
    background-size: 24px 24px;
    opacity: var(--pattern-opacity);
}

.gradient-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.4;
    animation: float 20s ease-in-out infinite;
}

.orb-1 {
    width: 500px;
    height: 500px;
    background: linear-gradient(135deg, #fde68a, #fbbf24);
    top: -150px;
    right: -100px;
}

.orb-2 {
    width: 400px;
    height: 400px;
    background: linear-gradient(135deg, #fdba74, #fb923c);
    bottom: -100px;
    left: -100px;
    animation-delay: -5s;
}

[data-theme="dark"] .orb-1 {
    background: var(--accent);
    opacity: 0.15;
}

[data-theme="dark"] .orb-2 {
    background: #fb923c;
    opacity: 0.15;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(30px, 20px) scale(1.05); }
}

/* ============================================
   THEME TOGGLE
   ============================================ */

.theme-toggle {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    z-index: 100;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--card);
    border: 2px solid var(--border);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.theme-toggle:hover {
    transform: rotate(15deg) scale(1.1);
    border-color: var(--accent);
    background: var(--accent-light);
}

.theme-toggle svg {
    width: 24px;
    height: 24px;
    stroke: var(--fg);
    fill: none;
    stroke-width: 2;
}

/* ============================================
   CONTAINER
   ============================================ */

.container {
    max-width: 500px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
    min-height: 100vh;
}

/* ============================================
   HEADER
   ============================================ */

.header {
    text-align: center;
    margin-bottom: 1.5rem;
    animation: fadeIn 0.6s ease forwards;
}

.header-icon {
    width: 72px;
    height: 72px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    background: var(--accent-light);
}

.header-icon svg {
    width: 36px;
    height: 36px;
    stroke: var(--accent);
    fill: none;
    stroke-width: 2;
}

.header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.header p {
    color: var(--muted);
    font-size: 0.95rem;
}

/* ============================================
   PANEL
   ============================================ */

.panel {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 1.5rem;
    box-shadow: 0 4px 24px rgba(0,0,0,0.03);
    transition: all 0.3s ease;
    animation: fadeIn 0.6s ease forwards;
    animation-delay: 0.1s;
    opacity: 0;
}

.panel:hover {
    box-shadow: 0 8px 30px rgba(0,0,0,0.06);
}

/* ============================================
   INPUT SECTION
   ============================================ */

.input-section {
    margin-bottom: 1rem;
}

.input-row {
    display: flex;
    gap: 10px;
}

.input-field {
    flex: 1;
    padding: 12px 16px;
    background: var(--input-bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--fg);
    font-size: 1rem;
    transition: all 0.2s;
}

.input-field:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.input-field::placeholder {
    color: var(--muted);
}

/* ============================================
   OPTIONS LIST
   ============================================ */

.options-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 1rem;
    min-height: 40px;
}

.option-tag {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: 0.85rem;
    transition: all 0.2s;
    animation: popIn 0.3s ease forwards;
}

@keyframes popIn {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.option-tag:hover {
    border-color: var(--danger);
}

.option-tag .remove {
    cursor: pointer;
    color: var(--muted);
    transition: color 0.2s;
    display: flex;
}

.option-tag .remove:hover {
    color: var(--danger);
}

.option-tag .remove svg {
    width: 14px;
    height: 14px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
}

.option-tag .color-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* ============================================
   BUTTONS
   ============================================ */

.btn-primary {
    width: 100%;
    background: var(--accent);
    color: white;
    border: none;
    padding: 14px 24px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s;
}

.btn-primary svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
}

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

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-primary.spinning svg {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.btn-secondary {
    background: var(--bg);
    border: 1px solid var(--border);
    color: var(--fg);
    padding: 12px;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.btn-secondary svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
}

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

.btn-secondary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ============================================
   WHEEL CONTAINER
   ============================================ */

.wheel-container {
    position: relative;
    width: 280px;
    height: 280px;
    margin: 1.5rem auto;
}

.wheel-canvas {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.wheel-pointer {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 16px solid transparent;
    border-right: 16px solid transparent;
    border-top: 28px solid var(--accent);
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
    z-index: 10;
}

.wheel-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 56px;
    height: 56px;
    background: var(--card);
    border: 3px solid var(--accent);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: var(--accent);
    font-size: 0.75rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* ============================================
   RESULT DISPLAY
   ============================================ */

.result-display {
    background: var(--accent-light);
    border: 2px solid var(--accent);
    border-radius: 16px;
    padding: 1.25rem;
    margin-top: 1rem;
    text-align: center;
    display: none;
    animation: resultPop 0.6s ease forwards;
}

.result-display.show {
    display: block;
}

@keyframes resultPop {
    0% { transform: scale(0.8); opacity: 0; }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); opacity: 1; }
}

.result-label {
    font-size: 0.8rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.5rem;
}

.result-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--accent);
    word-break: break-word;
}

/* ============================================
   INFO SECTION
   ============================================ */

.info-section {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 1.5rem;
    animation: fadeIn 0.6s ease forwards;
    animation-delay: 0.2s;
    opacity: 0;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    color: var(--muted);
}

.info-item svg {
    width: 16px;
    height: 16px;
    stroke: var(--accent);
    fill: none;
    stroke-width: 2;
}

/* ============================================
   FADE IN ANIMATION
   ============================================ */

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

/* ============================================
   FOOTER
   ============================================ */

.footer {
    text-align: center;
    margin-top: 1.5rem;
    color: var(--muted);
    font-size: 0.85rem;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 480px) {
    .container {
        padding: 1rem;
    }
    
    .header h1 {
        font-size: 1.5rem;
    }
    
    .header-icon {
        width: 60px;
        height: 60px;
    }
    
    .wheel-container {
        width: 240px;
        height: 240px;
    }
    
    .wheel-center {
        width: 48px;
        height: 48px;
        font-size: 0.7rem;
    }
    
    .result-value {
        font-size: 1.5rem;
    }
    
    .info-section {
        flex-direction: column;
        align-items: center;
        gap: 0.5rem;
    }
    
    .theme-toggle {
        top: 1rem;
        right: 1rem;
        width: 42px;
        height: 42px;
    }
}
