/* Basic Reset & Body Styles */
body {
    margin: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: #333;
    background-color: #f4f7f6;
    transition: background-color 0.3s, color 0.3s;
    overflow-x: hidden; /* Prevent horizontal scroll for body */
}

/* Dark Theme Styles */
body.theme-dark {
    color: #e0e0e0;
    background-color: #2c2c2c;
}

body.theme-dark header {
    background-color: #3a3a3a;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
}

body.theme-dark main {
    background-color: #333;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.5);
}

body.theme-dark #timezone-select,
body.theme-dark #search-input {
    background-color: #333;
    border-color: #555;
    color: #eee;
}

body.theme-dark .search-icon {
    color: #bbb;
}

body.theme-dark #timezone-select option {
    background-color: #4a4a4a;
    color: #e0e0e0;
}

body.theme-dark table {
    background-color: #3a3a3a;
}

body.theme-dark th {
    background-color: #4a4a4a;
    border-bottom: 2px solid #555;
    color: #f0f0f0;
}

body.theme-dark td {
    border-bottom: 1px solid #444;
    color: #e0e0e0;
}

body.theme-dark tr:nth-child(even) {
    background-color: #404040;
}

/* Header */
header-old {
    background-color: #ffffff;
    padding: 15px 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap; /* Allow wrapping on smaller screens */
    gap: 10px; /* Space between items when wrapped */
}

header {
    display: flex; /* Use flexbox for the header */
    justify-content: space-between; /* Push items to the far ends */
    align-items: flex-start; /* Align items to the top */
    padding: 15px 20px;
    padding-bottom: 20px; /* Add some space below the header */
}

/* New div to group left-aligned content */
.header-content-left {
    display: flex;
    flex-direction: column; /* Stack items vertically */
    align-items: flex-start; /* Align text to the left */
}

header h1 {
    margin: 0;
    font-size: 1.8em;
    color: #2c3e50;
}

body.theme-dark header h1 {
    color: #f0f0f0;
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap; /* Allow wrapping on smaller screens */
    justify-content: flex-end; /* Align to end if wrapped */
}

/* Timezone Selector */
.timezone-selector-container {
    position: relative;
}

#timezone-select {
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background-color: #fff;
    font-size: 0.95em;
    min-width: 200px;
    appearance: none; /* Remove default arrow */
    -webkit-appearance: none;
    background-image: url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%204%205%22%3E%3Cpath%20fill%3D%22%23333%22%20d%3D%22M2%200L0%202h4zM2%205L0%203h4z%22%2F%3E%3C%2Fsvg%3E');
    background-repeat: no-repeat;
    background-position: right 0.7em top 50%, 0 0;
    background-size: 0.65em auto, 100%;
}

body.theme-dark #timezone-select {
    background-image: url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%204%205%22%3E%3Cpath%20fill%3D%22%23e0e0e0%22%20d%3D%22M2%200L0%202h4zM2%205L0%203h4z%22%2F%3E%3C%2Fsvg%3E');
}


/* Theme Switch (Toggle) */
.theme-switch-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
}

.theme-switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 20px;
}

.theme-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    -webkit-transition: .4s;
    transition: .4s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    -webkit-transition: .4s;
    transition: .4s;
}

input:checked + .slider {
    background-color: #66bb6a; /* Green for checked/dark */
}

input:focus + .slider {
    box-shadow: 0 0 1px #66bb6a;
}

input:checked + .slider:before {
    -webkit-transform: translateX(20px);
    -ms-transform: translateX(20px);
    transform: translateX(20px);
}

/* Rounded sliders */
.slider.round {
    border-radius: 20px;
}

.slider.round:before {
    border-radius: 50%;
}

.theme-label {
    font-size: 0.9em;
    color: #555;
}

body.theme-dark .theme-label {
    color: #bbb;
}

/* Main Content */
main {
    max-width: 1200px;
    margin: 20px auto;
    padding: 20px;
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
}

#current-datetime {
    font-size: 1em;
    color: #555; /* A slightly lighter color for the date/time */
    margin-top: 0;
    margin-bottom: 10px; /* Space between datetime and the next section (search bar) */
}

body.theme-dark #current-datetime {
    color: #bbb;
}

