/* apps/widgets/tools/timer/timer.css */
:root {
    --timer-accent: #10b981;
    --timer-accent-glow: rgba(16, 185, 129, 0.25);
    --timer-primary-btn: #0ea5e9;
    --timer-bg-subtle: rgba(241, 245, 249, 0.7);
    --timer-border-subtle: rgba(226, 232, 240, 0.9);
}

.timer-widget-container {
    padding: 2px 2px 4px 2px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-family: inherit;
    color: var(--text-primary, var(--text-main, #1e293b));
    box-sizing: border-box;
}

/* --- SUB-SEGMENTED BAR & SOUND --- */
.timer-top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    margin-bottom: 2px;
}

.timer-segmented-control {
    display: inline-flex;
    background: rgba(0, 0, 0, 0.05);
    padding: 2px;
    border-radius: 8px;
    gap: 2px;
}

.timer-seg-btn {
    border: none;
    background: transparent;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--text-muted, #64748b);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: all 0.15s ease;
}

.timer-seg-btn:hover {
    color: var(--text-primary, #0f172a);
}

.timer-seg-btn.active {
    background: #ffffff;
    color: var(--primary, #0284c7);
    font-weight: 700;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.timer-seg-badge {
    font-size: 0.62rem;
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    background: rgba(0, 0, 0, 0.06);
    padding: 1px 4px;
    border-radius: 4px;
    color: inherit;
}

.timer-subview {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* --- TIMER CHIPS BAR (MULTI-TIMER DOCK) --- */
.timer-chips-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    margin-bottom: 2px;
}

.timer-chips-bar {
    display: flex;
    align-items: center;
    gap: 4px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 2px 2px 4px 2px;
    width: 100%;
    scroll-behavior: smooth;
    scrollbar-width: thin;
    scrollbar-color: rgba(148, 163, 184, 0.4) transparent;
    -webkit-overflow-scrolling: touch;
}

.timer-chips-bar::-webkit-scrollbar {
    height: 3px;
}
.timer-chips-bar::-webkit-scrollbar-track {
    background: transparent;
}
.timer-chips-bar::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.35);
    border-radius: 999px;
}
.timer-chips-bar::-webkit-scrollbar-thumb:hover {
    background: rgba(100, 116, 139, 0.6);
}

.timer-chips-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 22px;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid var(--timer-border-subtle, #cbd5e1);
    border-radius: 4px;
    color: var(--text-muted, #64748b);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    z-index: 5;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: all 0.15s ease;
    padding: 0;
    line-height: 1;
}

.timer-chips-nav-btn:hover {
    background: #ffffff;
    color: var(--text-primary, #0f172a);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
}

.timer-chips-prev {
    left: -2px;
}

.timer-chips-next {
    right: -2px;
}

.timer-chip {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.7rem;
    border: 1px solid var(--timer-border-subtle);
    background: #ffffff;
    color: var(--text-muted, #64748b);
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.15s ease;
    flex-shrink: 0;
}

.timer-chip:hover {
    border-color: #94a3b8;
    color: var(--text-primary, #0f172a);
    background: #f8fafc;
}

.timer-chip.active {
    background: rgba(16, 185, 129, 0.1);
    border-color: #10b981;
    color: #047857;
    font-weight: 700;
}

.timer-chip-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #cbd5e1;
    flex-shrink: 0;
}

.timer-chip-dot.running {
    background: #10b981;
    box-shadow: 0 0 5px rgba(16, 185, 129, 0.8);
    animation: pulseDot 1.5s infinite;
}

@keyframes pulseDot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.timer-chip-time {
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    opacity: 0.9;
}

.timer-chip-close {
    border: none;
    background: transparent;
    color: inherit;
    cursor: pointer;
    font-size: 0.8rem;
    line-height: 1;
    padding: 0 1px;
    margin-left: 2px;
    opacity: 0.5;
}
.timer-chip-close:hover {
    opacity: 1;
    color: #ef4444;
}

.timer-chip-add {
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 2px 6px;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 600;
    border: 1px dashed #cbd5e1;
    background: transparent;
    color: var(--text-muted, #64748b);
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.15s;
    flex-shrink: 0;
}
.timer-chip-add:hover {
    border-color: #0ea5e9;
    color: #0ea5e9;
    background: rgba(14, 165, 233, 0.05);
}

/* --- FLACHER DISPLAY-CONTAINER --- */
.timer-display-card {
    background: #ffffff;
    border: 1px solid var(--timer-border-subtle);
    border-radius: 10px;
    padding: 6px 10px 8px 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
    position: relative;
    box-sizing: border-box;
    width: 100%;
}

.timer-subhead-row {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1px;
}

.timer-main-title {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-muted, #64748b);
    border: 1px solid transparent;
    padding: 1px 4px;
    border-radius: 4px;
    background: transparent;
    outline: none;
    transition: all 0.15s;
    max-width: 130px;
    text-overflow: ellipsis;
}
.timer-main-title:hover, .timer-main-title:focus {
    border-color: var(--timer-border-subtle);
    background: var(--timer-bg-subtle);
    color: var(--text-primary, #0f172a);
}

.timer-status-pill {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.64rem;
    font-weight: 600;
    color: var(--text-muted, #64748b);
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.timer-status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #cbd5e1;
    transition: all 0.3s ease;
}
.timer-status-dot.running {
    background: #10b981;
    box-shadow: 0 0 6px rgba(16, 185, 129, 0.6);
}

/* Große Zeitanzeige */
.timer-countdown-display {
    font-size: 2.1rem;
    font-weight: 800;
    line-height: 1;
    margin: 2px 0 3px 0;
    color: var(--text-primary, var(--text-main, #0f172a));
    font-variant-numeric: tabular-nums;
    letter-spacing: -1px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 6px;
    text-align: center;
    width: 170px;
    max-width: 100%;
    outline: none;
    cursor: text;
    transition: all 0.15s ease;
    font-family: inherit;
    padding: 1px 4px;
}

.timer-countdown-display:hover {
    border-color: rgba(203, 213, 225, 0.8);
    background: var(--timer-bg-subtle);
}

.timer-countdown-display:focus {
    border-color: #38bdf8;
    background: #ffffff;
    box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.2);
}

.timer-progress-track {
    width: 100%;
    height: 3px;
    background: rgba(226, 232, 240, 0.8);
    border-radius: 999px;
    overflow: hidden;
    margin-bottom: 6px;
}

.timer-progress-bar {
    height: 100%;
    width: 100%;
    background: linear-gradient(90deg, #10b981 0%, #06b6d4 100%);
    border-radius: 999px;
    transition: width 0.3s ease, background 0.3s ease;
}
.timer-progress-bar.paused {
    background: #94a3b8;
}

/* Action Row (Controls + Presets) */
.timer-action-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 8px;
    flex-wrap: wrap;
}

.timer-controls-group {
    display: flex;
    align-items: center;
    gap: 6px;
}

.timer-btn-round {
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
    outline: none;
}

.timer-btn-primary {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #ffffff;
    box-shadow: 0 2px 8px var(--timer-accent-glow);
}
.timer-btn-primary:hover {
    transform: scale(1.05);
}
.timer-btn-primary:active {
    transform: scale(0.96);
}

.timer-btn-secondary {
    width: 26px;
    height: 26px;
    background: var(--timer-bg-subtle);
    color: var(--text-muted, #64748b);
    border: 1px solid var(--timer-border-subtle);
}
.timer-btn-secondary:hover {
    background: #e2e8f0;
    color: var(--text-primary, #0f172a);
}

.timer-quick-shift-row {
    display: flex;
    gap: 4px;
    align-items: center;
    flex: 1;
    justify-content: flex-end;
}

.timer-pill-btn {
    border: 1px solid var(--timer-border-subtle);
    background: var(--timer-bg-subtle);
    color: var(--text-muted, #475569);
    padding: 2px 6px;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    text-align: center;
    white-space: nowrap;
}
.timer-pill-btn:hover {
    background: #e2e8f0;
    color: var(--text-primary, #0f172a);
}
.timer-pill-btn.active-preset {
    border-color: #f59e0b;
    background: rgba(245, 158, 11, 0.12);
    color: #b45309;
    font-weight: 700;
}

/* Alarm Banner & Quittierung */
.timer-alarm-banner {
    width: 100%;
    background: linear-gradient(135deg, #fef3c7, #fef08a);
    border: 1px solid #fde047;
    border-radius: 6px;
    padding: 3px 8px;
    margin-top: 5px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.72rem;
    font-weight: 700;
    color: #b45309;
    animation: alarmPulse 1.2s infinite;
}

.timer-alarm-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}

.timer-alarm-dismiss-btn {
    background: #f59e0b;
    color: #ffffff;
    border: 1px solid #d97706;
    border-radius: 4px;
    font-weight: 700;
    padding: 2px 7px;
    font-size: 0.68rem;
    cursor: pointer;
    transition: all 0.15s ease;
}
.timer-alarm-dismiss-btn:hover {
    background: #d97706;
    transform: translateY(-1px);
}

.timer-alarm-delete-btn {
    background: #ef4444;
    color: #ffffff;
    border: 1px solid #dc2626;
    border-radius: 4px;
    font-weight: 700;
    padding: 2px 7px;
    font-size: 0.68rem;
    cursor: pointer;
    transition: all 0.15s ease;
}
.timer-alarm-delete-btn:hover {
    background: #dc2626;
    transform: translateY(-1px);
}

@keyframes alarmPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.4); }
    50% { box-shadow: 0 0 8px 1px rgba(245, 158, 11, 0.3); }
}

/* Stand-up Ticker Strip (Unten im Fokus-Tab) */
.timer-standup-ticker {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(0, 0, 0, 0.025);
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: 6px;
    padding: 3px 8px;
    font-size: 0.7rem;
    color: var(--text-muted, #64748b);
    cursor: pointer;
    transition: all 0.15s ease;
    margin-top: 2px;
}
.timer-standup-ticker:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-primary, #0f172a);
}

.timer-ticker-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #10b981;
}

.timer-ticker-link {
    margin-left: auto;
    font-size: 0.65rem;
    opacity: 0.7;
    font-weight: 600;
}

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

.timer-sound-muted {
    color: #ef4444;
}

/* --- VIEW 2: STAND-UP ROUTINE --- */
.timer-interval-card {
    background: #ffffff;
    border: 1px solid var(--timer-border-subtle);
    border-radius: 10px;
    padding: 6px 10px 8px 10px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

.timer-interval-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2px;
}

.timer-interval-title-wrap {
    display: flex;
    align-items: center;
    gap: 4px;
}

.timer-interval-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.timer-interval-active-text {
    font-size: 0.75rem;
    color: var(--text-primary, #0f172a);
    display: flex;
    align-items: center;
    gap: 4px;
}

.timer-status-paused-badge {
    font-size: 0.62rem;
    font-weight: 700;
    color: #b45309;
    background: rgba(245, 158, 11, 0.15);
    padding: 1px 5px;
    border-radius: 4px;
    letter-spacing: 0.2px;
}

/* Settings Drawer */
.timer-settings-drawer {
    background: rgba(0, 0, 0, 0.03);
    border: 1px dashed rgba(0, 0, 0, 0.15);
    border-radius: 8px;
    padding: 6px 8px;
    margin-bottom: 6px;
}

.timer-settings-title {
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--text-muted);
    margin-bottom: 4px;
    text-transform: uppercase;
}

.timer-interval-settings-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
}

.timer-interval-input-group {
    display: flex;
    flex-direction: column;
}

.timer-interval-input-label {
    font-size: 0.64rem;
    color: var(--text-muted);
    display: block;
    margin-bottom: 2px;
}

.timer-interval-num-input {
    padding: 2px 4px;
    font-size: 0.74rem;
    text-align: center;
}

.timer-settings-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 5px;
}

.timer-interval-save-btn {
    padding: 2px 8px;
    font-size: 0.68rem;
    flex: none;
}

/* Countdown & Pause Button */
.timer-interval-display-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: 2px 0 6px 0;
}

.timer-interval-time {
    font-size: 2.1rem;
    font-weight: 800;
    line-height: 1;
    color: var(--text-primary, #0f172a);
    text-align: center;
    font-variant-numeric: tabular-nums;
    letter-spacing: -1px;
    transition: opacity 0.2s ease, color 0.2s ease;
}

.timer-interval-time.paused {
    opacity: 0.55;
    color: var(--text-muted, #64748b);
}

.timer-interval-pause-btn {
    width: 28px;
    height: 28px;
    background: var(--timer-bg-subtle, rgba(241, 245, 249, 0.7));
    border: 1px solid var(--timer-border-subtle, rgba(226, 232, 240, 0.9));
    color: var(--text-muted, #64748b);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
    flex-shrink: 0;
    outline: none;
}

.timer-interval-pause-btn:hover {
    background: #e2e8f0;
    color: var(--text-primary, #0f172a);
    transform: scale(1.06);
}

.timer-interval-pause-btn:active {
    transform: scale(0.96);
}

.timer-interval-pause-btn.is-paused {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #ffffff;
    border-color: #059669;
    box-shadow: 0 2px 8px var(--timer-accent-glow, rgba(16, 185, 129, 0.25));
}

/* Phasen Tabs (2 Phasen: Stehen & Sitzen) */
.timer-routine-timeline {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    margin-bottom: 4px;
}

.timer-timeline-step {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 3px 6px;
    border-radius: 6px;
    background: var(--timer-bg-subtle);
    border: 1px solid var(--timer-border-subtle);
    font-size: 0.68rem;
    color: var(--text-muted, #64748b);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: all 0.15s ease;
    cursor: pointer;
}

.timer-timeline-step:hover {
    border-color: #94a3b8;
    color: var(--text-primary, #0f172a);
}

.timer-timeline-step.active {
    background: rgba(16, 185, 129, 0.12);
    border-color: #10b981;
    color: #047857;
    font-weight: 700;
}

.timer-step-badge {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.08);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6rem;
    font-weight: 700;
    flex-shrink: 0;
}
.timer-timeline-step.active .timer-step-badge {
    background: #10b981;
    color: #ffffff;
}

.timer-interval-skip-row {
    display: flex;
    justify-content: center;
    margin-top: 8px;
}

.timer-interval-skip-btn {
    padding: 3px 12px;
    font-size: 0.72rem;
    flex: none;
}

/* Mini Button (Sound / Settings) */
.timer-mini-btn {
    border: none;
    background: transparent;
    color: var(--text-muted, #64748b);
    cursor: pointer;
    padding: 3px 4px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}
.timer-mini-btn:hover {
    color: var(--text-primary, #0f172a);
    background: rgba(0, 0, 0, 0.04);
}

/* Toggle Switch */
.timer-toggle-switch {
    position: relative;
    display: inline-block;
    width: 24px;
    height: 14px;
}
.timer-toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}
.timer-toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #cbd5e1;
    transition: .2s;
    border-radius: 14px;
}
.timer-toggle-slider:before {
    position: absolute;
    content: "";
    height: 10px;
    width: 10px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    transition: .2s;
    border-radius: 50%;
}
.timer-toggle-switch input:checked + .timer-toggle-slider {
    background-color: #10b981;
}
.timer-toggle-switch input:checked + .timer-toggle-slider:before {
    transform: translateX(10px);
}
