/* Meeting Timer Presenter — style.css */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@300;400;700;900&display=swap');

:root {
    --bg: #0c0c12;
    --bg2: #111118;
    --bg3: #18181f;
    --bg4: #202028;
    --border: #22222e;
    --border2: rgba(255, 255, 255, 0.05);
    --text: #e8e8f0;
    --text2: #5a5a78;
    --text3: #2e2e48;
    --primary: #4ade80;
    --primary2: #86efac;
    --primary3: #166534;
    --warning: #fbbf24;
    --danger: #f87171;
    --radius: 12px;
    --t: all 0.2s ease;
}

[data-theme="light"] {
    --bg: #f5f5f8;
    --bg2: #ffffff;
    --bg3: #f0f0f5;
    --bg4: #e8e8ee;
    --border: #dddde8;
    --border2: rgba(0, 0, 0, 0.05);
    --text: #0c0c20;
    --text2: #7070a0;
    --text3: #b0b0cc;
}

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

html,
body {
    font-family: 'Inter', sans-serif;
    background: var(--bg);
    color: var(--text);
    height: 100%;
    margin: 0;
}

/* ─── Timer Screen ─── */
.timer-screen {
    display: none;
    position: fixed;
    inset: 0;
    background: #000;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 100;
    transition: background 0.5s;
}

.timer-screen.active {
    display: flex;
}

.timer-screen.phase-safe {
    background: #051a0a;
}

.timer-screen.phase-warn {
    background: #1a1200;
}

.timer-screen.phase-danger {
    background: #1a0505;
}

.phase-label {
    font-size: clamp(18px, 2.5vw, 36px);
    font-weight: 600;
    color: rgba(255, 255, 255, 0.5);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-bottom: 12px;
}

.timer-display {
    font-family: 'JetBrains Mono', monospace;
    font-size: clamp(80px, 18vw, 240px);
    font-weight: 900;
    line-height: 1;
    letter-spacing: 0.02em;
    transition: color 0.5s;
}

.timer-screen.phase-safe .timer-display {
    color: #4ade80;
}

.timer-screen.phase-warn .timer-display {
    color: #fbbf24;
}

.timer-screen.phase-danger .timer-display {
    color: #f87171;
    animation: blink 0.8s step-end infinite;
}

@keyframes blink {
    50% {
        opacity: 0.4;
    }
}

.next-label {
    font-size: clamp(12px, 1.8vw, 22px);
    color: rgba(255, 255, 255, 0.3);
    margin-top: 16px;
}

.speaker-display {
    font-size: clamp(14px, 2vw, 28px);
    color: rgba(255, 255, 255, 0.6);
    margin-top: 8px;
}

.screen-controls {
    display: flex;
    gap: 12px;
    margin-top: 32px;
    flex-wrap: wrap;
    justify-content: center;
}

.screen-btn {
    padding: 10px 22px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.07);
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    transition: var(--t);
}

.screen-btn:hover {
    background: rgba(255, 255, 255, 0.15);
}

.kbd-hint {
    position: absolute;
    bottom: 16px;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.2);
    letter-spacing: 0.04em;
}

/* ─── Setup layout ─── */
header {
    background: var(--bg2);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 10;
}

