/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: Arial, sans-serif;
}

body {
    display: flex;
    flex-direction: column; /* Stack header and main */
    align-items: center; /* Center content horizontally */
    min-height: 100vh;
    background-color: #f5f5f5;
    /* Removed padding: 20px 0; - will apply to main */
    overflow-x: hidden; /* Keep this */
}

/* Header Styles */
header {
    width: 100%;
    /* background-color: #333; */ /* Replaced with gradient */
    background: linear-gradient(to right, #4a4a4a, #333); /* Subtle gradient */
    color: white;
    padding: 15px 0; /* Increased padding */
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.25); /* Enhanced shadow */
    position: sticky; /* Make header sticky */
    top: 0;
    z-index: 1001; /* Ensure header is above modal */
}

.header-container {
    width: 90%;
    max-width: 1200px; /* Max width for boxed layout */
    margin: 0 auto; /* Center the container */
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 2rem; /* Slightly larger logo */
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.4); /* Add subtle text shadow */
}

nav ul {
    list-style: none;
    display: flex;
    gap: 20px;
}

nav ul li {
    position: relative; /* For dropdown positioning */
}

nav ul li a {
    color: #f0f0f0; /* Slightly lighter text */
    text-decoration: none;
    padding: 12px 18px; /* Increased padding */
    display: block;
    transition: background-color 0.3s, color 0.3s; /* Added color transition */
    border-radius: 5px; /* Slightly more rounded */
}

nav ul li a:hover,
nav ul li .dropbtn:hover {
    background-color: rgba(255, 255, 255, 0.1); /* Subtle hover background */
    color: #ffffff; /* Brighter text on hover */
    /* border-radius: 4px; */ /* Removed, using parent radius */
}

/* Dropdown Styles */
.dropdown .dropbtn {
    cursor: pointer;
    background: none; /* Ensure dropbtn itself has no background */
    border: none; /* Ensure dropbtn itself has no border */
    color: inherit; /* Inherit color */
    font: inherit; /* Inherit font */
    padding: 12px 18px; /* Match link padding */
}

.dropdown-content {
    display: none;
    position: absolute;
    background-color: #444; /* Darker dropdown background */
    min-width: 180px; /* Wider dropdown */
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.3); /* Stronger shadow */
    z-index: 1;
    border-radius: 5px; /* Match link radius */
    overflow: hidden; /* Ensure rounded corners apply */
    top: 100%; /* Position below the button */
    left: 0;
    padding: 5px 0; /* Add some vertical padding inside */
}

.dropdown-content a {
    color: #f0f0f0; /* Lighter text */
    padding: 10px 20px; /* Adjust padding */
    text-decoration: none;
    display: block;
    transition: background-color 0.2s; /* Faster transition */
}

.dropdown-content a:hover {
    background-color: #555; /* Hover effect */
    color: #ffffff; /* Ensure text color remains light on hover */
}

.dropdown:hover .dropdown-content {
    display: block;
}

/* Main Content Area (Boxed Layout) */
main.main-content {
    width: 90%;
    max-width: 1200px; /* Match header container width */
    margin: 20px auto; /* Add space below header and center */
    padding: 20px; /* Add padding inside the main content */
    background-color: #f5f5f5; /* Match body background or could be white */
    display: flex; /* Use flexbox for centering children */
    flex-direction: column;
    align-items: center; /* Center clock containers */
}

/* Clock container (Copied from inline styles) */
.clock-container {
    text-align: center;
    background-color: white;
    padding: 40px; /* Restore original padding */
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    width: 90%;
    max-width: 500px; /* Restore original max-width */
    margin-bottom: 20px; /* Add space below clock container */
    /* position: relative; /* Keep if needed */
}

/* Upcoming Times Section (Copied from inline styles) */
.upcoming-times-section {
    text-align: center;
    background-color: white;
    padding: 30px 40px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    width: 90%;
    max-width: 650px; /* Updated to match alarm-page-container width */
    margin-bottom: 20px; /* Add space below */
}

.upcoming-times-section h3 {
    margin-bottom: 20px;
    color: #555;
    font-weight: normal;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

/* Containers for dynamic alarm buttons */
#dynamicAlarmButtonsGrid24,
#dynamicAlarmButtonsGrid6,
#dynamicAlarmButtonsOverflow {
    margin: 15px auto 0 auto; /* Center containers, add top margin */
    gap: 10px; /* Consistent gap */
    max-width: fit-content; /* Allow container to shrink-wrap content for centering */
}

#dynamicAlarmButtonsGrid24 {
    display: grid;
    grid-template-columns: repeat(6, 1fr); /* 6 equal columns */
    justify-items: stretch; /* Stretch items to fill cell width */
    width: 100%; /* Make grid take full width of parent */
    max-width: 600px; /* Optional: constrain max width */
}

#dynamicAlarmButtonsGrid6 {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* 3 equal columns */
    justify-items: stretch; /* Stretch items to fill cell width */
    width: 100%; /* Make grid take full width of parent */
    max-width: 300px; /* Optional: constrain max width */
}

#dynamicAlarmButtonsOverflow {
    display: flex;
    justify-content: center; /* Center items in the flex container */
    flex-wrap: wrap;
    /* max-width is already set above, remove explicit width if needed */
}


