/* ============================================================
   방송 타이머 — 컨트롤 페이지
   - 검은 배경 + 노란 강조 (다른 도구 동일 톤)
   - 미리보기 + 컨트롤 + 설정 + OBS URL
   ============================================================ */

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
}

.timer-body {
    background: #000;
    color: #fff;
    font-family: 'NanumSquare', 'Pretendard', 'Helvetica Neue', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
}

/* 코너 버튼 */
.timer-corner-btn {
    position: fixed;
    z-index: 50;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.95rem;
    border: 1px solid rgba(255, 255, 255, 0.25);
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    text-decoration: none;
    border-radius: 999px;
    backdrop-filter: blur(8px);
    transition: all 0.2s;
}
.timer-corner-btn:hover { color: #fff; background: rgba(255, 255, 255, 0.12); border-color: rgba(255, 255, 255, 0.4); }
.timer-corner-btn--top-left { top: 18px; left: 18px; }
.timer-corner-btn--top-right { top: 18px; right: 18px; }
.timer-brand { font-family: 'Space Grotesk', sans-serif; }

/* 메인 */
.timer-main {
    max-width: 720px;
    margin: 0 auto;
    padding: clamp(5rem, 10vw, 7rem) clamp(1rem, 4vw, 2.5rem) 4rem;
    display: flex;
    flex-direction: column;
    gap: 1.6rem;
}

.timer-header { text-align: center; margin-bottom: 0.5rem; }
.timer-eyebrow {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.22em;
    color: rgba(255, 255, 0, 0.65);
    margin-bottom: 1rem;
}
.timer-title { font-size: clamp(1.8rem, 4vw, 2.8rem); font-weight: 900; letter-spacing: -0.025em; margin: 0 0 0.5rem; }
.timer-sub { font-size: 0.92rem; color: rgba(255, 255, 255, 0.45); margin: 0; }

/* 미리보기 */
.timer-preview-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    padding: 1.6rem 1.2rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}
.timer-preview-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 50% 50%, rgba(255, 255, 0, 0.06), transparent 60%);
    pointer-events: none;
}
.timer-preview-eyebrow {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.22em;
    color: rgba(255, 255, 0, 0.7);
    margin-bottom: 0.7rem;
    text-transform: uppercase;
    word-break: break-word;
}
.timer-preview-display {
    font-family: 'NanumBarunGothic', 'NanumSquare', sans-serif;
    font-size: clamp(3rem, 9vw, 5.5rem);
    font-weight: 800;
    color: #fff;
    line-height: 1;
    letter-spacing: 0.02em;
    font-variant-numeric: tabular-nums;
    text-shadow: 0 0 24px rgba(255, 255, 0, 0.18);
}
.timer-preview-display.is-finished { color: #4ade80; }
.timer-preview-display.is-paused { color: rgba(255, 255, 255, 0.55); }

/* ─── 미리보기 테마 (OBS 표시와 비슷하게) ─── */
/* studio — 오렌지 액센트 라인 */
.preview-theme-studio .timer-preview-display {
    font-weight: 800;
    text-shadow: 0 1px 2px rgba(0,0,0,0.4), 0 4px 16px rgba(0,0,0,0.55);
}
.preview-theme-studio .timer-preview-eyebrow {
    color: #ff8800; font-weight: 800; letter-spacing: 0.32em;
    text-shadow: 0 0 10px rgba(255, 136, 0, 0.5);
}
.preview-theme-studio { position: relative; }
.preview-theme-studio::after {
    content: ''; position: absolute; left: 50%; bottom: 30%;
    transform: translateX(-50%);
    width: 60px; height: 3px;
    background: linear-gradient(90deg, transparent, #ff8800 30%, #ff8800 70%, transparent);
    border-radius: 2px; box-shadow: 0 0 12px rgba(255, 136, 0, 0.6);
}

/* glass — 글래스모피즘 */
.preview-theme-glass {
    background: linear-gradient(180deg, rgba(255,255,255,0.08), rgba(255,255,255,0.02)) !important;
    backdrop-filter: blur(14px) saturate(140%);
    -webkit-backdrop-filter: blur(14px) saturate(140%);
    border: 1px solid rgba(255,255,255,0.18) !important;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.25), 0 8px 40px rgba(0,0,0,0.25) !important;
}
.preview-theme-glass .timer-preview-display {
    font-weight: 700;
    text-shadow: 0 2px 24px rgba(255,255,255,0.18);
}
.preview-theme-glass .timer-preview-eyebrow { color: rgba(255,255,255,0.78); }

/* vapor — 베이퍼웨이브 그라데이션 */
.preview-theme-vapor .timer-preview-display {
    font-weight: 800; letter-spacing: 0.03em;
    background: linear-gradient(180deg, #80ecff 0%, #c084fc 55%, #ff8dc7 100%);
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent; color: transparent;
    filter: drop-shadow(0 0 14px rgba(192, 132, 252, 0.45));
}
.preview-theme-vapor .timer-preview-eyebrow {
    background: linear-gradient(90deg, #80ecff, #ff8dc7);
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent; color: transparent;
}

/* dawn — 일출 그라데이션 */
.preview-theme-dawn .timer-preview-display {
    font-weight: 800;
    background: linear-gradient(180deg, #ffd86b 0%, #ff8c7a 55%, #ff6ea2 100%);
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent; color: transparent;
    filter: drop-shadow(0 0 14px rgba(255, 140, 122, 0.4));
}
.preview-theme-dawn .timer-preview-eyebrow {
    background: linear-gradient(90deg, #ffd86b, #ff6ea2);
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent; color: transparent;
}

/* frost — 차가운 옅은 블루 글래스 */
.preview-theme-frost .timer-preview-display {
    color: #e0f2ff; font-weight: 700;
    text-shadow: 0 0 18px rgba(186, 230, 253, 0.6),
                 0 0 36px rgba(125, 211, 252, 0.35),
                 0 2px 4px rgba(0,0,0,0.5);
}
.preview-theme-frost .timer-preview-eyebrow {
    color: rgba(186, 230, 253, 0.85); letter-spacing: 0.2em;
    text-shadow: 0 0 10px rgba(186, 230, 253, 0.5);
}

/* soft — 코지 파스텔 */
.preview-theme-soft .timer-preview-display {
    color: #ffd9e3; font-weight: 700; letter-spacing: 0.03em;
    text-shadow: 0 0 22px rgba(255, 217, 227, 0.55), 0 2px 8px rgba(0,0,0,0.35);
}
.preview-theme-soft .timer-preview-eyebrow {
    color: #ffc8d8; font-weight: 600; letter-spacing: 0.18em;
    text-shadow: 0 0 12px rgba(255, 200, 216, 0.45);
}

/* outline — 에디토리얼 외곽선 */
.preview-theme-outline .timer-preview-display {
    color: transparent;
    -webkit-text-stroke: 2px #ffffff;
    font-weight: 900; letter-spacing: 0.04em;
    text-shadow: 0 4px 24px rgba(0,0,0,0.35);
}
.preview-theme-outline .timer-preview-eyebrow {
    color: rgba(255,255,255,0.95); font-weight: 800; letter-spacing: 0.3em;
}

/* ink — 모노톤 브루탈 */
.preview-theme-ink .timer-preview-display {
    color: #fff; font-weight: 900; letter-spacing: -0.02em;
    text-shadow: 0 0 0 #fff, 0 6px 24px rgba(0,0,0,0.85);
}
.preview-theme-ink .timer-preview-eyebrow {
    color: rgba(255,255,255,0.6); font-weight: 800;
    letter-spacing: 0.4em; text-transform: uppercase;
}
.timer-preview-status {
    margin-top: 0.7rem;
    font-family: 'Space Grotesk', monospace;
    font-size: 0.72rem;
    letter-spacing: 0.18em;
    color: rgba(255, 255, 255, 0.4);
    text-transform: uppercase;
}

/* 컨트롤 버튼 */
.timer-controls { display: flex; gap: 0.7rem; flex-wrap: wrap; }
.timer-quick-add { display: flex; gap: 0.5rem; flex-wrap: wrap; }

.timer-ctrl-btn,
.timer-add-btn {
    flex: 1 1 auto;
    min-width: 110px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.85rem 1.1rem;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.04);
    color: rgba(255, 255, 255, 0.78);
}
.timer-ctrl-btn:hover:not(:disabled),
.timer-add-btn:hover { background: rgba(255, 255, 255, 0.1); color: #fff; border-color: rgba(255, 255, 255, 0.4); }
.timer-ctrl-btn:disabled { opacity: 0.35; cursor: not-allowed; }

.timer-ctrl-btn--primary {
    background: rgba(255, 255, 0, 0.12);
    border-color: rgba(255, 255, 0, 0.45);
    color: rgba(255, 255, 0, 0.95);
}
.timer-ctrl-btn--primary:hover:not(:disabled) { background: rgba(255, 255, 0, 0.22); color: #fff; }

.timer-add-btn { flex: 1 1 0; min-width: 70px; padding: 0.7rem 0.6rem; font-size: 0.82rem; }

/* 섹션 */
.timer-section {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 1.2rem 1.2rem;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}
.timer-section h2 {
    font-family: 'Space Grotesk', monospace;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.45);
    margin: 0;
}

.timer-label { display: block; font-size: 0.72rem; color: rgba(255, 255, 255, 0.5); margin-bottom: 0.3rem; }
.timer-help { font-size: 0.78rem; color: rgba(255, 255, 255, 0.45); margin: 0; line-height: 1.5; }
.timer-help--small { font-size: 0.7rem; color: rgba(255, 255, 255, 0.35); }
.timer-help--small i { color: rgba(255, 255, 0, 0.55); margin-right: 0.3rem; }

.timer-row { display: grid; grid-template-columns: 1fr; gap: 0.6rem; }
.timer-row--3 { grid-template-columns: 1fr 1fr 1fr; }

.timer-input,
.timer-select {
    width: 100%;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.14);
    color: #fff;
    border-radius: 6px;
    padding: 0.55rem 0.7rem;
    font-family: inherit;
    font-size: 0.88rem;
    outline: none;
    transition: border-color 0.15s, background 0.15s;
}
.timer-input--mono { font-family: 'Space Grotesk', ui-monospace, monospace; font-size: 0.78rem; }
.timer-input:focus,
.timer-select:focus { border-color: rgba(255, 255, 0, 0.5); background: rgba(255, 255, 255, 0.06); }
.timer-select option { background: #111; color: #fff; }

/* number input의 기본 spinner 숨김 */
.timer-input[type="number"]::-webkit-inner-spin-button,
.timer-input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; appearance: none; margin: 0; }
.timer-input[type="number"] { -moz-appearance: textfield; appearance: textfield; }

.timer-secondary-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.65rem 1rem;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.04);
    color: rgba(255, 255, 255, 0.7);
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s;
    align-self: flex-start;
}
.timer-secondary-btn:hover { background: rgba(255, 255, 255, 0.08); color: #fff; border-color: rgba(255, 255, 255, 0.35); }
.timer-secondary-btn.is-success { background: rgba(74,222,128,0.12); border-color: rgba(74,222,128,0.45); color: #4ade80; }
.timer-secondary-btn--warn { color: #f87171; border-color: rgba(248, 113, 113, 0.4); }
.timer-secondary-btn--warn:hover { background: rgba(248, 113, 113, 0.12); border-color: rgba(248, 113, 113, 0.6); color: #fff; }

/* OBS URL */
.timer-url-row { display: flex; gap: 0.5rem; align-items: stretch; }
.timer-url-row .timer-input { flex: 1; }

.timer-advanced { margin-top: 0.4rem; }
.timer-advanced summary {
    cursor: pointer;
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.4);
    letter-spacing: 0.05em;
    user-select: none;
    padding: 0.3rem 0;
}
.timer-advanced summary:hover { color: rgba(255, 255, 255, 0.7); }
.timer-advanced[open] summary { color: rgba(255, 255, 255, 0.7); margin-bottom: 0.5rem; }

/* 연결 상태 */
.timer-conn-status {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0 auto;
    padding: 0.4rem 0.9rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 999px;
    font-family: 'Space Grotesk', monospace;
    font-size: 0.7rem;
    letter-spacing: 0.08em;
    color: rgba(255, 255, 255, 0.5);
}
.timer-conn-dot {
    width: 7px; height: 7px;
    border-radius: 50%;
    background: #888;
    transition: background 0.2s, box-shadow 0.2s;
}
.timer-conn-status.is-connected .timer-conn-dot { background: #4ade80; box-shadow: 0 0 8px rgba(74,222,128,0.6); animation: timer-pulse 2.4s ease-in-out infinite; }
.timer-conn-status.is-error .timer-conn-dot { background: #f87171; box-shadow: 0 0 8px rgba(248,113,113,0.6); }
.timer-conn-status.is-connected { color: rgba(255, 255, 255, 0.7); }
.timer-conn-status.is-error { color: #f87171; border-color: rgba(248,113,113,0.3); }

@keyframes timer-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.55; }
}

@media (max-width: 600px) {
    .timer-corner-btn span { display: none; }
    .timer-corner-btn { padding: 0.4rem 0.7rem; font-size: 0.65rem; }
    .timer-controls { flex-direction: column; }
    .timer-add-btn { min-width: 0; padding: 0.55rem 0.4rem; font-size: 0.74rem; }
    .timer-quick-add { gap: 0.35rem; }
}
