/* =========================================
   Design System & Variables
========================================= */
:root {
    /* Premium Dark Mode Colors */
    --bg-base: #0f172a;
    --bg-gradient: linear-gradient(135deg, #0f172a 0%, #1e1b4b 100%);
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    
    --accent: #60a5fa;
    --accent-glow: rgba(96, 165, 250, 0.5);
    
    --danger: #ef4444;
    --warning: #f59e0b;
    --success: #10b981;

    --font-sans: 'Outfit', sans-serif;
    --border-radius: 20px;
    --border-radius-sm: 12px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: var(--font-sans);
}

body {
    background: var(--bg-gradient);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    -webkit-font-smoothing: antialiased;
}

/* =========================================
   App Container (Mobile First)
========================================= */
.app-container {
    width: 100%;
    max-width: 480px;
    min-height: 100vh;
    background: transparent;
    position: relative;
    overflow-x: hidden;
    padding-bottom: 2rem;
}

.view {
    display: none;
    padding: 0 1.5rem;
    animation: fadeIn 0.4s ease-out;
}

.view.active {
    display: block;
}

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

/* =========================================
   Header
========================================= */
.header, .settings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--accent);
    text-shadow: 0 0 15px var(--accent-glow);
}

.icon-btn {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: var(--text-main);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.2rem;
    transition: var(--transition);
}

.icon-btn:hover {
    background: rgba(255,255,255,0.1);
    transform: scale(1.05);
}

/* =========================================
   Components (Glassmorphism)
========================================= */
.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

/* Hero Section */
.hero-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    border-top: 1px solid rgba(255,255,255,0.2);
    border-left: 1px solid rgba(255,255,255,0.2);
}

.hero-content {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.subtitle {
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.8rem;
}

.title {
    font-size: 1.6rem;
    font-weight: 700;
    line-height: 1.3;
}

.weather-icon-large {
    font-size: 3.5rem;
    color: var(--accent);
    filter: drop-shadow(0 0 10px var(--accent-glow));
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-5px); }
    100% { transform: translateY(0px); }
}

/* Deadline Section */
.deadline-section {
    margin-bottom: 2rem;
}

.deadline-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.deadline-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
}

.badge {
    background: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 700;
}

.text-sm {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.text-xs {
    font-size: 0.8rem;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(255,255,255,0.1);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--accent);
    width: 0%;
    border-radius: 4px;
    transition: width 1s ease-out;
    box-shadow: 0 0 10px var(--accent-glow);
}
.progress-fill.danger { background: var(--danger); box-shadow: 0 0 10px rgba(239,68,68,0.5); }
.progress-fill.warning { background: var(--warning); box-shadow: 0 0 10px rgba(245,158,11,0.5); }
.progress-fill.success { background: var(--success); box-shadow: 0 0 10px rgba(16,185,129,0.5); }

/* Forecast Scroll */
.forecast-section h3 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

.forecast-scroll {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    padding-top: 15px;
    padding-bottom: 1rem;
    scrollbar-width: none;
}

.forecast-scroll::-webkit-scrollbar {
    display: none;
}

.day-card {
    min-width: 120px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.8rem;
    text-align: center;
    transition: var(--transition);
}

.day-card.recommended {
    border: 1px solid var(--accent);
    box-shadow: 0 0 15px var(--accent-glow);
    background: rgba(96, 165, 250, 0.1);
}

.day-card .day {
    font-weight: 600;
    font-size: 1rem;
}
.day-card .date {
    font-size: 0.8rem;
    color: var(--text-muted);
}
.day-card .icon {
    font-size: 1.8rem;
}
.day-card .score {
    font-size: 0.8rem;
    background: var(--glass-bg);
    padding: 0.2rem 0.5rem;
    border-radius: 10px;
}
.day-card .temp {
    font-size: 0.9rem;
    font-weight: 600;
}

/* =========================================
   Forms & Settings
========================================= */
.settings-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-weight: 600;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.input-row {
    display: flex;
    gap: 0.5rem;
}

input, select {
    width: 100%;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--glass-border);
    color: var(--text-main);
    padding: 0.8rem;
    border-radius: var(--border-radius-sm);
    font-size: 1rem;
    transition: var(--transition);
    outline: none;
}

input:focus, select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 8px var(--accent-glow);
}

select option {
    background: var(--bg-base);
    color: var(--text-main);
}

/* Clothes Grid */
.clothes-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-top: 0.5rem;
}

.clothes-item {
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius-sm);
    padding: 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.clothes-label {
    font-weight: 600;
    font-size: 0.9rem;
}

.numeric-input {
    display: flex;
    align-items: center;
    background: rgba(0,0,0,0.2);
    border-radius: 20px;
    overflow: hidden;
}

.numeric-input button {
    background: transparent;
    border: none;
    color: var(--text-main);
    width: 32px;
    height: 32px;
    cursor: pointer;
    font-size: 1.2rem;
}

.numeric-input button:hover {
    background: rgba(255,255,255,0.1);
}

.numeric-input input {
    width: 40px;
    text-align: center;
    border: none;
    background: transparent;
    padding: 0;
    font-weight: 600;
}

.btn-primary {
    background: var(--accent);
    color: #fff;
    border: none;
    padding: 1rem;
    border-radius: var(--border-radius-sm);
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    margin-top: 1rem;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary:hover {
    background: #3b82f6;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px var(--accent-glow);
}

/* Utility / Overlay */
.hidden {
    display: none !important;
}

.overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--glass-border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.text-danger { color: #fca5a5; }
.text-warning { color: #fcd34d; }
.text-success { color: #6ee7b7; }