/* Clock & Date (Copied from inline/existing styles) */
.clock {
    font-size: 4.5rem;
    font-weight: 500;
    color: #444;
    margin-bottom: 10px;
    font-family: 'DS-Digital', sans-serif;
    letter-spacing: 5px;
}

.date {
    font-size: 1.2rem;
    color: #666;
    margin-bottom: 30px;
    letter-spacing: 1px;
    text-transform: uppercase;
    font-family: 'DS-Digital', sans-serif;
}

/* Buttons (Copied from inline/existing styles) */
.set-alarm-btn {
    background-color: #4CAF50;
    color: white;
    border: none;
    padding: 12px 24px;
    font-size: 1rem;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
    margin-top: 20px;
}

.set-alarm-btn:hover {
    background-color: #45a049;
}

.stop-alarm-btn { /* Style might be reused for delete buttons later */
    background-color: #f44336;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
}

/* Active alarm display (Copied from inline styles) */
.active-alarm {
    margin-top: 20px;
    padding: 15px;
    background-color: #f9f9f9;
    border-radius: 8px;
    border: 1px solid #ddd;
    text-align: left;
    display: none; /* Hidden by default */
}

.active-alarm-title {
    font-weight: bold;
    margin-bottom: 5px;
}

.active-alarm-time {
    color: #666;
    margin-bottom: 10px;
}

.countdown-timer { /* Added styles */
    color: #4CAF50;
    font-family: 'DS-Digital', sans-serif;
    font-weight: bold;
    font-size: 2.1em;
    margin-top: 5px;
    display: flex;
    margin-bottom: 12px;
    
}

/* Quick Alarm Styles (Copied from inline styles) */
.quick-alarm-container {
    margin-top: 15px;
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap; /* Allow wrapping on smaller screens */
}

.quick-alarm-btn {
    background-color: #2196F3; /* Blue color */
    color: white;
    border: none;
    padding: 8px 15px;
    font-size: 0.9rem;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.1s;
}

.quick-alarm-btn:hover {
    background-color: #1976D2; /* Darker blue on hover */
}

.quick-alarm-btn:active {
    transform: scale(0.95); /* Slight shrink on click */
}

/* Dynamic Alarm Button Styles (Copied from inline styles) */
.dynamic-alarm-btn {
    background-color: #607D8B; /* Blue Grey */
    color: white;
    border: none;
    padding: 8px 15px;
    font-size: 0.9rem;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.1s;
    text-decoration: none; /* Added for links */
    width: 100%; /* Make button fill its container/grid cell */
    height: 36px; /* Set a fixed height */
    display: inline-flex; /* Use flex for centering */
    align-items: center; /* Center text vertically */
    justify-content: center; /* Center text horizontally */
    box-sizing: border-box; /* Include padding in width/height calculation */
    padding: 0 5px; /* Adjust padding for fixed height */
}

.dynamic-alarm-btn:hover {
    background-color: #455A64; /* Darker Blue Grey */
}

.dynamic-alarm-btn:active {
    transform: scale(0.95);
}

/* Alarm List Styles */
#alarmList {
    width: 100%; /* Ensure the container takes full width within its parent */
    margin-top: 20px;
    text-align: left;
}

.alarm-list-item {
    display: flex; /* Use flexbox to arrange details and actions */
    justify-content: space-between; /* Push details and actions apart */
    align-items: center; /* Vertically align items */
    padding: 15px; /* Increased padding */
    border: 1px solid #e0e0e0; /* Lighter border */
    background-color: #fff; /* White background for each item */
    margin-bottom: 10px;
    border-radius: 6px; /* Slightly rounded corners */
    box-shadow: 0 2px 4px rgba(0,0,0,0.05); /* Subtle shadow */
}

.alarm-details {
    display: flex; /* Use flex for internal alignment */
    flex-direction: column; /* Stack time/title and countdown */
    gap: 4px; /* Space between lines */
}

.alarm-time {
    font-weight: bold;
    font-size: 1.5em;
    color: #333;
    font-family: 'DS-Digital', sans-serif;
}

.alarm-title {
    color: #555;
    margin-left: 0; /* Remove margin if details are stacked */
    font-size: 0.95em;
}

/* Inherits .countdown-timer styles defined elsewhere */

.alarm-actions {
    /* Container for buttons */
}

