:root {
    --primary-color: #000;
    --secondary-color: #888;
    --border-color: #e0e0e0;
    --button-color: #f0f0f0;
    --background-color: #f5f5f5;
    --card-background: #fff;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

body {
    background-color: var(--background-color);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
}

.container {
    max-width: 600px;
    width: 100%;
    margin: 0 auto;
}

.timer-card {
    background-color: var(--card-background);
    border-radius: 15px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    padding: 20px;
    margin-bottom: 20px;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 15px;
}

.sequence-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-color);
}

.sequence-mode {
    font-size: 16px;
    color: var(--secondary-color);
    margin-top: 5px;
}

.edit-button {
    background: none;
    border: none;
    font-size: 16px;
    color: var(--primary-color);
    cursor: pointer;
    padding: 5px 10px;
}

.timer-container {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}

.timer-label {
    font-size: 16px;
    color: var(--secondary-color);
    margin-bottom: 10px;
}

.timer-display {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.timer-time {
    display: flex;
    align-items: baseline;
    justify-content: center;
}

.timer-digits {
    font-size: 60px;
    font-weight: bold;
}

.timer-separator {
    font-size: 60px;
    margin: 0 5px;
}

.timer-unit {
    font-size: 16px;
    color: var(--primary-color);
    margin-top: 5px;
}

.timer-buttons-container {
    display: flex;
    flex-direction: column;
    gap: 8px;  /* Space between buttons */
    margin-left: 10px;  /* Optional: adds some space between the time display and buttons */
  }
  
  .timer-reset-button, .timer-button {
    width: 100%;  /* Make buttons fill the container width */
    margin: 4px 0;  /* Add a bit of vertical spacing */
  }

.timer-button, .timer-reset-button {
    background-color: var(--button-color);
    border: none;
    border-radius: 5px;
    padding: 10px 20px;
    font-size: 16px;
    cursor: pointer;
    min-width: 80px;
}

.add-timer-button {
    text-align: center;
    margin-top: 20px;
}

#addNewSequence {
    background: none;
    border: none;
    border-radius: 10px;
    padding: 15px;
    width: 100%;
    font-size: 16px;
    cursor: pointer;
    background-color: var(--button-color);
}

/* Edit Modal Styles */
.edit-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    overflow-y: auto;
    padding: 20px;
}

.edit-modal-content {
    background-color: var(--card-background);
    border-radius: 15px;
    width: 100%;
    max-width: 500px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    animation: modal-appear 0.2s ease-out;
}

@keyframes modal-appear {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

.edit-modal-header {
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    background-color: var(--card-background);
    border-top-left-radius: 15px;
    border-top-right-radius: 15px;
    z-index: 2;
}

.edit-modal-header h2 {
    font-size: 20px;
    font-weight: 600;
    color: var(--primary-color);
    margin: 0;
}

.edit-modal-body {
    padding: 20px;
}

.close-modal {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--secondary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.close-modal:hover {
    background-color: var(--button-color);
}

.form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--primary-color);
}

.form-group input[type="text"] {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.2s;
}

.form-group input[type="text"]:focus {
    border-color: #007bff;
    outline: none;
}

.radio-group {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

.radio-group label {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.radio-group label:hover {
    background-color: var(--button-color);
}

.radio-group input[type="radio"] {
    margin-right: 8px;
    cursor: pointer;
    width: 18px;
    height: 18px;
}

.edit-timer-item {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 16px;
    padding: 16px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background-color: #f9f9f9;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: box-shadow 0.2s;
}

.edit-timer-item:hover {
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.edit-timer-item .timer-label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.timer-label-input {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.2s;
}

.timer-label-input:focus {
    border-color: #007bff;
    outline: none;
}

.timer-input-group {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.timer-input-group input {
    width: 65px;
    padding: 10px;
    text-align: center;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 18px;
    font-weight: 500;
    transition: border-color 0.2s;
}

.timer-input-group input:focus {
    border-color: #007bff;
    outline: none;
}

.timer-input-group span {
    font-size: 24px;
    font-weight: 400;
    color: var(--secondary-color);
}

.timer-input-labels {
    display: flex;
    justify-content: space-around;
    width: 100%;
    margin-top: 4px;
}

.timer-input-label {
    font-size: 12px;
    color: var(--secondary-color);
    text-align: center;
}

.remove-timer-btn {
    background: none;
    border: none;
    color: #dc3545;
    cursor: pointer;
    font-size: 22px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.remove-timer-btn:hover {
    background-color: rgba(220, 53, 69, 0.1);
}

#addTimerBtn {
    background: none;
    border: 2px dashed var(--border-color);
    width: 100%;
    padding: 14px;
    border-radius: 12px;
    margin-bottom: 24px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    color: var(--secondary-color);
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

#addTimerBtn:hover {
    border-color: #007bff;
    color: #007bff;
    background-color: rgba(0, 123, 255, 0.05);
}

#addTimerBtn::before {
    content: "+";
    font-size: 20px;
    font-weight: 600;
}

.modal-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 24px;
    flex-wrap: wrap;
    gap: 16px;
}

.right-actions {
    display: flex;
    gap: 12px;
}

.modal-actions button {
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.2s;
}

#saveChanges {
    background-color: #007bff;
    color: white;
}

#saveChanges:hover {
    background-color: #0069d9;
}

#cancelEdit {
    background-color: var(--button-color);
}

#cancelEdit:hover {
    background-color: #e2e2e2;
}

.delete-btn {
    background-color: #dc3545;
    color: white;
    display: flex;
    align-items: center;
    gap: 6px;
}

.delete-btn::before {
    content: "×";
    font-size: 20px;
}

.delete-btn:hover {
    background-color: #c82333;
}

@media (max-width: 600px) {
    .timer-digits {
        font-size: 40px;
    }
    
    .timer-separator {
        font-size: 40px;
        margin: 0 3px;
    }
    
    .timer-unit {
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .timer-digits {
        font-size: 30px;
    }
    
    .timer-separator {
        font-size: 30px;
        margin: 0 2px;
    }
    
    .timer-unit {
        font-size: 12px;
    }

    .edit-modal {
        align-items: flex-end;
        padding: 0;
    }
    
    .edit-modal-content {
        max-height: 90vh;
        border-bottom-left-radius: 0;
        border-bottom-right-radius: 0;
        width: 100%;
    }
    
    .modal-actions {
        flex-direction: column;
    }
    
    .right-actions {
        width: 100%;
    }
    
    .right-actions button {
        flex: 1;
    }
    
    .delete-btn {
        width: 100%;
        justify-content: center;
    }
    
    .form-group label, .radio-group label {
        font-size: 16px;
    }
}