/* =========================================
   SUGESH SUPERAPP - GLOBAL VARIABLES
========================================= */
:root {
    --accent: #2563eb;
    --accent-light: #f1f5f9;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --bg-app: #f8fafc;
    --surface: #ffffff;
    --border-smooth: #e2e8f0;

    --font-heading: 'Poppins', sans-serif;
    --font-body: 'Inter', sans-serif;

    --radius-lg: 24px;
    --radius-md: 14px;
    --radius-sm: 8px;
    --shadow-sm: 0 1px 3px rgba(15,23,42,0.05);
    --shadow-md: 0 10px 15px -3px rgba(15,23,42,0.08);

:root {
    --wardrobe-bg: #f4f6f8; 
    --wardrobe-surface: #ffffff;
    --wardrobe-border: #e2e8f0;
    --wardrobe-text: #0f172a;
    --wardrobe-muted: #64748b;
    --wardrobe-accent: #2563eb;
    --wardrobe-mint: #a2ded0;
    --shirt-size: 260px; 
    --pant-size: 230px; 
    --pant-overlap: -12px; 
}

body.dark-theme { 
    --bg-app: #0f172a; 
    --surface: #1e293b; 
    --text-main: #f8fafc; 
    --text-muted: #94a3b8; 
    --border-smooth: #334155; 
    
    --wardrobe-bg: #09090b; 
    --wardrobe-surface: #18181b; 
    --wardrobe-border: #27272a; 
    --wardrobe-text: #f4f4f5; 
    --wardrobe-muted: #a1a1aa; 
}
}
/* =========================================
   GLOBAL BASE STYLES
========================================= */
body { margin: 0; padding: 0; font-family: var(--font-body); background-color: var(--bg-app); color: var(--text-main); -webkit-tap-highlight-color: transparent; }
h1, h2, h3, h4 { font-family: var(--font-heading); font-weight: 700; color: var(--text-main); margin-top: 0; }
.material-symbols-outlined { font-size: 24px; vertical-align: middle; display: inline-block; color: inherit; font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24; }
.view-screen { position: relative; min-height: 100vh; box-sizing: border-box; display: flex; flex-direction: column; }
.hidden { display: none !important; }

/* FIX: Header now uses var(--surface) for proper Dark Mode rendering */
.app-header { background: var(--surface); padding: 16px 20px; border-bottom: 1px solid var(--border-smooth); display: flex; justify-content: space-between; align-items: center; position: sticky; top: 0; z-index: 100; box-shadow: var(--shadow-sm); }
.header-left { display: flex; align-items: center; gap: 12px; }
.app-content { flex: 1; padding: 20px; box-sizing: border-box; }