.delete-alarm-btn {
    background-color: #f44336; /* Red */
    color: white;
    border: none;
    padding: 6px 12px; /* Adjusted padding */
    font-size: 0.9em;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.delete-alarm-btn:hover {
    background-color: #d32f2f; /* Darker red */
}


/* Modal Styles (Consolidated and Centered) */
.modal {
    display: none; /* Hidden by default */
    position: fixed; /* Stay in place */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000; /* Ensure it's below sticky header if needed, but above content */
    /* display: flex; /* JS will set this to 'flex' when opening */
    align-items: center; /* Vertical center */
    justify-content: center; /* Horizontal center */
    overflow: auto; /* Add scroll for modal content if needed */
}

.modal-content {
    background-color: white;
    width: 90%;
    max-width: 700px; /* Consolidated from timer.html */
    border-radius: 8px; /* Adjusted from timer.html (was 6px) - keeping 8px */
    overflow: hidden; /* Keep this */
    box-shadow: 0 5px 15px rgba(0,0,0,0.15); /* Consolidated from timer.html */
    display: flex; /* Use flexbox for internal layout */
    flex-direction: column; /* Stack header, body, footer */
    margin: auto; /* Center within the flex container */
    /* Ensure max-height prevents overflow on short screens */
    max-height: 90vh;
}

.modal-header {
    background-color: #2196F3;
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    font-size: 1.3rem;
    font-weight: normal;
    margin: 0;
}

.close-btn {
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    background: none;
    border: none;
}

.modal-body {
    padding: 20px;
}

/* Styles for Timer Modal Form Groups */
#setTimerModal .form-group {
    margin-bottom: 20px; /* Consistent spacing */
}
#setTimerModal .form-group:last-child {
    margin-bottom: 0;
}
#setTimerModal .form-group label {
    display: block;
    margin-bottom: 6px; /* Space below label */
    font-weight: normal; /* Standard weight */
    color: #495057;
}
#setTimerModal .form-group input[type="radio"],
#setTimerModal .form-group input[type="checkbox"] {
    margin-right: 5px;
    vertical-align: middle; /* Align better with text */
}
#setTimerModal .form-group label { /* Target labels containing radios/checkboxes */
    display: inline-flex; /* Keep label and input together */
    align-items: center;
    margin-right: 15px; /* Space between options */
    font-weight: normal; /* Ensure these labels aren't bold */
}
#setTimerModal .form-group label:last-child {
    margin-right: 0;
}

/* Style for 'On zero' section in modal */
.on-zero-label {
    display: block; /* Ensures it takes its own line */
    text-align: left; /* Left align the label */
    margin-bottom: 8px; /* Keep default label spacing */
    /* Inherits other label styles from .form-group label */
    font-weight: bold; /* Make the main label bold if desired */
    color: #495057;
}

.on-zero-options {
    display: flex; /* Arrange radio buttons horizontally */
    gap: 20px; /* Space between radio buttons */
    align-items: center; /* Align items vertically */
    /* Remove margin-top if .form-group provides enough spacing */
}

.on-zero-options label {
    display: inline-flex; /* Align radio button and text nicely */
    align-items: center;
    margin-bottom: 0; /* Remove bottom margin from individual radio labels */
    font-weight: normal; /* Ensure radio labels are normal weight */
    /* Inherit font styles */
    /* Make label itself not block */
    display: inline-flex; /* Override default block from .form-group label */
}


.time-selector {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.time-selector-group {
    flex: 1;
}

.time-selector-label {
    display: block;
    margin-bottom: 8px;
    color: #333;
}

.time-selector-container {
    display: flex;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
}

.time-selector-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    background-color: #f1f1f1;
    cursor: pointer;
    user-select: none;
}

.time-selector-value {
    flex: 1;
    text-align: center;
    padding: 10px;
    border: none;
    outline: none;
    background-color: white;
    appearance: none;
    -webkit-appearance: none;
}

.sound-selector {
    margin-bottom: 20px;
}

.sound-selector-container {
    display: flex;
    margin-top: 8px;
}

.sound-dropdown {
    flex: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px 0 0 4px;
    outline: none;
    appearance: none;
    -webkit-appearance: none;
    background-image: url('data:image/svg+xml;utf8,<svg fill="gray" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><path d="M7 10l5 5 5-5z"/></svg>'); /* Keep dropdown arrow */
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 20px;
}

.play-btn, .pause-btn, .options-btn {
    width: 40px;
    height: 40px; /* Ensure consistent height */
    background-color: #f1f1f1;
    border: 1px solid #ddd;
    border-left: none;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.1s;
    display: flex; /* Center icons */
    align-items: center;
    justify-content: center;
    padding: 0; /* Remove default padding */
}

.play-btn:hover, .pause-btn:hover, .options-btn:hover {
    background-color: #e0e0e0;
}

.play-btn:active, .pause-btn:active, .options-btn:active {
    transform: scale(0.95);
}

.options-btn {
    border-radius: 0 4px 4px 0; /* Keep this */
}

.pause-btn {
    display: none; /* Keep hidden by default */
    border-radius: 0; /* No border radius */
}

.repeat-sound {
    margin-top: 10px;
    display: flex;
    align-items: center;
}

.repeat-sound input[type="checkbox"] {
    margin-right: 8px; /* Space between checkbox and label */
}

.title-input {
    margin-bottom: 20px;
}

.title-input input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    outline: none;
}

.modal-footer {
    display: flex;
    justify-content: space-between; /* Changed to space-between */
    padding: 15px 20px;
    border-top: 1px solid #ddd;
    background-color: #ffffff00; /* Added background */
    border-bottom-left-radius: 8px; /* Added radius */
    border-bottom-right-radius: 8px; /* Added radius */
}

.modal-footer .left-buttons { /* Container for left-aligned buttons */
    display: flex;
    gap: 10px;
}

.modal-footer .right-buttons { /* Container for right-aligned buttons */
     display: flex;
     gap: 10px;
}


