@font-face {
    font-family: ClockIcons;
    src: url("data:font/woff2;base64,") format("woff2");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

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

:root {
    --cd-back: #1a1a1a;
    --cd-back-2: #2c2d32;
    --cd-back-3: #28292e;
    --cd-back-3-h: #3a3c44;
    --cd-bord-1: #7a7b86;
    --cd-bord-2: #494950;
    --gray-400: #9ca3af;
    --white-60: rgba(255, 255, 255, 0.6);
    --white-80: rgba(255, 255, 255, 0.8);
}

html, body {
    font-family: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, system-ui, Roboto, "Helvetica Neue", "Segoe UI", "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", sans-serif;
    height: 100%;
    overflow: hidden;
}

.bg-cd-back {
    background-color: var(--cd-back);
}

.h-full {
    height: 100%;
}

.pip-root {
    position: relative;
    height: 100vh;
    display: flex;
    color: white;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

/* 사이드바 제거됨 */

/* 메인 컨텐츠 */
.main-content {
    margin: 0 auto;
    width: 100%;
    max-width: 1200px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    overflow-y: auto;
    padding: 0;
    align-items: center;
}

/* 설정 패널 */
.settings-panel {
    background: var(--cd-back-2);
    border: 1px solid var(--cd-bord-2);
    border-radius: 16px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    width: fit-content;
    min-width: 200px;
    margin: 0 auto;
}

.time-inputs-row {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.time-input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
}

.time-input-group label {
    font-size: 0.875rem;
    color: var(--white-80);
    font-weight: 500;
}

.time-input-group input[type="number"] {
    width: 100%;
    padding: 8px 12px;
    font-size: 0.9rem;
    border: 1px solid var(--cd-bord-2);
    border-radius: 8px;
    background: var(--cd-back-3);
    color: white;
    transition: all 0.3s;
    max-width: 200px;
}

.time-input-group input[type="number"]:hover:not(:disabled) {
    border-color: var(--cd-bord-1);
}

.time-input-group input[type="number"]:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.time-input-group input[type="number"]:disabled {
    background: var(--cd-back);
    color: var(--gray-400);
    cursor: not-allowed;
    opacity: 0.7;
}

.color-picker-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.color-picker-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.color-picker-group label {
    font-size: 0.875rem;
    color: var(--white-80);
    font-weight: 500;
}

.color-picker-group input[type="color"] {
    width: 100%;
    height: 48px;
    border: 1px solid var(--cd-bord-2);
    border-radius: 8px;
    cursor: pointer;
    background: var(--cd-back-3);
    transition: border-color 0.3s;
}

.color-picker-group input[type="color"]:hover {
    border-color: var(--cd-bord-1);
}

.action-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 4px;
}

.action-btn {
    padding: 12px 24px;
    font-size: 0.875rem;
    border: 1px solid var(--cd-bord-2);
    border-radius: 10px;
    background: var(--cd-back-3);
    color: white;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 500;
}

.action-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.action-btn:hover:not(:disabled) {
    background: var(--cd-back-3-h);
    border-color: var(--cd-bord-1);
}

.action-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 타이머 그리드 */
.timer-grid {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    margin: 0 auto;
    gap: 20px;
}

/* 미디어 쿼리에서 그리드 관련 스타일 제거 (flex로 변경됨) */

/* 타이머 카드 */
.timer-card {
    width: auto;
    min-width: fit-content;
    max-width: 100%;
    border: 1px solid var(--cd-bord-2);
    border-radius: 16px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background: var(--cd-back-3);
    transition: all 0.3s;
    position: relative;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    margin: 0 auto;
}

.timer-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    border-color: var(--cd-bord-1);
}

/* 타이머 카드 경고 애니메이션 제거됨 */

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

.icon-btn {
    background: transparent;
    border: none;
    color: var(--white-60);
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    border-radius: 4px;
}

.icon-btn:hover {
    color: white;
    background: rgba(255, 255, 255, 0.1);
}

.icon-btn .lucide-repeat,
.icon-btn .lucide-volume2 {
    width: 16px;
    height: 16px;
}

.timer-card-number {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 4px;
    margin-bottom: 8px;
}

.timer-card-number .text-base {
    font-size: 1rem;
    color: var(--white-80);
}

