:root {
    --primary-color: #6c63ff;
    --secondary-color: #f50057;
    --bg-color: #121212;
    --text-color: #ffffff;
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    background: radial-gradient(circle at top left, #2c2f48, #121212);
    padding: 20px;
}

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

h1 {
    font-size: 2.2rem;
    margin-bottom: 5px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.clock-display {
    font-size: 1.2rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.7);
    letter-spacing: 2px;
}

.actions {
    margin-bottom: 30px;
}

.timers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    width: 100%;
    max-width: 1200px;
    justify-items: center;
}

/* Base Glass Container - reused */
.timer-container, .timer-card {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.timer-card {
    padding: 20px;
    width: 280px;
    text-align: center;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: transform 0.3s, box-shadow 0.3s;
}

.timer-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4);
}

.timer-card.running {
    box-shadow: 0 0 20px rgba(108, 99, 255, 0.3);
}
.timer-card.finished {
    box-shadow: 0 0 20px rgba(245, 0, 87, 0.6);
    animation: pulse 1.5s infinite;
}

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

.timer-name {
    font-size: 1.3rem;
    margin-bottom: 15px;
    font-weight: 600;
}

.delete-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255,255,255,0.1);
    border: none;
    color: var(--text-color);
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    justify-content: center;
    align-items: center;
    min-width: unset;
    padding: 0;
}
.delete-btn:hover {
    background: var(--secondary-color);
}

.circle-container-small {
    position: relative;
    width: 160px;
    height: 160px;
    margin: 0 auto 20px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.time-display-small {
    font-size: 2.2rem;
    font-weight: 700;
    letter-spacing: 1px;
    position: absolute;
    z-index: 10;
    text-shadow: 0 2px 8px rgba(0,0,0,0.5);
}

svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
    z-index: 1;
}

.bg-circle {
    fill: none;
    stroke: rgba(255,255,255,0.05);
    stroke-width: 8;
}

.progress-circle {
    fill: none;
    stroke: url(#gradient);
    stroke-width: 8;
    stroke-linecap: round;
    /* r=70 -> circumference = 2*PI*70 = ~440 */
    stroke-dasharray: 440;
    stroke-dashoffset: 0;
    transition: stroke-dashoffset 1s linear;
    filter: drop-shadow(0 0 8px rgba(108, 99, 255, 0.5));
}

.controls-small {
    display: flex;
    justify-content: center;
    gap: 10px;
    width: 100%;
}

button {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: var(--text-color);
    padding: 10px 20px;
    border-radius: 50px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    outline: none;
    font-weight: 600;
}

button:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

button.primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border: none;
}

button.primary:hover {
    background: linear-gradient(135deg, #7b73ff, #ff3377);
    box-shadow: 0 5px 15px rgba(108, 99, 255, 0.4);
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    padding: 30px;
    width: 90%;
    max-width: 400px;
}

.modal-content h2 {
    margin-bottom: 20px;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
}

.input-container {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
}

.label {
    font-size: 0.85rem;
    color: rgba(255,255,255,0.7);
    margin-bottom: 5px;
    text-transform: uppercase;
}

input[type="text"], input[type="number"] {
    background: rgba(0,0,0,0.3);
    border: 1px solid var(--glass-border);
    color: var(--text-color);
    padding: 12px;
    border-radius: 12px;
    width: 100%;
    font-size: 1.2rem;
    outline: none;
    font-weight: bold;
    transition: border-color 0.3s, box-shadow 0.3s;
}

input[type="text"]:focus, input[type="number"]:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 10px rgba(108, 99, 255, 0.3);
}

.controls {
    display: flex;
    justify-content: space-between;
}