.modal-footer button { /* General modal footer button style */
    padding: 8px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.95rem; /* Slightly smaller font */
    border: 1px solid #ccc; /* Default border */
    background-color: #f8f9fa; /* Default background */
    color: #333; /* Default text color */
    transition: background-color 0.2s, border-color 0.2s;
}
.modal-footer button:hover {
    background-color: #e9ecef;
    border-color: #bbb;
}

.modal-footer .btn-start { /* Specific style for Start button */
    background-color: #5cb85c;
    border-color: #5cb85c;
    color: white;
}
.modal-footer .btn-start:hover {
    background-color: #4cae4c;
    border-color: #4cae4c;
}

/* Remove old individual button styles if they conflict */
/* .test-btn, .cancel-btn, .start-btn { ... } */


/* Alarm Notification (Copied from inline/existing styles) */
.alarm-notification {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 2000; /* Higher than header */
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

.alarm-notification h2 {
    color: white;
    font-size: 2.5rem;
    margin-bottom: 20px;
}

.stop-notification-btn {
    background-color: #f44336;
    color: white;
    border: none;
    padding: 15px 30px;
    font-size: 1.2rem;
    border-radius: 4px;
    cursor: pointer;
}

/* New Alarm Popup Styles */
.alarm-popup-overlay {
    display: none; /* Hidden by default */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6); /* Semi-transparent black overlay */
    z-index: 2000; /* Ensure it's above everything else */
    justify-content: center;
    align-items: center;
}

.alarm-popup-modal {
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    width: 90%;
    max-width: 400px; /* Increased width */
    overflow: hidden; /* Clip content to rounded corners */
    display: flex;
    flex-direction: column;
}

.alarm-popup-header {
    background-color: #f06a5a; /* Lighter red */
    color: white;
    padding: 12px 15px;
    font-size: 1.1rem;
    font-weight: bold;
    display: flex;
    justify-content: space-between; /* For potential close button */
    align-items: center;
}

/* Optional close button style if added later
.alarm-popup-close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
} */

.alarm-popup-body {
    padding: 25px 20px;
    text-align: center;
}

.alarm-popup-icon {
    margin-bottom: 15px;
}

.alarm-popup-icon svg {
    width: 52px; /* Match SVG size */
    height: 52px; /* Match SVG size */
    stroke: #f06a5a; /* Lighter red */
    stroke-width: 1.5;
}

.alarm-popup-title {
    font-size: 1.3rem;
    color: #333;
    margin-bottom: 8px;
    font-weight: 500;
}

.alarm-popup-time {
    font-size: 1.1rem;
    color: #666;
    margin-bottom: 20px;
}

.alarm-popup-footer {
    padding: 15px 20px;
    background-color: #f9f9f9; /* Light grey footer background */
    text-align: center;
    border-top: 1px solid #eee;
}

.alarm-popup-ok-btn {
    background-color: #f06a5a; /* Lighter red */
    color: white;
    border: none;
    padding: 10px 25px;
   
    font-size: 1rem;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.alarm-popup-ok-btn:hover {
    background-color: #e85a4a; /* Slightly darker version of the lighter red */
}
/* End New Alarm Popup Styles */


/* Media Queries (Keep existing) */
@media (max-width: 480px) {
    .clock {
        font-size: 3rem;
        font-family: 'DS-Digital', sans-serif;
    }

    .date {
        font-size: 1rem;
    }

    .header-container {
        flex-direction: column;
        gap: 10px;
    }

    nav ul {
        justify-content: center;
        flex-wrap: wrap; /* Allow wrapping on small screens */
    }
}

/* ======================================== */
/* Styles for Alarm Page Template           */
/* (Keep existing - these are separate)     */
/* ======================================== */

/* General Enhancements for Alarm Page */
.alarm-page-body { /* Assuming we add this class to body in the template */
    background-color: #eef1f5; /* Slightly cooler light background */
}
.alarm-page-container { /* Specific container for alarm pages */
    max-width: 650px; /* Slightly wider */
    margin: 30px auto;
    padding: 30px;
    background-color: #ffffff;
    border-radius: 12px; /* More rounded */
    box-shadow: 0 4px 12px rgba(0,0,0,0.08); /* Slightly deeper shadow */
}

/* Styles specific to the alarm template */
.alarm-page-title {
    font-size: 2.4rem; /* Larger title */
    margin-bottom: 25px;
    color: #34495e; /* Darker slate blue */
    font-weight: 600; /* Slightly less bold than 'bold' */
    text-align: center;
 }

/* Enhanced Alarm Display */
#specificAlarmDisplay {
    margin-top: 35px;
    padding: 18px 25px;
    background-color: #eaf6ff; /* Lighter, softer blue */
    border: 1px solid #cce4ff; /* Softer border */
    border-radius: 8px;
    text-align: center;
    font-size: 1.15rem; /* Slightly larger */
    color: #2c3e50; /* Darker text */
    font-weight: 500;
}
#specificAlarmDisplay p { /* Style the paragraph inside */
    margin: 0;
}
#specificAlarmDisplay strong { /* Style the bold time */
    color: #0056b3; /* Match button hover color */
    font-family: 'DS-Digital', sans-serif;

}

