:root {
    --bg-color: #f5f5f5;
    --container-bg: white;
    --text-color: #333;
    --secondary-text: #7f8c8d;
    --primary-color: #3498db;
    --primary-hover: #2980b9;
    --danger-color: #e74c3c;
    --danger-hover: #c0392b;
    --success-color: #27ae60;
    --border-color: #ddd;
    --box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    --input-bg: white;
    --input-border: #ddd;
}

/* Dark mode overrides */
.dark-mode {
    --bg-color: #1a1a1a;
    --container-bg: #2d2d2d;
    --text-color: #e0e0e0;
    --secondary-text: #a0a0a0;
    --primary-color: #4a90e2;
    --primary-hover: #3a7bc8;
    --danger-color: #e74c3c;
    --danger-hover: #c0392b;
    --success-color: #27ae60;
    --border-color: #444;
    --box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    --input-bg: #3a3a3a;
    --input-border: #555;
}

/* Global page styles */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    margin: 0;
    padding: 20px;
    background-color: var(--bg-color);
    color: var(--text-color);
    transition: background-color 0.3s, color 0.3s;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    background-color: var(--container-bg);
    padding: 20px;
    border-radius: 8px;
    box-shadow: var(--box-shadow);
    transition: background-color 0.3s, box-shadow 0.3s;
}

/* Header */
h1 {
    color: var(--primary-color);
    text-align: center;
    margin-bottom: 30px;
}

/* -------------------------------------------------
   Timer form – input fields and button
   ------------------------------------------------- */
.timer-form {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 30px;
}

/* Ensure consistent sizing for inputs and button */
.timer-form input,
.timer-form button {
    box-sizing: border-box;          /* Include padding & border in width/height */
}

/* Input fields */
.timer-form input {
    flex: 1;
    min-width: 150px;                /* Base minimum width */
    padding: 10px;                   /* Same vertical & horizontal padding */
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 16px;
    background-color: var(--input-bg);
    color: var(--text-color);
    transition: border-color 0.3s, background-color 0.3s, color 0.3s;
}

/* Button – now matches input height */
.timer-form button {
    flex: 1;
    min-width: 150px;                /* Align min‑width with inputs */
    padding: 10px;                   /* Same padding as inputs for equal height */
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s;
}

/* Hover state for button */
.timer-form button:hover {
    background-color: var(--primary-hover);
}

/* Responsive adjustments for mobile */
@media (max-width: 768px) {
    .timer-form {
        flex-direction: column;      /* Stack vertically */
    }

    .timer-form input,
    .timer-form button {
        width: 100%;
        min-width: 100%;
        flex: none;
    }

    /* Ensure button behaves like a block element */
    .timer-form button {
        display: block;
    }
}

/* -------------------------------------------------
   Timer list and items
   ------------------------------------------------- */
.timer-list {
    display: grid;
    gap: 15px;
}

.timer-item {
    background-color: var(--container-bg);
    padding: 15px;
    border-radius: 6px;
    border-left: 4px solid var(--primary-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: transform 0.2s, box-shadow 0.2s, background-color 0.3s, border-color 0.3s;
}

.timer-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.timer-info {
    flex: 1;
}

.timer-name {
    font-weight: bold;
    color: var(--text-color);
    margin-bottom: 5px;
}

.timer-time {
    color: var(--secondary-text);
    font-size: 14px;
}

.timer-actions {
    margin-left: 15px;
}

/* Delete button */
.delete-btn {
    padding: 8px 12px;
    background-color: var(--danger-color);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s;
}

.delete-btn:hover {
    background-color: var(--danger-hover);
}

/* Time left display */
.time-left {
    font-weight: bold;
    color: var(--success-color);
    font-size: 18px;
}

/* -------------------------------------------------
   Pomodoro buttons
   ------------------------------------------------- */
.pomodoro-buttons {
    margin: 15px 0;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.pomodoro-btn {
    padding: 8px 12px;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
    flex: 1;
    min-width: 120px;
    font-weight: bold;
}

/* Specific colors */
.work-btn {
    background-color: #e74c3c;
}
.break-btn {
    background-color: #27ae60;
}
.long-break-btn {
    background-color: #3498db;
}

/* Hover effects */
.pomodoro-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}
.work-btn:hover {
    background-color: #c0392b;
}
.break-btn:hover {
    background-color: #219653;
}
.long-break-btn:hover {
    background-color: #2980b9;
}

/* Miscellaneous UI helpers */
.expired {
    color: #e74c3c;
}

.alarm-indicator {
    display: inline-block;
    width: 12px;
    height: 12px;
    background-color: #e74c3c;
    border-radius: 50%;
    margin-left: 8px;
    animation: pulse 1s infinite;
}

/* Dark‑mode toggle button */
#dark-mode-toggle {
    padding: 5px;
    border-radius: 50%;
    transition: all 0.3s ease;
}
#dark-mode-toggle:hover {
    transform: scale(1.1);
    background-color: rgba(255, 255, 255, 0.1);
}
.dark-mode #dark-mode-toggle:hover {
    background-color: rgba(0, 0, 0, 0.1);
}

/* Loading / empty states */
.loading {
    text-align: center;
    padding: 20px;
    color: var(--secondary-text);
}
.empty-state {
    text-align: center;
    padding: 40px;
    color: var(--secondary-text);
    font-style: italic;
}

/* Pulse animation for alarm indicator */
@keyframes pulse {
    0%   { transform: scale(1);   opacity: 0.7; }
    50%  { transform: scale(1.2); opacity: 1;   }
    100% { transform: scale(1);   opacity: 0.7; }
}
