/* 基礎設置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #e85d4e;
    --secondary-color: #4a90e2;
    --success-color: #5cb85c;
    --bg-color: #1a1a2e;
    --card-bg: #16213e;
    --text-color: #eaeaea;
    --text-muted: #a0a0a0;
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Microsoft JhengHei', sans-serif;
    background: var(--bg-color);
    color: var(--text-color);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    transition: background-color 0.3s ease;
}

body.work-mode {
    background: linear-gradient(135deg, #1a1a2e 0%, #2d1f3d 100%);
}

body.break-mode {
    background: linear-gradient(135deg, #1a1a2e 0%, #1f3d2d 100%);
}

/* 主容器 */
.container {
    width: 100%;
    max-width: 600px;
    background: var(--card-bg);
    border-radius: 24px;
    padding: 40px;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
}

.header {
    text-align: center;
    margin-bottom: 40px;
}

.header h1 {
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 10px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* 狀態徽章 */
.status-badge {
    display: inline-block;
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    background: rgba(232, 93, 78, 0.2);
    color: var(--primary-color);
    transition: all 0.3s ease;
}

.status-badge.break {
    background: rgba(92, 184, 92, 0.2);
    color: var(--success-color);
}

/* 計時器顯示 */
.timer-display {
    text-align: center;
    margin: 60px 0;
}

.time {
    font-size: 6rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    font-variant-numeric: tabular-nums;
    transition: all 0.3s ease;
}

/* 進度圓環 */
.progress-ring {
    width: 280px;
    height: 280px;
    margin: 0 auto 20px;
    position: relative;
}

.progress-ring svg {
    transform: rotate(-90deg);
}

.progress-ring circle {
    fill: none;
    stroke-width: 8;
    transition: stroke-dashoffset 0.3s linear;
}

.progress-ring .bg-circle {
    stroke: rgba(255, 255, 255, 0.1);
}

.progress-ring .progress-circle {
    stroke: var(--primary-color);
    stroke-linecap: round;
}

/* 控制按鈕 */
.controls {
    display: flex;
    gap: 16px;
    justify-content: center;
    margin-bottom: 40px;
}

.btn {
    padding: 16px 32px;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), #d64437);
    color: white;
    flex: 1;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-color);
    border: 2px solid rgba(255, 255, 255, 0.2);
}

/* 統計數據 */
.stats {
    display: flex;
    justify-content: space-around;
    margin-bottom: 30px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
}

.stat-item {
    text-align: center;
}

.stat-value {
    font-size: 2rem;
    font-weight: 600;
    color: var(--primary-color);
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 5px;
}

/* 設定面板 */
.settings {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 24px;
}

.settings-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    margin-bottom: 16px;
}

.settings-toggle h3 {
    font-size: 1.1rem;
    font-weight: 500;
}

.settings-toggle svg {
    transition: transform 0.3s ease;
}

.settings-toggle.active svg {
    transform: rotate(180deg);
}

.settings-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.settings-content.active {
    max-height: 500px;
}

.setting-item {
    margin-bottom: 20px;
}

.setting-item label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.setting-item input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-color);
    font-size: 1rem;
    transition: all 0.3s ease;
}

.setting-item input:focus {
    outline: none;
    border-color: var(--primary-color);
    background: rgba(255, 255, 255, 0.08);
}

/* 全螢幕樣式 */
body.fullscreen-active .container {
    display: none;
}

.fullscreen-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #000000;
    z-index: 9999;
    flex-direction: column;
}

body.fullscreen-active .fullscreen-overlay {
    display: flex;
}

/* 頂部導航欄 */
.fullscreen-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: clamp(16px, 3vh, 32px) clamp(20px, 4vw, 40px);
    width: 100%;
}

.fullscreen-nav-left {
    display: flex;
    align-items: center;
    gap: clamp(8px, 1.5vw, 16px);
    color: #ffffff;
}