/* Enhanced Specific Action Buttons Section */
.specific-alarm-actions {
    margin-top: 35px;
    padding-top: 30px;
    border-top: 1px solid #e7eaf0; /* Lighter separator */
    text-align: center;
}
/* Styles for the buttons themselves */
.set-specific-alarm-buttons {
     margin-top: 0;
     margin-bottom: 0;
     display: inline-flex;
     justify-content: center;
     gap: 25px; /* Increased gap */
}
.set-specific-alarm-buttons .set-alarm-btn { /* Target buttons inside this container */
     padding: 14px 32px; /* Larger padding */
     font-size: 1.1rem; /* Larger font */
     border-radius: 8px; /* More rounded */
     cursor: pointer;
     transition: all 0.3s ease;
     color: white;
     border: none;
     box-shadow: 0 3px 6px rgba(0,0,0,0.1); /* Refined shadow */
     font-weight: 500;
     text-transform: uppercase; /* Uppercase text */
     letter-spacing: 0.5px;
}
#quickSetSpecificBtn { background: linear-gradient(145deg, #007bff, #0056b3); } /* Gradient blue */
#editSetSpecificBtn { background: linear-gradient(145deg, #fd7e14, #e06200); } /* Gradient orange */

#quickSetSpecificBtn:hover { background: linear-gradient(145deg, #0069d9, #004085); transform: translateY(-2px); box-shadow: 0 5px 8px rgba(0,0,0,0.18); }
#editSetSpecificBtn:hover { background: linear-gradient(145deg, #e06200, #c65000); transform: translateY(-2px); box-shadow: 0 5px 8px rgba(0,0,0,0.18); }


/* Enhanced Quick Set Button Styles */
.quick-set-container {
    margin-top: 40px; /* More space */
    padding: 25px;
    border: 1px solid #e7eaf0; /* Match separator */
    border-radius: 8px; /* Match other elements */
    background-color: #f8f9fa; /* Slightly off-white */
    text-align: center;
}
.quick-set-container h4 {
    margin-bottom: 18px;
    color: #495057;
    font-size: 1.2rem; /* Larger heading */
    font-weight: 600;
 }
.button-group {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px 15px; /* Row and column gap */
    margin-bottom: 30px; /* More space between groups */
}
.button-group:last-child { margin-bottom: 0; }

.button-group a.quick-set-btn {
    padding: 10px 18px; /* Larger buttons */
    font-size: 1rem; /* Standard font size */
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.2s, box-shadow 0.3s;
    background-color: #6c757d; /* Bootstrap secondary */
    color: white;
    border: none;
    text-decoration: none;
    display: inline-block; /* Flex items behave like block, but this doesn't hurt */
    box-shadow: 0 2px 4px rgba(0,0,0,0.08);
    min-width: 80px; /* Add minimum width for better visual alignment */
    text-align: center; /* Ensure text inside button is centered */
}
.button-group a.quick-set-btn:hover {
    background-color: #5a6268;
    transform: translateY(-2px); /* More lift */
    box-shadow: 0 4px 6px rgba(0,0,0,0.12);
}

/* Night Mode Toggle Button */
#night-mode-toggle {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem; /* Adjust size as needed */
    cursor: pointer;
    padding: 5px;
    margin-left: 15px; /* Space from nav */
    transition: transform 0.2s ease;
}

#night-mode-toggle:hover {
    transform: scale(1.1);
}

/* Dark Mode Styles */
body.dark-mode {
    background-color: #1a1a1a; /* Dark background */
    color: #e0e0e0; /* Light text */
}

body.dark-mode header {
    background: linear-gradient(to right, #2c2c2c, #1f1f1f); /* Darker gradient */
    box-shadow: 0 3px 8px rgba(255, 255, 255, 0.1); /* Lighter shadow */
}

body.dark-mode .logo a,
body.dark-mode nav ul li a {
    color: #e0e0e0; /* Lighter text for links */
}

body.dark-mode nav ul li a:hover,
body.dark-mode nav ul li .dropbtn:hover {
    background-color: rgba(255, 255, 255, 0.15); /* Slightly brighter hover */
    color: #ffffff;
}

body.dark-mode .dropdown-content {
    background-color: #333; /* Darker dropdown */
    box-shadow: 0px 8px 16px 0px rgba(255,255,255,0.15); /* Lighter shadow */
}

body.dark-mode .dropdown-content a {
    color: #e0e0e0;
}

body.dark-mode .dropdown-content a:hover {
    background-color: #444;
    color: #ffffff;
}

body.dark-mode main.main-content {
    background-color: #1a1a1a; /* Match body background */
}

body.dark-mode .clock-container,
body.dark-mode .upcoming-times-section,
body.dark-mode .alarm-page-container {
    background-color: #2b2b2b; /* Dark container background */
    box-shadow: 0 4px 15px rgba(255, 255, 255, 0.08); /* Lighter shadow */
    border: 1px solid #444; /* Subtle border */
}

body.dark-mode .clock {
    color: #f0f0f0; /* Lighter clock text */
}

body.dark-mode .date {
    color: #b0b0b0; /* Lighter date text */
}

body.dark-mode .upcoming-times-section h3 {
    color: #c0c0c0;
    border-bottom: 1px solid #444;
}

body.dark-mode .set-alarm-btn {
    background-color: #3a9d40; /* Slightly adjusted green */
}
body.dark-mode .set-alarm-btn:hover {
    background-color: #318336;
}

body.dark-mode .stop-alarm-btn {
    background-color: #d32f2f; /* Slightly adjusted red */
}

body.dark-mode .quick-alarm-btn {
    background-color: #1976D2; /* Slightly adjusted blue */
}
body.dark-mode .quick-alarm-btn:hover {
    background-color: #115293;
}

body.dark-mode .dynamic-alarm-btn {
    background-color: #455A64; /* Slightly adjusted grey */
}
body.dark-mode .dynamic-alarm-btn:hover {
    background-color: #37474F;
}

/* Dark Mode Alarm List */
body.dark-mode #alarmList {
    /* No specific changes needed unless container background differs */
}