.hdr {
    max-width: 1100px;
    margin: 0 auto;
    padding: 10px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.brand-icon {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    background: linear-gradient(135deg, #4ade80, #166534);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    box-shadow: 0 0 14px rgba(74, 222, 128, 0.25);
}

.brand-title {
    font-size: 14px;
    font-weight: 700;
}

h1.brand-title {
    display: inline;
}

.brand-sub {
    font-size: 10px;
    color: var(--text3);
}

.theme-toggle {
    display: flex;
    gap: 8px;
    align-items: center;
}

.setup-body {
    max-width: 1100px;
    margin: 0 auto;
    padding: 16px 20px 48px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.setup-col {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Panels */
.panel {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.panel-title-row {
    padding: 9px 12px;
    border-bottom: 1px solid var(--border2);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.panel-title {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--text2);
}

.panel-footer {
    padding: 8px 12px;
    border-top: 1px solid var(--border2);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.total-time {
    font-size: 11px;
    font-family: 'JetBrains Mono', monospace;
    color: var(--primary);
}

/* Phases */
.phases-list {
    display: flex;
    flex-direction: column;
}

.phase-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-bottom: 1px solid var(--border2);
}

.phase-row:last-child {
    border-bottom: none;
}

.phase-drag {
    color: var(--text3);
    cursor: grab;
    font-size: 14px;
}

.phase-name {
    flex: 1;
    background: none;
    border: none;
    color: var(--text);
    font-size: 13px;
    font-family: 'Inter', sans-serif;
    outline: none;
}

.phase-dur {
    width: 60px;
    background: none;
    border: none;
    color: var(--text);
    font-size: 13px;
    font-family: 'JetBrains Mono', monospace;
    text-align: right;
    outline: none;
}

.phase-rm {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text3);
    font-size: 14px;
}

.phase-rm:hover {
    color: var(--danger);
}

/* Speakers */
.speakers-list {
    display: flex;
    flex-direction: column;
}

.speaker-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-bottom: 1px solid var(--border2);
}

.speaker-row:last-child {
    border-bottom: none;
}

.speaker-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary);
    flex-shrink: 0;
}

.speaker-name {
    flex: 1;
    background: none;
    border: none;
    color: var(--text);
    font-size: 13px;
    font-family: 'Inter', sans-serif;
    outline: none;
}

.speaker-badge {
    font-size: 10px;
    font-family: 'JetBrains Mono', monospace;
    color: var(--text3);
}

/* Settings */
.settings-body {
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.setting-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.setting-label {
    font-size: 12px;
    color: var(--text2);
}

.inp {
    background: var(--bg3);
    border: 1px solid var(--border);
    border-radius: 7px;
    color: var(--text);
    padding: 4px 8px;
    font-size: 12px;
    font-family: 'JetBrains Mono', monospace;
    outline: none;
    width: 70px;
    text-align: right;
}

/* Toggle */
.toggle-wrap {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.toggle-wrap input[type=checkbox] {
    display: none;
}

.toggle-track {
    width: 36px;
    height: 20px;
    border-radius: 10px;
    background: var(--border);
    position: relative;
    transition: background 0.2s;
}

.toggle-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #fff;
    position: absolute;
    top: 2px;
    left: 2px;
    transition: transform 0.2s;
}

.toggle-wrap input:checked+.toggle-track {
    background: var(--primary3);
}

.toggle-wrap input:checked+.toggle-track .toggle-thumb {
    transform: translateX(16px);
}

/* Log */
.log-body {
    max-height: 240px;
    overflow-y: auto;
    padding: 8px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.log-empty {
    font-size: 12px;
    color: var(--text3);
}

.log-entry {
    display: flex;
    gap: 8px;
    font-size: 11px;
    align-items: baseline;
}

.log-ts {
    color: var(--text3);
    font-family: 'JetBrains Mono', monospace;
    flex-shrink: 0;
}

.log-msg {
    color: var(--text2);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg3);
    color: var(--text);
    font-family: 'Inter', sans-serif;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--t);
}

.btn:hover {
    border-color: var(--primary);
    color: var(--primary2);
}

.btn-sm {
    padding: 3px 9px;
    font-size: 10px;
    border-radius: 6px;
}

.btn-primary {
    background: var(--primary3);
    border-color: var(--primary);
    color: #fff;
    font-weight: 700;
    padding: 8px 18px;
    font-size: 13px;
}

.btn-primary:hover {
    opacity: 0.9;
}

.toast-wrap {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 6px;
    pointer-events: none;
}

.toast {
    background: var(--bg2);
    border: 1px solid rgba(74, 222, 128, 0.3);
    border-radius: 10px;
    padding: 8px 14px;
    font-size: 12px;
    color: var(--text);
    transform: translateX(20px);
    opacity: 0;
    transition: all 0.22s ease;
}

.toast.show {
    transform: none;
    opacity: 1;
}

::-webkit-scrollbar {
    width: 5px
}

::-webkit-scrollbar-track {
    background: transparent
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px
}

@media(max-width:720px) {
    .setup-body {
        grid-template-columns: 1fr;
    }

    .hdr {
        flex-wrap: wrap;
        gap: 8px;
    }
}