/* Alarm clock app specific styles */

/* === Digital Clock === */
#digital-clock {
    font-family: var(--mono);
    font-size: clamp(3.2rem, 14vw, 6.5rem);
    line-height: 1;
    text-align: center;
    letter-spacing: 0.06em;
    color: var(--display-color);
    padding: 20px 0 24px;
    -webkit-user-select: none;
    user-select: none;
    transition: color 0.3s;
}

/* === Clock Layout (digital + analog side by side on desktop) === */
.clock-body {
    display: flex;
    flex-direction: column;
    gap: 28px;
    align-items: center;
}

@media (min-width: 560px) {
    .clock-body {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 20px;
    }

    .alarm-settings {
        flex: 1;
    }
}

/* === Alarm Settings === */
.alarm-settings {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 100%;
}

/* ==== Keyboard hint spacing ==== */
.kbd-hint {
    margin-top: 20px;
}

.setting-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 4px;
}

#alarm-input {
    font-family: var(--mono);
    font-size: 2rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-btn);
    color: var(--text);
    padding: 12px 16px;
    width: 100%;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
    color-scheme: dark;
}

[data-theme="light"] #alarm-input {
    color-scheme: light;
}

#alarm-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-dim);
}

/* === Toggle Switch === */
.toggle-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.toggle-switch {
    position: relative;
    width: 52px;
    height: 28px;
    flex-shrink: 0;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-track {
    position: absolute;
    inset: 0;
    background: var(--surface-high);
    border: 1px solid var(--border);
    border-radius: 999px;
    cursor: pointer;
    transition: background 0.25s, border-color 0.25s;
}

.toggle-track::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    background: var(--text-muted);
    border-radius: 50%;
    transition: transform 0.25s, background 0.25s;
}

.toggle-switch input:checked+.toggle-track {
    background: var(--accent);
    border-color: var(--accent);
}

.toggle-switch input:checked+.toggle-track::after {
    transform: translateX(24px);
    background: #fff;
}

#alarm-toggle-label {
    font-size: 0.9rem;
    color: var(--text-muted);
    cursor: pointer;
    -webkit-user-select: none;
    user-select: none;
    transition: color 0.2s;
}

/* === Alarm Status === */
.alarm-status {
    font-size: 0.82rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
    min-height: 1.2em;
    transition: color 0.3s;
}

.alarm-status.active {
    color: var(--accent);
}

.alarm-status.active::before {
    content: '●';
    animation: pulse-dot 1.2s ease-in-out infinite alternate;
}

@keyframes pulse-dot {
    to {
        opacity: 0.3;
    }
}

/* === Analog Clock === */
.analog-wrap {
    flex-shrink: 0;
}

.analog-clock {
    position: relative;
    width: 180px;
    height: 180px;
    border: 2px solid var(--border);
    border-radius: 50%;
    background: var(--surface);
    box-shadow: 0 0 0 6px var(--surface), 0 0 0 7px var(--border);
}

.analog-clock::before {
    content: '';
    position: absolute;
    top: 9px;
    left: 50%;
    width: 5px;
    height: 5px;
    background: var(--text-muted);
    border-radius: 50%;
    transform: translateX(-50%);
}

.hand {
    position: absolute;
    bottom: 50%;
    left: 50%;
    transform-origin: bottom center;
    border-radius: 4px 4px 2px 2px;
    transform: translateX(-50%) rotateZ(0deg);
}

.hr-hand {
    width: 5px;
    height: 52px;
    background: var(--text);
    margin-bottom: 0;
}

.mn-hand {
    width: 3px;
    height: 70px;
    background: var(--text);
}

.sc-hand {
    width: 2px;
    height: 78px;
    background: var(--accent);
    border-radius: 2px;
}

.sc-hand::after {
    content: '';
    position: absolute;
    bottom: -16px;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: 16px;
    background: var(--accent);
    border-radius: 0 0 2px 2px;
}

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

.sc-center {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 6px;
    height: 6px;
    background: var(--accent);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    z-index: 11;
}

/* === Alarm Overlay === */
#alarm-overlay {
    display: none;
    position: absolute;
    inset: 0;
    border-radius: var(--radius-card);
    background: var(--overlay-bg);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    z-index: 10;
}

#alarm-overlay.visible {
    display: flex;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.alarm-ring-emoji {
    font-size: 3.5rem;
    animation: swing 0.4s ease-in-out infinite alternate;
}

@keyframes swing {
    from {
        transform: rotate(-15deg);
    }

    to {
        transform: rotate(15deg);
    }
}

.alarm-ring-title {
    font-family: var(--mono);
    font-size: clamp(1.8rem, 7vw, 2.8rem);
    color: #fff;
    text-shadow: 0 0 24px var(--red);
}

.alarm-ring-time {
    font-family: var(--mono);
    font-size: 1.2rem;
    color: var(--text-muted);
}

#dismiss-btn {
    padding: 14px 52px;
    background: #fff;
    color: #111;
    border: none;
    border-radius: var(--radius-btn);
    font-family: var(--sans);
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.12s, box-shadow 0.12s;
    box-shadow: 0 4px 24px rgba(255, 255, 255, 0.15);
}

#dismiss-btn:hover {
    transform: scale(1.06);
}

#dismiss-btn:active {
    transform: scale(0.97);
}

[data-theme="light"] #dismiss-btn {
    background: #111118;
    color: #fff;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.18);
}

@media (max-width: 480px) {
    #digital-clock {
        font-size: clamp(2.8rem, 13vw, 5rem);
    }

    .analog-clock {
        width: 150px;
        height: 150px;
    }

    .hr-hand {
        height: 42px;
    }

    .mn-hand {
        height: 58px;
    }

    .sc-hand {
        height: 64px;
    }
}