body.dark-mode .alarm-list-item {
    background-color: #2f2f2f; /* Darker item background */
    border: 1px solid #444;
    box-shadow: 0 2px 4px rgba(255,255,255,0.05); /* Lighter shadow */
}

body.dark-mode .alarm-time {
    color: #e0e0e0; /* Lighter text */
}

body.dark-mode .alarm-title {
    color: #b0b0b0; /* Lighter grey */
}

body.dark-mode .delete-alarm-btn {
    background-color: #d32f2f; /* Slightly adjusted red */
}

body.dark-mode .delete-alarm-btn:hover {
    background-color: #b71c1c; /* Darker red */
}


body.dark-mode .active-alarm {
    background-color: #333;
    border: 1px solid #555;
}

body.dark-mode .active-alarm-title {
    color: #e0e0e0;
}

body.dark-mode .active-alarm-time {
    color: #b0b0b0;
}

body.dark-mode .countdown-timer {
    color: #66bb6a; /* Lighter green */
}

/* Dark Mode Modal */
body.dark-mode .modal-content {
    background-color: #333;
    /* Ensure dark mode modal content also uses flex */
    display: flex;
    flex-direction: column;
    margin: auto; /* Center in dark mode too */
    max-height: 90vh; /* Apply max-height in dark mode */
}

body.dark-mode .modal-header {
    background-color: #1976D2; /* Keep blue or adjust */
}

body.dark-mode .modal-header h2,
body.dark-mode .close-btn {
    color: #e0e0e0;
}

body.dark-mode .modal-body {
    color: #e0e0e0;
}

body.dark-mode .time-selector-label {
    color: #c0c0c0;
}

body.dark-mode .time-selector-container {
    border: 1px solid #555;
}

body.dark-mode .time-selector-arrow {
    background-color: #444;
    color: #e0e0e0;
}

body.dark-mode .time-selector-value {
    background-color: #2b2b2b;
    color: #e0e0e0;
    border: none;
}

body.dark-mode .sound-dropdown {
    background-color: #2b2b2b;
    color: #e0e0e0;
    border: 1px solid #555;
    /* Keep SVG arrow, might need adjustment if default is dark */
}

body.dark-mode .play-btn,
body.dark-mode .pause-btn,
body.dark-mode .options-btn {
    background-color: #444;
    border: 1px solid #555;
    border-left: none;
    color: #e0e0e0; /* Ensure icons are visible */
}
body.dark-mode .play-btn:hover,
body.dark-mode .pause-btn:hover,
body.dark-mode .options-btn:hover {
    background-color: #555;
}

body.dark-mode .repeat-sound {
    color: #c0c0c0;
}

body.dark-mode .title-input input {
    background-color: #2b2b2b;
    color: #e0e0e0;
    border: 1px solid #555;
}

body.dark-mode .modal-footer {
    border-top: 1px solid #555;
}

body.dark-mode .test-btn,
body.dark-mode .cancel-btn {
    background-color: #444;
    border: 1px solid #555;
    color: #e0e0e0;
}

body.dark-mode .start-btn {
    background-color: #3a9d40; /* Match other green button */
}

/* Dark Mode Alarm Page Template */
body.dark-mode .alarm-page-body {
    background-color: #1a1a1a;
}

body.dark-mode .alarm-page-title {
    color: #c1d5e8; /* Lighter slate blue */
}

body.dark-mode #specificAlarmDisplay {
    background-color: #00000040; /* Darker blue background */
    border: 1px solid #405a74; /* Darker border */
    color: #e0e0e0; /* Light text */
}
body.dark-mode #specificAlarmDisplay strong {
    color: #66b3ff; /* Lighter blue for time */
}

body.dark-mode .specific-alarm-actions {
    border-top: 1px solid #444; /* Darker separator */
}

/* Keep gradient buttons or adjust for dark mode */
/* Option: Use slightly brighter gradients or solid colors */
body.dark-mode #quickSetSpecificBtn { background: linear-gradient(145deg, #0069d9, #004085); }
body.dark-mode #editSetSpecificBtn { background: linear-gradient(145deg, #e06200, #c65000); }

