/* Ensure Arabic text is displayed correctly */
body {
    font-family: 'Tahoma', 'Arial', sans-serif;
    background-color: #f3f3f3;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding-top: 30px;
    margin: 0;
    direction: rtl;
    text-align: right;
}

.container {
    width: 350px;
    text-align: center;
    padding: 15px;
    box-sizing: border-box;
}

h1, h2 {
    margin-bottom: 15px;
    color: #333;
}

#sections button {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-bottom: 10px;
    padding: 12px;
    font-size: 16px;
    color: #fff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.1s ease;
    box-sizing: border-box;
    text-align: right;
}

.section-manage-btn {
    background-color: rgba(255, 255, 255, 0.3);
    border: none;
    color: white;
    padding: 5px 10px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 14px;
    flex-shrink: 0;
    margin-right: 10px; /* Space between text and button */
}

.section-manage-btn:hover {
    background-color: rgba(255, 255, 255, 0.5);
}

#sections button:active {
    transform: scale(0.98);
}

/* --- Styles for the new buttons --- */
#add-section, #delete-all-data {
    width: 100%;
    padding: 12px;
    font-size: 18px;
    margin-bottom: 10px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    color: white;
    transition: background-color 0.3s ease;
    box-sizing: border-box;
}

#add-section {
    background-color: #4CAF50; /* Green for add */
}

#add-section:hover {
    background-color: #45a049;
}

#delete-all-data {
    background-color: #f44336; /* Red for delete */
}

#delete-all-data:hover {
    background-color: #d32f2f; /* Darker red on hover */
}
/* --- End of new button styles --- */

/* --- Popup/Modal Styles --- */
.popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    border: 2px solid #333;
    padding: 20px;
    z-index: 100;
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
    border-radius: 8px;
    width: 90%;
    max-width: 400px;
    box-sizing: border-box;
    direction: rtl;
    text-align: right;
}

.hidden {
    display: none;
}

.timer-inputs, .prompt-modal-content {
    display: flex;
    flex-direction: column;
    align-items: flex-end; /* Align items to the end (right in RTL) */
    margin-bottom: 15px;
}

.timer-inputs label, .prompt-modal-content label {
    margin-bottom: 5px;
    font-weight: bold;
    align-self: flex-start; /* Align label to the start (left in RTL) */
}

.timer-inputs input, .prompt-modal-content input {
    width: 100%;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    text-align: right;
    font-size: 16px;
    box-sizing: border-box;
}

.popup-buttons {
    margin-bottom: 15px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end; /* Align buttons to the end (right in RTL) */
}

.popup-buttons button {
    padding: 8px 15px;
    font-size: 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    flex: 1 1 auto; /* Allow buttons to grow/shrink but not beyond their content */
    min-width: 100px; /* Minimum width for buttons */
}

/* Specific button styles */
#start-timer {
    background-color: #2196F3;
    color: white;
}

#start-timer:hover:not(:disabled) {
    background-color: #1976D2;
}

#pause-timer {
    background-color: #FF9800;
    color: white;
}

#pause-timer:hover:not(:disabled) {
    background-color: #F57C00;
}

#pause-timer:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

#close-popup, #close-manage-popup,
#confirm-modal-cancel, #prompt-modal-cancel {
    background-color: #f44336;
    color: white;
}

#close-popup:hover, #close-manage-popup:hover,
#confirm-modal-cancel:hover, #prompt-modal-cancel:hover {
    background-color: #d32f2f;
}

#rename-section, #delete-section {
    background-color: #9E9E9E;
    color: white;
}

#rename-section:hover, #delete-section:hover {
    background-color: #757575;
}

#confirm-modal-ok, #prompt-modal-ok {
    background-color: #4CAF50; /* Green for OK/Confirm */
    color: white;
}

#confirm-modal-ok:hover, #prompt-modal-ok:hover {
    background-color: #45a049;
}

#countdown {
    margin-top: 10px;
    font-weight: bold;
    font-size: 24px;
    color: #333;
    text-align: center;
}

#daily-log {
    margin-top: 10px;
    text-align: right;
    background-color: #fff;
    padding: 10px;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    min-height: 50px;
}

#daily-log ul {
    padding-right: 20px;
    margin: 0;
}

#daily-log li {
    margin-bottom: 5px;
}

/* Notification styling */
.notification {
    margin-top: 10px;
    padding: 10px;
    border-radius: 5px;
    font-weight: bold;
    text-align: center;
}

.notification.success {
    background-color: #dff0d8;
    color: #3c763d;
    border: 1px solid #d6e9c6;
}

.notification.error {
    background-color: #f2dede;
    color: #a94442;
    border: 1px solid #ebccd1;
}

/* Focus styles for accessibility */
button:focus, input:focus {
    outline: 2px solid #2196F3;
    outline-offset: 2px;
}