/* =========================================
   TOOL SPECIFIC STYLES & THEMES
   ========================================= */
:root {
    --font-mono: 'JetBrains Mono', monospace;
    --card-bg: var(--bg-surface);
    
    /* Default Theme (Blue) */
    --accent: #2563eb; 
    --accent-light: #eff6ff;
    --btn-start-bg: rgba(34, 197, 94, 0.15);
    --btn-start-text: #16a34a;
}

/* --- DEV'S THEME ENGINE --- */
body[data-theme="ocean"] {
    --accent: #06b6d4; --accent-light: #ecfeff;
    --btn-start-bg: rgba(6, 182, 212, 0.15); --btn-start-text: #0891b2;
}
body[data-theme="sunset"] {
    --accent: #f97316; --accent-light: #fff7ed;
    --btn-start-bg: rgba(249, 115, 22, 0.15); --btn-start-text: #ea580c;
}
body[data-theme="neon"] {
    --accent: #d946ef; --accent-light: #fdf4ff;
    --btn-start-bg: rgba(217, 70, 239, 0.15); --btn-start-text: #c026d3;
}

/* Container */
.tool-container {
    max-width: 500px; margin: 0 auto; padding: 20px 16px;
}

/* --- TIMER CARD --- */
.timer-card {
    background-color: var(--card-bg);
    border-radius: 24px;
    padding: 30px 20px;
    text-align: center;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    margin-bottom: 20px;
    position: relative;
    overflow: hidden;
}

.timer-card::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0;
    height: 4px; background: var(--accent); opacity: 0.8;
}

.time-display {
    font-family: var(--font-mono);
    font-size: 3.8rem;
    font-weight: 500;
    color: var(--text-main);
    letter-spacing: -2px;
    margin-bottom: 10px;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.time-display small {
    font-size: 2rem; color: var(--accent); margin-left: 2px;
}

/* Target Badge with SVG */
.target-badge {
    display: inline-flex; align-items: center; gap: 6px;
    background-color: var(--accent-light);
    color: var(--accent);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 24px;
    animation: fadeIn 0.3s;
}

.target-badge svg {
    width: 16px; height: 16px;
}

/* Controls */
.controls-wrapper {
    display: flex; justify-content: space-between; align-items: center; padding: 0 10px;
}

.round-btn {
    width: 72px; height: 72px;
    border-radius: 50%; border: none;
    font-size: 1rem; font-weight: 600;
    cursor: pointer; transition: transform 0.1s;
    display: flex; align-items: center; justify-content: center;
}
.round-btn:active { transform: scale(0.95); }

.round-btn.primary { background-color: var(--btn-start-bg); color: var(--btn-start-text); }
.round-btn.primary.running { background-color: rgba(239, 68, 68, 0.15); color: #ef4444; }
.round-btn.secondary { background-color: var(--bg-body); color: var(--text-muted); border: 2px solid var(--border-color); }

.dots { display: flex; gap: 6px; }
.dot { width: 6px; height: 6px; background: var(--border-color); border-radius: 50%; }
.dot.active { background: var(--accent); }

/* --- SETTINGS & CHIPS --- */
.settings-grid { margin-bottom: 20px; }

.setting-box {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 12px;
}

.setting-box.row { display: flex; justify-content: space-between; }
.opt { display: flex; flex-direction: column; gap: 8px; width: 48%; }
.label { font-size: 0.8rem; color: var(--text-muted); font-weight: 600; margin-bottom: 8px; display: block; }

/* CHIPS & CUSTOM INPUT */
.chip-group { display: flex; gap: 8px; flex-wrap: wrap; }

.chip {
    flex: 1; padding: 8px 0;
    background: var(--bg-body);
    border: 1px solid var(--border-color);
    border-radius: 8px; color: var(--text-main);
    font-size: 0.85rem; font-weight: 500;
    cursor: pointer; transition: 0.2s;
    min-width: 50px;
}

.chip.active { background-color: var(--accent); color: white; border-color: var(--accent); }

/* Custom Input Styling (Native Look) */
.custom-chip-wrapper {
    flex: 1.5; /* Slightly wider */
    min-width: 70px;
}

.custom-input {
    width: 100%;
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background-color: var(--bg-body);
    color: var(--text-main);
    font-size: 0.85rem;
    font-weight: 500;
    text-align: center;
    outline: none;
    transition: 0.2s;
}

.custom-input:focus, .custom-input.active {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-light);
}

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

/* Theme Select */
.theme-select {
    width: 100%; padding: 8px;
    border-radius: 8px; border: 1px solid var(--border-color);
    background-color: var(--bg-body); color: var(--text-main);
    font-size: 0.9rem; outline: none;
}

/* Switch (Reused) */
.switch { position: relative; display: inline-block; width: 44px; height: 24px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: #cbd5e1; transition: .4s; border-radius: 34px; }
.slider:before { position: absolute; content: ""; height: 18px; width: 18px; left: 3px; bottom: 3px; background-color: white; transition: .4s; border-radius: 50%; }
input:checked + .slider { background-color: var(--accent); }
input:checked + .slider:before { transform: translateX(20px); }

/* --- LAPS --- */
.laps-section {
    background-color: var(--bg-surface);
    border-radius: 16px; border: 1px solid var(--border-color);
    overflow: hidden;
}
.laps-header {
    padding: 12px 20px; background-color: var(--bg-body);
    display: flex; justify-content: space-between;
    font-size: 0.8rem; font-weight: 700; color: var(--text-muted);
    text-transform: uppercase;
}
.laps-list { max-height: 200px; overflow-y: auto; padding: 0 20px; }
.lap-item {
    display: flex; justify-content: space-between; padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
    font-family: var(--font-mono); color: var(--text-main); font-size: 0.95rem;
}
.lap-item:first-child { color: var(--accent); font-weight: 600; }

/* Modal */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.6); z-index: 3000;
    display: flex; align-items: center; justify-content: center;
    padding: 20px; backdrop-filter: blur(4px);
    opacity: 0; visibility: hidden; transition: 0.2s;
}
.modal-overlay.active { opacity: 1; visibility: visible; }
.modal-content {
    background: var(--bg-surface); width: 100%; max-width: 400px;
    border-radius: 20px; padding: 24px; box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}
.modal-header { display: flex; justify-content: space-between; margin-bottom: 16px; }
.modal-header h3 { margin: 0; color: var(--text-main); font-size: 1.2rem; }
.close-modal { color: var(--text-muted); font-size: 1.5rem; }
.modal-body p { margin-bottom: 10px; color: var(--text-muted); line-height: 1.5; font-size: 0.9rem; }

.hidden { display: none !important; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(-5px); } to { opacity: 1; transform: translateY(0); } }