.btn-primary { background: var(--accent); color: white; border: none; padding: 12px 20px; font-weight: 700; font-family: var(--font-body); border-radius: var(--radius-md); box-shadow: var(--shadow-sm); cursor: pointer; transition: transform 0.1s ease; }
.btn-primary:active { transform: scale(0.97); }
.btn-secondary { background: var(--surface); color: var(--text-main); border: 1px solid var(--border-smooth); padding: 12px 20px; font-weight: 700; font-family: var(--font-body); border-radius: var(--radius-md); cursor: pointer; }
.btn-circle { width: 44px; height: 44px; border-radius: 50%; background: var(--accent); color: white; border: none; display: flex; align-items: center; justify-content: center; box-shadow: var(--shadow-md); cursor: pointer; }
.nav-back-btn { background: none; border: none; color: var(--accent); font-size: 16px; font-weight: 700; font-family: var(--font-body); cursor: pointer; padding: 4px; }
.add-line-btn { background: none; border: 2px dashed var(--border-smooth); color: var(--accent); padding: 12px; border-radius: var(--radius-md); width: 100%; font-weight: 700; font-size: 14px; cursor: pointer; margin-top: 12px; }
.del-line-btn { background: none; border: none; color: #ef4444; font-size: 16px; cursor: pointer; padding: 4px; }

/* LAUNCHPAD (Fixed for Dark Mode) */
.launch-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.launch-card { background: var(--surface); border: 1px solid var(--border-smooth); border-radius: var(--radius-lg); padding: 24px 16px; text-align: center; box-shadow: var(--shadow-sm); cursor: pointer; transition: transform 0.2s; }
.launch-card:active { transform: scale(0.95); }
.launch-grid .launch-card:nth-child(1) .card-icon { color: #3b82f6 !important; }
.launch-grid .launch-card:nth-child(2) .card-icon { color: #8b5cf6 !important; }
.launch-grid .launch-card:nth-child(3) .card-icon { color: #f59e0b !important; }
.launch-grid .launch-card:nth-child(4) .card-icon { color: #10b981 !important; }
.card-icon { font-size: 40px !important; color: var(--accent); margin-bottom: 12px; }
.launch-card h3 { margin: 0; font-size: 15px; font-weight: 700; color: var(--text-main); }

/* SETTINGS & MODALS */
.modal-backdrop { position: fixed; inset: 0; background: rgba(15,23,42,0.7); backdrop-filter: blur(4px); z-index: 2000; }
.modal-card { position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 90%; max-width: 400px; background: var(--surface); border-radius: var(--radius-lg); padding: 24px; box-shadow: 0 20px 40px rgba(0,0,0,0.3); z-index: 2001; box-sizing: border-box; }
.close-btn { position: absolute; top: 15px; right: 15px; background: transparent; border: none; font-size: 24px; color: var(--text-muted); cursor: pointer; font-weight: bold; }
.modal-actions { display: flex; gap: 10px; margin-top: 20px; justify-content: flex-end; }
.btn-cancel { background: var(--bg-app); color: var(--text-muted); border: 1px solid var(--border-smooth); padding: 12px 20px; font-weight: 700; border-radius: var(--radius-md); cursor: pointer; }

/* CHECKLIST & GENERAL LISTS */
.folder-card { background: var(--surface); border-radius: var(--radius-md); padding: 16px; border: 1px solid var(--border-smooth); display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; box-shadow: var(--shadow-sm); cursor: pointer; }
.folder-info h3 { margin: 0; font-size: 16px; }
.folder-info span { font-size: 12px; color: var(--text-muted); font-weight: 600; }
.dynamic-input { width: 100%; box-sizing: border-box; padding: 12px 16px; border: 1px solid var(--border-smooth); border-radius: var(--radius-md); font-family: var(--font-body); font-size: 14px; background: var(--surface); color: var(--text-main); }
.dynamic-input:focus { outline: none; border-color: var(--accent); }
.input-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.input-group label { font-size: 12px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; }
.dynamic-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.item-row { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; background: var(--surface); border: 1px solid var(--border-smooth); border-radius: var(--radius-md); box-shadow: var(--shadow-sm); margin-bottom: 12px; }
.item-row-left { display: flex; align-items: center; gap: 12px; }
input[type="checkbox"] { -webkit-appearance: none; appearance: none; margin: 0; width: 22px; height: 22px; border: 2px solid var(--border-smooth); border-radius: 50%; cursor: pointer; display: grid; place-content: center; transition: background 0.2s, border-color 0.2s; }
input[type="checkbox"]:checked { background: var(--accent); border-color: var(--accent); }
input[type="checkbox"]::before { content: "✓"; color: white; font-size: 12px; font-weight: 900; transform: scale(0); transition: transform 0.1s ease-in-out; }
input[type="checkbox"]:checked::before { transform: scale(1); }
.completed-text { text-decoration: line-through; color: var(--text-muted); opacity: 0.7; }
.color-picker-input { width:40px; height:42px; border:none; padding:0; border-radius:50% !important; overflow:hidden; background:transparent; cursor: pointer; }
.color-picker-input::-webkit-color-swatch-wrapper { padding: 0; }
.color-picker-input::-webkit-color-swatch { border: none; border-radius: 50%; }

.app-nav { position: fixed; bottom: 0; left: 0; right: 0; height: 64px; background: var(--surface); border-top: 1px solid var(--border-smooth); display: flex; z-index: 100; }
.nav-item { flex: 1; border: none; background: none; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: var(--text-muted); font-family: var(--font-body); font-size: 11px; font-weight: 600; cursor: pointer; }
.nav-item.active { color: var(--accent); }

/* CALENDAR APP */
.calendar-card { background: var(--surface); border: 1px solid var(--border-smooth); border-radius: var(--radius-lg); padding: 16px; box-shadow: var(--shadow-md); display: flex; flex-direction: column; }
.calendar-controls { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; }
.calendar-controls button { background: none; border: none; font-size: 18px; color: var(--accent); font-weight: 700; cursor: pointer; }
.calendar-weekdays { display: grid; grid-template-columns: repeat(7, 1fr); text-align: center; font-size: 11px; font-weight: 700; color: var(--text-muted); margin-bottom: 8px; }
.calendar-days { display: grid; grid-template-columns: repeat(7, 1fr); grid-auto-rows: 1fr; gap: 6px; flex: 1; }
.cal-day-cell { min-height: 52px; border-radius: var(--radius-md); background: var(--bg-app); border: 1px solid var(--border-smooth); padding: 4px; display: flex; flex-direction: column; justify-content: space-between; cursor: pointer; }
.cal-day-empty { background: transparent; border: none; cursor: default; }
.cal-date-num { font-size: 12px; font-weight: 700; color: var(--text-muted); }
.cal-date-num.today { width: 20px; height: 20px; background: var(--accent); color: white; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.cal-tag, .active-tag-chip, .preset-chip { font-size: 11px; font-weight: 700; color: white; padding: 4px 12px; border-radius: 20px; text-overflow: ellipsis; overflow: hidden; white-space: nowrap; margin-top: 2px; }
.cal-tag { font-size: 9px; padding: 2px 6px; }
.active-tag-chip { padding-right: 8px; display: flex; align-items: center; gap: 4px; }
.preset-chip { border: none; cursor: pointer; }
.chip-del-btn { background: none; border: none; color: white; opacity: 0.8; font-size: 10px; padding: 0; cursor: pointer; }

/* RECIPES APP */
.recipe-inner-box, .score-player-row, .rules-box { background: var(--surface); padding: 16px; border-radius: 16px; border: 1px solid var(--border-smooth); margin-bottom: 15px; }
.recipe-section { background: var(--surface); border-radius: var(--radius-lg); padding: 16px; margin-bottom: 16px; border: 1px solid var(--border-smooth); box-shadow: var(--shadow-sm); }
.recipe-card { border-radius: var(--radius-lg); height: 140px; background-size: cover; background-position: center; position: relative; overflow: hidden; box-shadow: var(--shadow-sm); border: 1px solid var(--border-smooth); cursor: pointer; }
.recipe-card-overlay { position: absolute; inset: 0; padding: 12px; display: flex; flex-direction: column; justify-content: flex-end; }
.recipe-card-overlay h3 { color: white; margin: 0; font-size: 15px; }
.recipe-card-overlay span { color: rgba(255,255,255,0.75); font-size: 11px; font-weight: 600; margin-top: 4px; }
.inventory-item { background: var(--surface); border: 1px solid var(--border-smooth); border-radius: var(--radius-md); padding: 10px; text-align: center; box-shadow: var(--shadow-sm); }
.inventory-img { width: 100%; height: 90px; border-radius: var(--radius-sm); object-fit: cover; margin-bottom: 8px; }
.inventory-item .btn-primary .hide-text { display: none; }
.inventory-item .btn-primary { font-size: 0; padding: 8px; }
.inventory-item .btn-primary .material-symbols-outlined { font-size: 20px; margin: 0; }
.cover-slider { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 8px; scroll-snap-type: x mandatory; }
.cover-slide { width: 100%; height: 180px; border-radius: var(--radius-lg); flex-shrink: 0; background-size: cover; background-position: center; scroll-snap-align: start; position: relative; }
.recipe-meta-pill { background: rgba(37,99,235,0.08); color: var(--accent); padding: 8px 14px; border-radius: var(--radius-md); font-size: 13px; font-weight: 700; display: flex; align-items: center; gap: 6px; }
.qty-highlight { background: var(--accent-light); color: var(--accent); padding: 4px 8px; border-radius: var(--radius-sm); font-size: 11px; font-weight: 700; }
.tabs-row { display: flex; gap: 8px; background: rgba(255,255,255,0.9); backdrop-filter: blur(8px); padding: 6px; border-radius: var(--radius-md); margin-bottom: 15px; border: 1px solid var(--border-smooth); }
.tab-btn { flex: 1; background: transparent; border: none; padding: 10px; font-weight: 700; font-family: var(--font-body); color: var(--text-muted); cursor: pointer; border-radius: var(--radius-sm); transition: 0.2s; white-space: nowrap;}
.tab-btn.active { background: var(--surface); color: var(--accent); box-shadow: var(--shadow-sm); }
.hidden-tab { display: none !important; }
.step-image { width: 100%; max-height: 150px; border-radius: var(--radius-md); object-fit: cover; margin-top: 8px; }

/* SCOREBOARD APP */
.circular-table-wrapper { position: relative; width: 240px; height: 240px; margin: 20px auto; border-radius: 50%; border: 3px dashed var(--border-smooth); display: flex; align-items: center; justify-content: center; }
.table-seat { position: absolute; width: 76px; height: 76px; background: var(--surface); border-radius: 50%; border: 3px solid var(--accent); box-shadow: var(--shadow-md); display: flex; flex-direction: column; align-items: center; justify-content: center; top: 50%; left: 50%; margin: -38px 0 0 -38px; z-index: 5; transition: transform 0.1s ease; touch-action: none; cursor: grab; }
.table-seat:active { cursor: grabbing; z-index: 10; }
.seat-name, .seat-score { pointer-events: none; }
.table-seat.eliminated { border-color: #cbd5e1; background: var(--bg-app); opacity: 0.6; }
.table-seat.eliminated .seat-score { text-decoration: line-through; color: #94a3b8; }
.seat-name { font-size: 10px; font-weight: 800; text-transform: uppercase; max-width: 65px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text-muted); }
.seat-score { font-size: 22px; font-weight: 900; color: var(--accent); line-height: 1; margin-bottom: 2px; }
.table-center-actions { display: flex; flex-direction: column; gap: 10px; z-index: 1; }
.rank-row { display: flex; justify-content: space-between; align-items: center; background: var(--bg-app); padding: 12px 16px; border-radius: var(--radius-md); font-weight: 700; border: 1px solid var(--border-smooth); }
.rank-row.rank-1 { background: #fffbeb; border-color: #f59e0b; color: #b45309; }
.rank-row.eliminated-row { opacity: 0.5; }
.round-log-row { background: var(--surface); border-radius: var(--radius-md); padding: 12px; border: 1px solid var(--border-smooth); display: flex; justify-content: space-between; font-size: 13px; font-weight: 600; }
.modal-label { font-size: 12px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; margin-bottom: 6px; display: block; }