body.dark-mode #quickSetSpecificBtn:hover { background: linear-gradient(145deg, #0056b3, #003366); }
body.dark-mode #editSetSpecificBtn:hover { background: linear-gradient(145deg, #c65000, #a04000); }


body.dark-mode .quick-set-container {
    background-color: #2b2b2b; /* Match other containers */
    border: 1px solid #444;
}
body.dark-mode .quick-set-container h4 {
    color: #b0b0b0;
}
body.dark-mode .button-group a.quick-set-btn {
    background-color: #5a6268; /* Darker grey */
    color: #e0e0e0;
    box-shadow: 0 2px 4px rgba(255,255,255,0.08);
}
body.dark-mode .button-group a.quick-set-btn:hover {
    background-color: #495057;
    box-shadow: 0 4px 6px rgba(255,255,255,0.12);
}

/* ======================================== */
/* Styles for Timer Completion Popup        */
/* ======================================== */

#timerCompleteModal .modal-content {
    max-width: 450px; /* Adjust width as needed */
    /* Inherits general modal styles like background, border-radius, shadow */
}

#timerCompleteModal .timer-complete-header {
    background-color: #f06a5a; /* Coral/reddish color from image */
    color: white;
    padding: 12px 20px; /* Adjust padding */
    border-top-left-radius: 8px; /* Match modal content radius */
    border-top-right-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#timerCompleteModal .timer-complete-header h2 {
    font-size: 1.2rem; /* Adjust font size */
    font-weight: 500; /* Adjust weight */
    margin: 0;
}

#timerCompleteModal .timer-complete-header .close-button {
    color: white;
    font-size: 24px; /* Adjust size */
    font-weight: bold;
    cursor: pointer;
    opacity: 0.8;
    transition: opacity 0.2s;
}
#timerCompleteModal .timer-complete-header .close-button:hover {
    opacity: 1;
}


#timerCompleteModal .timer-complete-body {
    padding: 30px 20px; /* Adjust padding */
    text-align: center;
    background-color: #fff; /* Ensure white background */
    color: #333; /* Default text color for body */
}

#timerCompleteModal .timer-complete-icon {
    margin-bottom: 20px; /* Space below icon */
    display: inline-block; /* Allows centering */
    padding: 10px; /* Padding around the icon */
    border: 2px solid #f06a5a; /* Border matching header color */
    border-radius: 50%; /* Make it circular */
    line-height: 0; /* Prevent extra space */
}

#timerCompleteModal .timer-complete-icon svg {
    width: 48px; /* Adjust icon size */
    height: 48px;
    fill: #f06a5a; /* Icon color */
    vertical-align: middle; /* Align SVG properly */
}

#timerCompleteModal .timer-complete-time {
    font-family: 'Orbitron', sans-serif; /* Use digital font if available */
    font-size: 2rem; /* Adjust font size */
    color: #555; /* Dark grey color */
    margin-bottom: 10px; /* Space below time */
    letter-spacing: 2px;
}

/* Style for the title in the completion popup */
#timerCompleteModal .timer-complete-title {
    font-size: 1.1rem; /* Adjust as needed */
    color: #444; /* Adjust as needed */
    margin-bottom: 8px; /* Space below title */
    font-weight: bold;
}


#timerCompleteModal .timer-complete-footer {
    padding: 15px 20px;
    background-color: #f8f9fa; /* Light grey background */
    border-top: 1px solid #eee; /* Separator line */
    border-bottom-left-radius: 8px; /* Match modal content radius */
    border-bottom-right-radius: 8px;
    text-align: right; /* Align buttons to the right */
}

#timerCompleteModal .timer-complete-footer button {
    padding: 10px 25px; /* Button padding */
    font-size: 1rem;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    margin-left: 10px; /* Space between buttons */
    color: white;
    transition: background-color 0.3s ease;
}

#timerCompleteModal .timer-complete-footer .btn-restart {
    background-color: #5cb85c; /* Green */
}
#timerCompleteModal .timer-complete-footer .btn-restart:hover {
    background-color: #4cae4c; /* Darker green */
}

#timerCompleteModal .timer-complete-footer .btn-ok {
    background-color: #f06a5a; /* Coral/reddish */
}
#timerCompleteModal .timer-complete-footer .btn-ok:hover {
    background-color: #e85a4a; /* Darker coral/reddish */
}

/* Dark Mode Adjustments for Timer Completion Popup */
body.dark-mode #timerCompleteModal .modal-content {
    background-color: #333; /* Dark background for modal */
    border: 1px solid #555;
}

body.dark-mode #timerCompleteModal .timer-complete-header {
    background-color: #d35444; /* Adjusted red for dark mode */
    color: #e0e0e0;
}
body.dark-mode #timerCompleteModal .timer-complete-header .close-button {
    color: #e0e0e0;
}

body.dark-mode #timerCompleteModal .timer-complete-body {
    background-color: #333; /* Match modal content background */
    color: #e0e0e0; /* Light text */
}

body.dark-mode #timerCompleteModal .timer-complete-icon {
    border-color: #d35444; /* Match dark mode header color */
}

body.dark-mode #timerCompleteModal .timer-complete-icon svg {
    fill: #d35444; /* Match dark mode header color */
}