/* Search Bar */
.search-bar-container {
    margin-bottom: 20px;
}

#search-input {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 1em;
    box-sizing: border-box; /* Include padding in width */
}

/* Table Container for Scroll */
.table-container {
    overflow-x: auto; /* Enable horizontal scroll for table */
    max-height: 400px; /* Limit height to show initial 6 rows approx */
    overflow-y: auto; /* Enable vertical scroll for table */
    border: 1px solid #eee; /* Add a subtle border */
    border-radius: 6px;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 700px; /* Ensure table is wide enough for horizontal scroll */
    text-align: left;
}

th, td {
    padding: 12px 15px;
    border-bottom: 1px solid #eee;
    /* Removed white-space: nowrap; from here */
    vertical-align: top; /* Align content to the top within cells */
}

/* Specific styling for columns that should NOT wrap */
.nowrap-column {
    white-space: nowrap;
}

th {
    background-color: #f8f8f8;
    font-weight: bold;
    color: #333;
    position: sticky;
    top: 0; /* Make header sticky when scrolling vertically */
    z-index: 1; /* Ensure header is above scrolling content */
}

body.theme-dark th {
    color: #f0f0f0;
}


td strong {
    color: #34495e;
}

body.theme-dark td strong {
    color: #f0f0f0;
}

td small {
    color: #777;
    font-size: 0.85em;
}

body.theme-dark td small {
    color: #bbb;
}

tr:nth-child(even) {
    background-color: #f9f9f9;
}

/* Status Indicators */
.status.open {
    color: #28a745; /* Green */
    font-weight: bold;
}

.status.closed {
    color: #dc3545; /* Red */
    font-weight: bold;
}

/* Countdown & Next Open formatting */
.countdown.active {
    font-weight: bold;
    color: #007bff; /* Blue */
}

/* Visually hidden for accessibility */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.search-container {
    position: relative;
    width: 100%; /* Adjust as needed */
    max-width: 600px; /* Adjust as needed */
    margin-bottom: 20px; /* Space below search bar */
    display: flex; /* To easily align icon */
    align-items: center;
}

#search-input {
    width: 100%;
    padding: 10px 15px 10px 40px; /* Add padding for icon */
    border: 1px solid #ccc;
    border-radius: 5px;
    box-sizing: border-box; /* Include padding in width */
    font-size: 1em;
    background-color: #f8f8f8;
    color: #333;
}

.search-icon {
    position: absolute;
    left: 15px; /* <--- CHANGED THIS LINE: Position from the left edge of the input */
    color: #888;
    pointer-events: none;
    font-size: 1.2em;
    /* Optional: Vertically center the icon if it's not already perfect */
    top: 50%;
    transform: translateY(-50%);
}

/* Optional: Style for the sub-heading */
.sub-heading {
    font-size: 1.1em;
    color: #555; /* Adjust color as needed for your theme */
    margin-top: 10px; /* Pull it slightly closer to the main heading */
    margin-bottom: 5px;
}

body.theme-dark .sub-heading {
    color: #bbb;
}

/* Ensure the input text doesn't overlap the icon */
#search-input::placeholder {
    color: #aaa;
}

/* Styles for the new Holiday Alert column */
.holiday-alert-header,
.holiday-alert {
    text-align: center; /* Center align text in the column */
    padding: 8px; /* Consistent padding */
    white-space: nowrap; /* Prevent text wrapping */
}

/* Optional: Style for cells that have an upcoming holiday */
.holiday-alert.has-holiday-alert {
    font-weight: bold;
    color: #ff9800; /* Example: Orange color for alerts */
}

/* Ensure all table headers and cells have consistent padding and alignment */
table th,
table td {
    padding: 8px 12px; /* Adjust as needed */
    text-align: left;
}

/* Adjustments for the new column header width if necessary */
.holiday-alert-header {
    width: 10%; /* Example: Adjust width if needed for layout */
}

/* --- New Footer/Disclaimer Styling --- */
.app-footer {
    text-align: center;
    padding: 15px 20px;
    font-size: 0.8em;
    color: #888; /* Discreet gray color */
    margin-top: 20px;
}

body.theme-dark .app-footer {
    color: #777;
}