.fullscreen-nav-left svg {
    width: clamp(20px, 4vmin, 32px);
    height: clamp(20px, 4vmin, 32px);
}

.fullscreen-nav-left span {
    font-size: clamp(0.9rem, 2.5vmin, 1.2rem);
    font-weight: 500;
}

.fullscreen-nav-right svg {
    width: clamp(20px, 4vmin, 28px);
    height: clamp(20px, 4vmin, 28px);
    color: #ffffff;
    cursor: pointer;
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.fullscreen-nav-right svg:hover {
    opacity: 1;
}

/* 時間顯示區域 */
.fullscreen-time-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fullscreen-overlay .time {
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Orbitron', monospace;
    font-size: clamp(5rem, 28vmin, 45rem);
    font-weight: 900;
    line-height: 1;
    margin: 0;
    color: #ffffff;
    letter-spacing: clamp(0.1em, 2vmin, 0.15em);
    text-shadow: 0 0 clamp(10px, 2vmin, 30px) rgba(255, 255, 255, 0.3);
}

.t-sep {
    display: inline-block;
    transition: transform 0.3s ease;
}

/* 底部控制按鈕 */
.fullscreen-controls {
    display: flex;
    gap: clamp(12px, 3vw, 24px);
    justify-content: center;
    padding: clamp(20px, 4vh, 40px) clamp(20px, 4vw, 40px);
    width: 100%;
}

.fullscreen-btn {
    flex: 1;
    max-width: clamp(140px, 30vw, 260px);
    padding: clamp(14px, 2.5vh, 20px) clamp(24px, 5vw, 40px);
    border-radius: clamp(8px, 2vmin, 16px);
    font-size: clamp(0.95rem, 2.5vmin, 1.2rem);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid;
}

.fullscreen-btn:active {
    transform: scale(0.98);
}

.fullscreen-btn.pause-btn,
.fullscreen-btn.resume-btn {
    background: #2d7a4f;
    color: #ffffff;
    border-color: #2d7a4f;
}

.fullscreen-btn.pause-btn:hover,
.fullscreen-btn.resume-btn:hover {
    background: #36915e;
}

.fullscreen-btn.stop-btn {
    background: transparent;
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.3);
}

.fullscreen-btn.stop-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.5);
}

/* 橫屏優化 */
@media (orientation: landscape) {
    .fullscreen-overlay .time {
        flex-direction: row;
        font-size: clamp(10rem, 35vmin, 55rem);
        letter-spacing: clamp(0.1em, 2vmin, 0.2em);
    }
    
    .t-sep {
        transform: rotate(0deg);
        margin: 0 clamp(10px, 2vw, 30px);
    }
    
    .fullscreen-controls {
        max-width: 600px;
        margin: 0 auto;
    }
}

/* 豎屏優化 */
@media (orientation: portrait) {
    .fullscreen-overlay .time {
        flex-direction: column;
        font-size: clamp(12rem, 50vmin, 70rem);
        line-height: 0.9;
    }
    
    .t-sep {
        transform: rotate(90deg);
        margin: clamp(2vh, 4vh, 6vh) 0;
        font-size: 0.6em;
    }
}

/* 響應式設計 */
@media (max-width: 768px) {
    .container {
        padding: 30px 20px;
    }

    .time {
        font-size: 4rem;
    }

    .progress-ring {
        width: 220px;
        height: 220px;
    }

    .controls {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }

    .stats {
        flex-direction: column;
        gap: 20px;
    }
}

@media (max-width: 480px) {
    .time {
        font-size: 3rem;
    }

    .header h1 {
        font-size: 1.5rem;
    }

    .progress-ring {
        width: 180px;
        height: 180px;
    }
}

/* 動畫效果 */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.6;
    }
}

.time.pulse {
    animation: pulse 1s ease-in-out infinite;
}

.time.warning {
    color: var(--primary-color);
}