body.dark-mode #timerCompleteModal .timer-complete-time {
    color: #c0c0c0; /* Lighter grey for time */
}

body.dark-mode #timerCompleteModal .timer-complete-title {
    color: #d0d0d0; /* Lighter grey */
}


body.dark-mode #timerCompleteModal .timer-complete-footer {
    background-color: #444; /* Darker footer background */
    border-top: 1px solid #555; /* Darker separator */
}

body.dark-mode #timerCompleteModal .timer-complete-footer button {
    /* Keep text white, adjust background */
}

body.dark-mode #timerCompleteModal .timer-complete-footer .btn-restart {
    background-color: #4a9d50; /* Adjusted green */
}
body.dark-mode #timerCompleteModal .timer-complete-footer .btn-restart:hover {
    background-color: #3e8343;
}

body.dark-mode #timerCompleteModal .timer-complete-footer .btn-ok {
    background-color: #d35444; /* Match dark mode header */
}
body.dark-mode #timerCompleteModal .timer-complete-footer .btn-ok:hover {
    background-color: #b7483a;
}


/* Styles for finished timer state buttons */
.timer-controls .btn-edit-timer {
    background-color: #007bff; /* Blue */
}
.timer-controls .btn-edit-timer:hover {
    background-color: #0056b3; /* Darker Blue */
}

.timer-controls .btn-reset-timer {
    background-color: #f0ad4e; /* Orange/Yellow */
}
.timer-controls .btn-reset-timer:hover {
    background-color: #ec971f; /* Darker Orange/Yellow */
}

/* Explicit style for start button, though it matches the default */
.timer-controls .btn-start-timer {
    background-color: #5cb85c; /* Green */
}
.timer-controls .btn-start-timer:hover {
    background-color: #4cae4c; /* Darker Green */
}

/* Style for the Start/Stop button when in 'Stop' state */
.timer-controls .btn-start-timer.stop-state {
    background-color: #f44336; /* Red */
}
.timer-controls .btn-start-timer.stop-state:hover {
    background-color: #d32f2f; /* Darker Red */
}

/* Style for the initial Set Timer button */
.btn-set-timer {
    padding: 10px 20px;
    font-size: 1rem;
    margin: 0 10px;
    cursor: pointer;
    border: none;
    border-radius: 5px;
    background-color: #5cb85c; /* Green */
    color: white;
    transition: background-color 0.3s ease;
}
.btn-set-timer:hover {
    background-color: #4cae4c; /* Darker Green */
}

/* Style for the title above the main timer */
.timer-title-display {
    font-size: 1.5rem; /* Adjust as needed */
    color: #666; /* Adjust as needed */
    margin-bottom: 10px; /* Space between title and timer */
    font-weight: bold;
    /* Ensure it doesn't push content too wide */
    max-width: 90%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Dark mode adjustments for titles */
body.dark-mode .timer-title-display {
    color: #b0b0b0; /* Lighter grey */
}

/* Quick Timer Links Section */
.quick-timer-links {
    width: 90%;
    max-width: 900px; /* Adjust max-width as needed */
    margin: 40px auto 20px auto; /* Add margin top/bottom */
    padding: 25px;
    background-color: #ffffff; /* White background */
    border-radius: 8px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
    text-align: center;
}

.quick-timer-links h2 {
    margin-bottom: 25px;
    color: #444;
    font-weight: 500;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

.quick-links-columns {
    display: flex;
    justify-content: space-around; /* Distribute columns evenly */
    gap: 20px; /* Space between columns */
    text-align: left; /* Align text within columns to the left */
}

.quick-links-column {
    flex: 1; /* Allow columns to share space */
    min-width: 150px; /* Minimum width for columns */
}

.quick-links-column h4 {
    margin-bottom: 15px;
    color: #666;
    font-weight: 600;
    border-bottom: 1px dashed #ddd;
    padding-bottom: 5px;
}

.quick-links-column ul {
    list-style: none; /* Remove default bullets */
    padding: 0;
    margin: 0;
}

.quick-links-column li {
    margin-bottom: 10px; /* Space between links */
}

.quick-links-column a {
    color: #007bff; /* Standard link blue */
    text-decoration: none;
    transition: color 0.2s ease;
    font-size: 0.95rem;
}

.quick-links-column a:hover {
    color: #0056b3; /* Darker blue on hover */
    text-decoration: underline;
}

/* Dark Mode for Quick Timer Links */
body.dark-mode .quick-timer-links {
    background-color: #2b2b2b; /* Dark background */
    box-shadow: 0 3px 10px rgba(255, 255, 255, 0.08); /* Lighter shadow */
}

body.dark-mode .quick-timer-links h2 {
    color: #e0e0e0; /* Light text */
    border-bottom: 1px solid #444; /* Darker border */
}

body.dark-mode .quick-links-column h4 {
    color: #b0b0b0; /* Lighter grey */
    border-bottom: 1px dashed #555; /* Darker dashed border */
}

body.dark-mode .quick-links-column a {
    color: #66b3ff; /* Lighter blue */
}

body.dark-mode .quick-links-column a:hover {
    color: #99ccff; /* Even lighter blue on hover */
}
