:root {
    --bg-color: #ffffff;
    --text-color: #000000;
    --clock-bg: #fafbfc;
    --clock-text: #333333;
    --container-bg: #e0e0e0;
    --border-color: #cccccc;
    --toggle-bg: #dddddd;
}

.dark-mode {
    --bg-color: #1a1a1a;
    --text-color: #f0f0f0;
    --clock-bg: #333333;
    --clock-text: #ffffff;
    --container-bg: #444444;
    --border-color: #666666;
    --toggle-bg: #555555;
}

body {
    font-family: Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    margin: 0;
    padding: 20px;
    transition: background-color 0.3s, color 0.3s;
}

.container {
    min-width: 200px;
    max-width: 90%;
    margin: 0 auto;
    padding: 2rem;
    background-color: var(--container-bg);
    border-radius: 1rem;
    box-shadow: 0 0.2rem 1rem rgba(0, 0, 0, 0.1);
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    width: 100%;
}

h1 {
    text-align: left;
    text-transform: uppercase;
    font-size: 1rem;
    margin: 0;
}

.dark-mode-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Dark mode toggle switch styling */
.dark-mode-toggle input[type="checkbox"],
.control-group input[type="checkbox"] {
    opacity: 0;
    position: absolute;
    width: 0;
    height: 0;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 30px;
    cursor: pointer;
}

.toggle-switch::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background-color: #ccc;
    border-radius: 30px;
    transition: background-color 0.3s;
}

.toggle-switch::after {
    content: '';
    position: absolute;
    width: 26px;
    height: 26px;
    background-color: white;
    border-radius: 50%;
    top: 2px;
    left: 2px;
    transition: transform 0.3s;
}

input[type="checkbox"]:checked + label.toggle-switch::before {
    background-color: #006400;
}

input[type="checkbox"]:checked + label.toggle-switch::after {
    transform: translateX(30px);
}

/* Blue theme toggle switches */
.toggle-switch.blue-theme::before {
    background-color: #8dd2f6;
}

input[type="checkbox"]:checked + label .toggle-switch.blue-theme::before {
    background-color: #ff7a59;
}

input[type="checkbox"]:checked + label.toggle-switch::after,
input[type="checkbox"]:checked + label .toggle-switch::after {
    transform: translateX(30px);
}

/* Radio option styling */
.seconds-options input[type="radio"] {
    opacity: 0;
    position: absolute;
    width: 0;
    height: 0;
}

.radio-option {
    position: relative;
    display: inline-block;
    width: 30px;
    height: 30px;
    cursor: pointer;
    flex-shrink: 0;
    margin-right: 8px;
}

.radio-option::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background-color: #8dd2f6;
    border-radius: 50%;
    transition: background-color 0.3s;
}

.radio-option::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    background-color: white;
    border-radius: 50%;
    top: 5px;
    left: 5px;
    transition: background-color 0.3s;
}

input[type="radio"]:checked + .radio-option::before {
    background-color: #ff7a59;
}

/* Settings section styling */
.settings-flex {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    width: 100%;
}

.settings-select {
    padding: 5px 12px;
    height: 30px;
    border-radius: 15px;
    border: 1px solid #666;
    background-color: #8dd2f6;
    color: #333;
    cursor: pointer;
    font-family: Arial, sans-serif;
    font-size: 14px;
}

.settings-select:focus,
.settings-select:hover {
    outline: none;
    background-color: #ff7a59;
    color: white;
}

.clock-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    padding: 2rem;
    background-color: var(--clock-bg);
    border-radius: 0.4rem;
    margin-bottom: 2rem;
}

.digital-time {
    font-family: 'Courier New', monospace;
    font-size: clamp(4rem, 12vw, 12rem);
    font-weight: bold;
    color: var(--clock-text);
    white-space: nowrap;
}

.time-period {
    font-family: 'Courier New', monospace;
    font-size: clamp(4rem, 12vw, 12rem);
    font-weight: bold;
    color: var(--clock-text);
    white-space: nowrap;
}

.date-display {
    font-family: 'Courier New', monospace;
    font-size: 2rem;
    color: var(--clock-text);
}

.time-display {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: center;
    font-size: clamp(4rem, 12vw, 12rem);
}

.analog-seconds {
    position: relative;
    width: 0.7em;
    height: 0.7em;
    display: none;
    margin-bottom: 0.08em;
}

.bg-image {
    position: absolute;
    width: 100%;
    height: 100%;
    background-color: #888888;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    border-radius: 55%;
    overflow: hidden;
}

.white-overlay {
    position: absolute;
    width: 100%;
    height: 100%;
}

.white-overlay #reveal-sector {
    fill: black;
}

.analog-seconds line {
    stroke: red;
    stroke-width: 2;
    stroke-linecap: round;
}

.controls {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.left-controls, .right-controls {
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

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

label {
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
}

select, button {
    padding: 8px 12px;
    border-radius: 5px;
    border: 1px solid var(--border-color);
    background-color: var(--toggle-bg);
    color: var(--text-color);
    cursor: pointer;
}

button {
    background-color: var(--toggle-bg);
}

button:hover {
    opacity: 0.8;
}

.settings-menu {
    margin-top: 20px;
}

.settings-menu summary {
    cursor: pointer;
    padding: 8px;
    background-color: var(--toggle-bg);
    border-radius: 5px;
}

.settings-menu [type="checkbox"], .settings-menu [type="radio"] {
    margin-right: 8px;
}

.settings-content {
    padding: 10px;
    background-color: var(--clock-bg);
    border-radius: 5px;
    margin-top: 5px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

@media (max-width: 600px) {
    .clock-container {
        flex-direction: column;
    }
    .digital-clock {
        font-size: clamp(2rem, 8vw, 4rem);
    }
}
