body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    font-size: 16px;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    margin: 0;
    background-color: #333;
    color: #fff;
}

.container {
    text-align: center;
    background-color: #444;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
}

h1 {
    margin-top: 0;
    color: #DB524D;
}

.timer-display {
    font-size: 6rem;
    font-weight: bold;
    margin: 1rem 0 2rem;
}

.main-controls button {
    padding: 0.8rem 1.5rem;
    margin: 0 0.5rem;
    border: none;
    border-radius: 5px;
    font-size: 1rem;
    cursor: pointer;
    color: #fff;
    transition: background-color 0.3s ease;
}

#startBtn { background-color: #4CAF50; }
#startBtn:hover { background-color: #45a049; }

#stopBtn { background-color: #f44336; }
#stopBtn:hover { background-color: #da190b; }

#nextBtn { background-color: #2196F3; }
#nextBtn:hover { background-color: #0b7dda; }

/* Toggle Switch for Loop */
.toggle-container {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-bottom: 0.5rem;
    gap: 0.5rem;
    padding-right: 0.5rem;
    font-size: 0.9rem;
}

.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #666;
    transition: .4s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
}

input:checked + .slider {
    background-color: #4CAF50;
}

input:focus + .slider {
    box-shadow: 0 0 1px #4CAF50;
}

input:checked + .slider:before {
    transform: translateX(26px);
}

.slider.round {
    border-radius: 24px;
}

.slider.round:before {
    border-radius: 50%;
}

/* Interval List */
.interval-list-container {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid #555;
    width: 100%;
    max-width: 400px;
}

#interval-list {
    list-style: none;
    padding: 0;
    margin-bottom: 1rem;
}

.interval-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #555;
    padding: 0.75rem 1rem;
    border-radius: 5px;
    margin-bottom: 0.5rem;
    cursor: grab;
    transition: background-color 0.2s ease;
}

.interval-item.active {
    font-weight: bold;
    background-color: #DB524D;
    color: #fff;
}

.interval-item.dragging {
    opacity: 0.5;
}

.interval-item .actions button {
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    font-size: 1.2rem;
    margin-left: 0.5rem;
}

.add-button {
    width: 100%;
    padding: 0.8rem;
    background-color: #607D8B;
    border: none;
    color: white;
    border-radius: 5px;
    font-size: 1rem;
    cursor: pointer;
}
.add-button:hover { background-color: #546E7A; }

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background-color: #444;
    padding: 2rem;
    border-radius: 10px;
    width: 90%;
    max-width: 400px;
}

.form-group {
    margin-bottom: 1.5rem;
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
}

.form-group input[type="text"],
.form-group input[type="number"] {
    width: 100%;
    padding: 0.75rem;
    border-radius: 5px;
    border: 1px solid #666;
    background-color: #555;
    color: #fff;
    font-size: 1rem;
    box-sizing: border-box;
}

.form-group input[type="range"] {
    width: 100%;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

.form-actions button {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 5px;
    font-size: 1rem;
    cursor: pointer;
    color: #fff;
}

#saveBtn { background-color: #4CAF50; }
#cancelBtn { background-color: #f44336; }