.timer-display {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px 24px;
    background: linear-gradient(135deg, var(--normal-color-start) 0%, var(--normal-color-end) 100%);
    border-radius: 12px;
    margin-bottom: 12px;
    transition: background 0.3s ease, width 0.3s ease;
    --normal-color-start: #2c2d32;
    --normal-color-end: #1a1a1a;
    --warning-color-start: #ff6b6b;
    --warning-color-end: #ee5a6f;
    min-height: 100px;
    min-width: 120px;
    width: auto;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.timer-display.warning {
    animation: timerDisplayBlink 0.5s infinite;
}

@keyframes timerDisplayBlink {
    0%, 100% {
        background: linear-gradient(135deg, var(--normal-color-start) 0%, var(--normal-color-end) 100%);
    }
    50% {
        background: linear-gradient(135deg, var(--warning-color-start) 0%, var(--warning-color-end) 100%);
    }
}

.clock-font {
    font-family: 'SF Mono', 'Monaco', 'Cascadia Code', 'Roboto Mono', 'Consolas', 'Courier New', monospace;
    font-size: 3rem;
    font-weight: 600;
    color: white;
    text-shadow: 
        0 0 10px rgba(255, 255, 255, 0.3),
        0 2px 4px rgba(0, 0, 0, 0.5),
        0 4px 8px rgba(0, 0, 0, 0.3);
    line-height: 1.2;
    letter-spacing: 0.1em;
    font-variant-numeric: tabular-nums;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    white-space: nowrap;
    display: inline-block;
}

.timer-card-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 12px;
}

.timer-icon-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.timer-icon-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.timer-icon-btn:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.timer-icon-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.timer-icon-btn .icon-svg {
    width: 20px;
    height: 20px;
}

/* 음량 컨트롤 래퍼 */
.volume-control-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

/* 음량 슬라이더 컨테이너 */
.volume-slider-container {
    position: absolute;
    left: calc(100% + 12px);
    bottom: 0;
    background: var(--cd-back-2);
    border: 1px solid var(--cd-bord-2);
    border-radius: 8px;
    padding: 12px 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 10;
    width: 60px; /* 고정 너비 */
    box-sizing: border-box;
}

/* 음량 슬라이더 래퍼 */
.volume-slider-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    width: 100%;
    position: relative;
}

/* 슬라이더를 감싸는 추가 컨테이너 */
.volume-slider-wrapper::before {
    content: '';
    display: block;
    width: 4px;
    height: 120px;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    pointer-events: none;
    background: transparent;
}

/* 슬라이더 래퍼는 flex로 중앙 정렬 */

/* 음량 슬라이더 (세로) */
.volume-slider {
    width: 4px;
    height: 120px;
    border-radius: 2px;
    background: var(--cd-bord-2);
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    writing-mode: bt-lr; /* IE */
    -webkit-appearance: slider-vertical; /* WebKit */
    writing-mode: vertical-lr; /* 표준 */
    transform: rotate(180deg); /* 위에서 아래로 */
    position: relative;
    margin: 0 auto;
    display: block;
    left: 0;
    right: 0;
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #3b82f6;
    cursor: pointer;
    transition: all 0.2s;
    margin-left: -6px; /* (14px - 4px) / 2 = 5px로 중앙 정렬 */
}

.volume-slider::-webkit-slider-thumb:hover {
    background: #60a5fa;
    transform: scale(1.2);
}

.volume-slider::-webkit-slider-runnable-track {
    width: 4px;
    height: 120px;
    background: var(--cd-bord-2);
    border-radius: 2px;
    margin: 0 auto;
}

.volume-slider::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #3b82f6;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    position: relative;
}

.volume-slider::-moz-range-thumb:hover {
    background: #60a5fa;
    transform: scale(1.2);
}

.volume-slider::-moz-range-track {
    width: 4px;
    height: 120px;
    background: var(--cd-bord-2);
    border-radius: 2px;
}

/* 음량 값 표시 */
.volume-value {
    font-size: 0.75rem;
    color: var(--white-80);
    text-align: center;
    width: 100%;
    min-width: 40px;
    display: inline-block;
}

/* 재생 버튼 특별 스타일 */
#start-btn {
    background: #3b82f6;
}

#start-btn:hover:not(:disabled) {
    background: #60a5fa;
}

/* 정지 버튼 특별 스타일 */
#stop-btn {
    background: #ef4444;
}

#stop-btn:hover:not(:disabled) {
    background: #f87171;
}

/* 리셋 버튼은 기본 스타일 유지 */

/* 스크롤바 스타일 */
.main-content::-webkit-scrollbar {
    width: 8px;
}

.main-content::-webkit-scrollbar-track {
    background: var(--cd-back);
}

.main-content::-webkit-scrollbar-thumb {
    background: var(--cd-bord-2);
    border-radius: 4px;
}

.main-content::-webkit-scrollbar-thumb:hover {
    background: var(--cd-bord-1);
}

/* PIP 관련 */
#pip-video {
    cursor: pointer;
    pointer-events: auto;
}

/* 반응형 */
@media (max-width: 640px) {
    /* time-inputs-row는 이미 flex column으로 세로 배치됨 */
    
    .color-picker-section {
        grid-template-columns: 1fr;
    }
    
    .timer-grid {
        grid-template-columns: 1fr;
        justify-content: center;
    }
    
    .timer-card {
        width: 100%;
        max-width: 300px;
        margin: 0 auto;
    }
}
