/* styles.css */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background: linear-gradient(135deg, #0f2027, #203a43, #2c5364);
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
}

.timer-container {
    background: rgba(255, 255, 255, 0.08);
    padding: 1.5rem 2rem;
    border-radius: 20px;
    backdrop-filter: blur(12px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    text-align: center;
    width: 90%;
    max-width: 440px;
    position: relative;
}

/* Utility Bar */
.utility-bar {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.utility-bar button {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: #a8d0e6;
    padding: 6px 12px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 0.85rem;
}

.utility-bar button:hover { background: rgba(255, 255, 255, 0.3); }

h2 {
    color: #a8d0e6;
    text-transform: uppercase;
    letter-spacing: 2px;
}

/* SVG Circle Display */
.circle-box {
    position: relative;
    width: 280px;
    height: 280px;
    margin: 0.5rem auto;
    display: flex;
    justify-content: center;
    align-items: center;
}

.progress-ring {
    position: absolute;
    top: 0; left: 0;
}

.progress-ring__circle {
    transform: rotate(-90deg);
    transform-origin: 50% 50%;
}

.display-content {
    z-index: 2;
}

/* Time Display Adjusted for Milliseconds */
.time-display {
    font-size: 2.6rem; /* Reduced slightly to fit MS */
    font-weight: bold;
    font-variant-numeric: tabular-nums;
}

.time-display .ms {
    font-size: 1.5rem;
    color: #00d2ff;
}

.time-display.placeholder {
    color: rgba(255, 255, 255, 0.4);
}
.time-display.placeholder .ms { color: rgba(0, 210, 255, 0.4); }

.type-hint {
    font-size: 0.75rem;
    color: #a8d0e6;
    margin-top: 4px;
}

/* Keypad Grid */
.keypad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    max-width: 220px;
    margin: 0.5rem auto 1rem;
}

.keypad button {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    padding: 8px;
    border-radius: 6px;
    font-size: 1.1rem;
    cursor: pointer;
}
.keypad button:hover { background: rgba(255, 255, 255, 0.25); }

/* Settings Bar */
.settings-bar {
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    color: #a8d0e6;
}

.tick-label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.tick-label input[type="number"] {
    width: 50px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 4px;
    border-radius: 4px;
    text-align: center;
}

/* Hide Spinners in input */
input[type=number]::-webkit-inner-spin-button { -webkit-appearance: none; }

/* Controls */
.controls {
    display: flex;
    justify-content: center;
    gap: 10px;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    color: white;
}

.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.start { background-color: #00b09b; }
.pause { background-color: #ff9800; }
.reset { background-color: #e53935; }

.stop-alarm {
    width: 100%;
    margin-top: 15px;
    background-color: #ff0055;
    animation: pulse 1s infinite;
}

.hidden { display: none !important; }

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.03); }
    100% { transform: scale(1); }
}