:root {
    --primary-color: #007bff;
    --secondary-color: #6c757d;
    --background-color: #121212;
    --surface-color: #1e1e1e;
    --text-color: #e0e0e0;
    --danger-color: #dc3545;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    overscroll-behavior: contain;
}

#app-container { padding: 1rem; max-width: 800px; margin: 0 auto; }

/* --- General UI Elements --- */
h1, h2 { color: var(--primary-color); margin-bottom: 1rem; text-align: center; }

.button {
    display: block; width: 100%; padding: 1rem; font-size: 1.2rem; font-weight: bold;
    text-align: center; border-radius: 8px; border: none; cursor: pointer;
    background-color: var(--primary-color); color: white; margin-bottom: 0.5rem;
    -webkit-tap-highlight-color: transparent;
}
.button.secondary { background-color: var(--secondary-color); }
.button.danger { background-color: var(--danger-color); }

.input-group { margin-bottom: 1rem; }
.input-group label { display: block; margin-bottom: 0.5rem; color: var(--text-color); }
.input-group input, .input-group textarea {
    width: 100%; padding: 0.8rem; background-color: var(--surface-color);
    border: 1px solid var(--secondary-color); color: var(--text-color);
    border-radius: 4px; font-size: 1rem;
}

/* --- Home Screen --- */
.workout-list-item {
    background-color: var(--surface-color); padding: 1rem; border-radius: 8px;
    margin-bottom: 1rem; display: flex; justify-content: space-between; align-items: center;
}
.workout-list-item h3 { margin: 0; }

/* REVISED: Home screen buttons are now just Edit and Start */
.workout-actions button {
    border: none; color: var(--text-color); font-weight: bold; cursor: pointer;
    padding: 0.8rem; margin-left: 0.5rem; border-radius: 6px;
    min-width: 60px; font-size: 1rem;
}
.workout-actions button[data-action="edit"] { background-color: var(--secondary-color); }
.workout-actions button[data-action="start"] {
    background-color: var(--primary-color);
    font-size: 1.5rem; /* Make play symbol larger */
    line-height: 1;
    padding: 0.8rem 1.2rem;
}

/* --- Workout Editor --- */
.exercise-card {
    background-color: var(--surface-color); padding: 1rem; border-radius: 8px;
    margin-bottom: 1rem; border-left: 5px solid var(--primary-color);
}
.exercise-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.exercise-header h4 { font-size: 1.2rem; }
.exercise-controls button {
    background: none; border: none; font-size: 1.8rem; color: var(--text-color); cursor: pointer;
    padding: 0.8rem; margin-left: 0.5rem; min-width: 44px; min-height: 44px;
    display: inline-flex; align-items: center; justify-content: center;
}
.exercise-controls button.delete { color: var(--danger-color); }
.exercise-details p { margin: 0.5rem 0; color: #aaa; font-family: inherit; }

/* NEW: Container for action buttons in the editor */
.editor-actions {
    margin-top: 2rem;
    border-top: 1px solid var(--surface-color);
    padding-top: 1.5rem;
}
.editor-actions .button { margin-top: 0.5rem; }

/* --- Workout Runner (No changes) --- */
.runner-view { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: var(--background-color); display: flex; flex-direction: column; justify-content: space-between; align-items: center; text-align: center; padding: 1rem; z-index: 1000; }
.runner-content { position: relative; z-index: 1; width: 100%; max-width: 600px; flex: 1; display: flex; flex-direction: column; justify-content: center; }
.runner-exercise-name { font-size: 2.5rem; font-weight: bold; margin-bottom: 1rem; }
.runner-timer { font-size: 8rem; font-weight: bold; line-height: 1; margin: 2rem 0; font-family: 'monospace'; }
.runner-reps { font-size: 2rem; color: var(--primary-color); margin-bottom: 1rem; }
.runner-description { font-size: 1.2rem; color: #aaa; max-width: 90%; margin: 0 auto 1.5rem; }
.runner-view .button { max-width: 300px; margin: 1rem auto 0; }
.runner-progress { width: 100%; max-width: 400px; display: flex; justify-content: center; gap: 0.5rem; margin: 1rem 0; }
.runner-pip { width: 8px; height: 8px; border-radius: 50%; background-color: var(--secondary-color); }
.runner-pip.active { background-color: var(--primary-color); width: 24px; border-radius: 4px; }
.runner-nav { width: 100%; display: flex; justify-content: space-between; padding: 1rem 0; border-top: 1px solid var(--surface-color); }
.nav-button { width: 60px; height: 60px; display: flex; justify-content: center; align-items: center; padding-bottom: 7px; font-size: 2rem; color: var(--primary-color); background-color: var(--surface-color); border: 2px solid var(--primary-color); border-radius: 50%; cursor: pointer; -webkit-tap-highlight-color: transparent; user-select: none; transition: all 0.2s ease; }
.nav-button:hover, .nav-button:active { background-color: var(--primary-color); color: var(--background-color); transform: scale(1.1); }
.nav-button:disabled { opacity: 0.3; cursor: not-allowed; transform: none; }
.runner-close-button { 
    position: absolute; top: 1rem; right: 1rem; 
    background: var(--danger-color); border: none; 
    color: white; font-size: 1rem; font-weight: bold; 
    padding: 0.8rem 1.5rem; border-radius: 6px; cursor: pointer; z-index: 20; 
}
.timer-controls { display: flex; justify-content: center; gap: 1rem; margin-top: 2rem; }
.timer-controls .button { width: auto; padding: 1rem 2rem; flex-grow: 1; max-width: 200px; }
