:root {
    --primary-color: #0f766e;
    --secondary-color: #22d3ee;
    --accent-color: #a3ff12;
    --text-primary: #f8fafc;
    --text-secondary: #cbd5f5;
    --text-muted: #8b97b5;
    --bg-primary: #050b1a;
    --bg-secondary: #0f172a;
    --bg-card: #16233d;
    --border-color: #223352;
    --shadow-light: rgba(34, 211, 238, 0.12);
    --shadow-heavy: rgba(4, 12, 28, 0.7);
    --gradient-primary: linear-gradient(140deg, #0f172a 0%, #0f766e 45%, #22d3ee 100%);
    --gradient-accent: linear-gradient(140deg, #d4ff5e 0%, #7fff45 45%, #4ade80 100%);
    --border-radius: 16px;
    --border-radius-small: 10px;
    --transition-fast: 0.18s ease;
    --transition-smooth: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="light"] {
    --text-primary: #0f172a;
    --text-secondary: #1f2937;
    --text-muted: #4b5563;
    --bg-primary: #f1f5f9;
    --bg-secondary: #e2e8f0;
    --bg-card: #f8fafc;
    --border-color: #cbd5e1;
    --shadow-light: rgba(15, 118, 110, 0.08);
    --shadow-heavy: rgba(15, 23, 42, 0.12);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    transition: background-color var(--transition-smooth), color var(--transition-smooth);
}

.top-nav {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    gap: 1rem;
}

.app-title {
    font-size: 1.5rem;
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    flex: 1;
    text-align: center;
}

.nav-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1rem;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-small);
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
    flex-shrink: 0;
}

.nav-btn:hover {
    background: var(--gradient-primary);
    color: white;
    transform: translateY(-2px);
}

.nav-btn .icon {
    font-size: 1.25rem;
}

.main-content {
    max-width: 1000px;
    margin: 0 auto;
    padding: 2rem;
}

section {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    margin-bottom: 1.5rem;
}

h2 {
    color: var(--secondary-color);
    margin-bottom: 1rem;
    font-size: 1.25rem;
}

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

input[type="number"] {
    flex: 1;
    min-width: 200px;
    padding: 10px 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-small);
    font-size: 15px;
    color: var(--text-primary);
}

input[type="number"]:focus {
    outline: none;
    border-color: var(--primary-color);
}

button {
    padding: 10px 20px;
    background: var(--gradient-primary);
    color: white;
    border: none;
    border-radius: var(--border-radius-small);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px var(--shadow-light);
}

#resetBtn {
    background: #dc2626;
}

#resetBtn:hover {
    background: #b91c1c;
}

#numbersList {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    min-height: 50px;
    padding: 15px;
    background: var(--bg-secondary);
    border-radius: var(--border-radius-small);
}

.number-item {
    padding: 6px 14px;
    background: var(--primary-color);
    color: white;
    border-radius: 6px;
    font-weight: 600;
    font-size: 14px;
}

#result {
    padding: 15px;
    background: var(--bg-secondary);
    color: var(--accent-color);
    border-radius: var(--border-radius-small);
    font-size: 17px;
    font-weight: 600;
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

@media (max-width: 768px) {
    .top-nav {
        padding: 0.75rem 1rem;
    }
    
    .app-title {
        font-size: 1.25rem;
    }
    
    .nav-btn span:not(.icon) {
        display: none;
    }
    
    .main-content {
        padding: 1rem;
    }
}
