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

:root {
    --primary-color: #3498db;
    --bg-color: #f5f5f5;
    --text-color: #333;
    --card-bg: #ffffff;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background-color 0.3s, color 0.3s;
}

body.dark {
    --bg-color: #1a1a2e;
    --text-color: #ffffff;
    --card-bg: #16213e;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.container {
    text-align: center;
    padding: 20px;
    max-width: 600px;
    width: 100%;
}

.timezone-selector {
    margin-bottom: 20px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

.timezone-selector span {
    font-size: 14px;
    opacity: 0.7;
    color: var(--text-color);
}

.timezone-btn {
    padding: 6px 14px;
    font-size: 12px;
    border: 1px solid var(--primary-color);
    background-color: transparent;
    color: var(--primary-color);
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    outline: none;
}

.timezone-btn:hover {
    background-color: var(--primary-color);
    color: white;
}

.timezone-btn.active {
    background-color: var(--primary-color);
    color: white;
}

.controls {
    margin-bottom: 30px;
    display: flex;
    justify-content: center;
    gap: 10px;
}

.toggle-btn {
    padding: 12px 24px;
    font-size: 16px;
    border: 2px solid var(--primary-color);
    background-color: transparent;
    color: var(--primary-color);
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    outline: none;
}

.toggle-btn:hover {
    background-color: var(--primary-color);
    color: white;
}

.toggle-btn.active {
    background-color: var(--primary-color);
    color: white;
}

.clock-container {
    margin-bottom: 30px;
}

.clock {
    width: 300px;
    height: 300px;
    margin: 0 auto;
    background-color: var(--card-bg);
    border-radius: 50%;
    box-shadow: var(--shadow);
    position: relative;
    transition: box-shadow 0.3s;
}

.clock-face {
    width: 100%;
    height: 100%;
    position: relative;
    border-radius: 50%;
}

.hour-markers {
    position: absolute;
    width: 100%;
    height: 100%;
}

.marker {
    position: absolute;
    width: 4px;
    height: 15px;
    background-color: var(--primary-color);
    left: 50%;
    top: 10px;
    transform-origin: center 140px;
    margin-left: -2px;
    border-radius: 2px;
}

.minute-markers {
    position: absolute;
    width: 100%;
    height: 100%;
}

.small-marker {
    position: absolute;
    width: 2px;
    height: 8px;
    background-color: rgba(0, 0, 0, 0.2);
    left: 50%;
    top: 10px;
    transform-origin: center 140px;
    margin-left: -1px;
    border-radius: 1px;
}

body.dark .small-marker {
    background-color: rgba(255, 255, 255, 0.2);
}

.hand {
    position: absolute;
    bottom: 50%;
    left: 50%;
    transform-origin: bottom center;
    border-radius: 4px;
}

.hour-hand {
    width: 6px;
    height: 70px;
    background-color: var(--text-color);
    margin-left: -3px;
    z-index: 1;
}

.minute-hand {
    width: 4px;
    height: 100px;
    background-color: var(--text-color);
    margin-left: -2px;
    z-index: 2;
}

.second-hand {
    width: 2px;
    height: 120px;
    background-color: var(--primary-color);
    margin-left: -1px;
    z-index: 3;
    transition: transform 0.1s cubic-bezier(0.4, 2.3, 0.3, 1);
}

.center-dot {
    position: absolute;
    width: 16px;
    height: 16px;
    background-color: var(--primary-color);
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 4;
}

.digital-container,
.timer-container {
    margin-bottom: 30px;
}

.digital-clock,
.timer-clock {
    background-color: var(--card-bg);
    padding: 40px 30px;
    border-radius: 20px;
    box-shadow: var(--shadow);
}

.time-display {
    font-size: 64px;
    font-weight: bold;
    letter-spacing: 5px;
    margin-bottom: 15px;
}

.digit {
    color: var(--primary-color);
    font-variant-numeric: tabular-nums;
}

.separator {
    color: var(--text-color);
    animation: blink 1s infinite;
}

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

.date-display {
    font-size: 18px;
    color: var(--text-color);
    opacity: 0.7;
}

.timer-display {
    font-size: 56px;
    font-weight: bold;
    letter-spacing: 3px;
    margin-bottom: 25px;
}

.timer-digit {
    color: var(--primary-color);
    font-variant-numeric: tabular-nums;
}

.timer-digit.ms {
    font-size: 0.5em;
    opacity: 0.7;
}

.timer-separator {
    color: var(--text-color);
}

.timer-controls {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 20px;
}

.timer-btn {
    padding: 12px 30px;
    font-size: 16px;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s;
    outline: none;
    font-weight: bold;
}

.start-btn {
    background-color: #2ecc71;
    color: white;
}

.start-btn:hover {
    background-color: #27ae60;
    transform: translateY(-2px);
}

.pause-btn {
    background-color: #f39c12;
    color: white;
}

.pause-btn:hover {
    background-color: #e67e22;
    transform: translateY(-2px);
}

.reset-btn {
    background-color: #e74c3c;
    color: white;
}

.reset-btn:hover {
    background-color: #c0392b;
    transform: translateY(-2px);
}

.color-picker {
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.color-picker span {
    font-size: 14px;
    opacity: 0.7;
}

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

.color-btn {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    border: 3px solid transparent;
    cursor: pointer;
    transition: transform 0.2s, border-color 0.2s;
    outline: none;
}

.color-btn:hover {
    transform: scale(1.1);
}

.color-btn.active {
    border-color: var(--text-color);
}

.custom-color {
    width: 35px;
    height: 35px;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    padding: 0;
}

.custom-color::-webkit-color-swatch-wrapper {
    padding: 0;
}

.custom-color::-webkit-color-swatch {
    border: none;
    border-radius: 50%;
}

.theme-toggle {
    margin-top: 10px;
}

.theme-btn {
    padding: 10px 20px;
    font-size: 14px;
    border: none;
    background-color: var(--card-bg);
    color: var(--text-color);
    border-radius: 20px;
    cursor: pointer;
    box-shadow: var(--shadow);
    transition: all 0.3s;
    outline: none;
}

.theme-btn:hover {
    transform: translateY(-2px);
}

.fullscreen-btn {
    margin-top: 20px;
    padding: 10px 20px;
    font-size: 14px;
    border: none;
    background-color: var(--primary-color);
    color: white;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s;
    outline: none;
}

.fullscreen-btn:hover {
    opacity: 0.8;
    transform: scale(1.05);
}

.links {
    margin-top: 60px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
}

.links a {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 14px;
    transition: opacity 0.3s;
}

.links a:hover {
    opacity: 0.7;
}

.link-separator {
    color: var(--text-color);
    opacity: 0.3;
}

.footer {
    margin-top: 15px;
    font-size: 12px;
    opacity: 0.5;
    color: var(--text-color);
}

body.fullscreen {
    background-color: #000;
}

body.fullscreen .container {
    max-width: none;
    width: 100%;
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

body.fullscreen .timezone-selector,
body.fullscreen .controls,
body.fullscreen .color-picker,
body.fullscreen .theme-toggle,
body.fullscreen .links,
body.fullscreen .footer,
body.fullscreen .timer-controls {
    display: none;
}

body.fullscreen .timer-container {
    margin-bottom: 0;
}

body.fullscreen .timer-clock {
    background-color: transparent;
    padding: 0;
    box-shadow: none;
}

body.fullscreen .timer-display {
    font-size: 10vw;
    margin-bottom: 20px;
}

body.fullscreen .timer-digit {
    color: #fff;
}

body.fullscreen .timer-separator {
    color: #fff;
}

body.fullscreen .digital-container {
    margin-bottom: 0;
}

body.fullscreen .digital-clock {
    background-color: transparent;
    padding: 0;
    box-shadow: none;
}

body.fullscreen .time-display {
    font-size: 12vw;
    margin-bottom: 20px;
}

body.fullscreen .date-display {
    font-size: 3vw;
    color: rgba(255, 255, 255, 0.85);
    opacity: 1;
}

body.fullscreen .digit {
    color: #fff;
}

body.fullscreen .separator {
    color: #fff;
}

body.fullscreen .center-dot {
    background-color: #fff;
}

body.fullscreen .marker {
    background-color: #fff;
}

body.fullscreen .small-marker {
    background-color: rgba(255, 255, 255, 0.3);
}

body.fullscreen .hour-hand,
body.fullscreen .minute-hand {
    background-color: #fff;
}

body.fullscreen .second-hand {
    background-color: #fff;
}

body.fullscreen .fullscreen-btn {
    background-color: rgba(255, 255, 255, 0.2);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.3);
    font-size: 12px;
    padding: 8px 16px;
}

body.fullscreen .fullscreen-btn:hover {
    background-color: rgba(255, 255, 255, 0.3);
}

@media (max-width: 480px) {
    .clock {
        width: 250px;
        height: 250px;
    }

    .marker {
        transform-origin: center 115px;
        top: 10px;
    }

    .small-marker {
        transform-origin: center 115px;
        top: 10px;
    }

    .hour-hand {
        height: 55px;
    }

    .minute-hand {
        height: 80px;
    }

    .second-hand {
        height: 95px;
    }

    .time-display {
        font-size: 48px;
        letter-spacing: 3px;
    }

    .digital-clock {
        padding: 30px 20px;
    }

    .toggle-btn {
        padding: 10px 18px;
        font-size: 14px;
    }
}