/* Base Styles */
body {
    font-family: 'Poppins', sans-serif;
    margin: 1cm 1cm 1cm 1cm;
    padding: 0;
    text-align: center;
    background-color: #f5f7fa;
    color: #333;
}

/* Shared Font Sizes */
.fs-10 { font-size: 10px; }
.fs-12 { font-size: 12px; }
.fs-14 { font-size: 14px; }
.fs-16 { font-size: 16px; }
.fs-18 { font-size: 18px; }
.fs-20 { font-size: 20px; }
.fs-22 { font-size: 22px; }
.fs-24 { font-size: 24px; }
.fs-28 { font-size: 28px; }
.fs-32 { font-size: 32px; }
.fs-36 { font-size: 36px; }

/* Shared Colors */
.color-dark-blue { color: #2c3e50; }
.color-green { color: #27ae60; }
.color-red { color: red; }
.color-gray { color: #666; }
.color-black { color: #000; }
.color-light-gray { color: #555; }
.color-icon-green { color: #27ae60; }
.color-icon-red { color: #e74c3c; }

/* Headings and Titles */
h1 {
    color: #2c3e50;
    font-size: 32px;
    font-weight: 700;
    margin: 0 0 8px 0;
}
h2 {
    color: #2c3e50;
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 20px;
}
h3 {
    color: #2c3e50;
    font-size: 20px;
    font-weight: 400;
    margin: 5px 0;
}
h4 {
    color: #27ae60;
    font-size: 22px;
    font-weight: 600;
    margin: 10px 0;
    text-align: center;
}

/* Zero out top margin for specific section headings */
.hotels-section h2,
.flights-section h2,
.inclusions-section h2,
.exclusions-section h2,
.flight-info-section h2,
.visa-section h2,
.cancellations-section h2,
.rich-text-section h2,
.images-section h2 {
    margin-top: 0;
}


/* Tab Layout (Updated to Flat Design, No Rounded Corners) */
.tab-container {
    margin: 20px 0;
}

.tab-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    background-color: #e6e9f0;
    border-bottom: 1px solid #d1d5db;
    padding: 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.tab-buttons button {
    background-color: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    border-radius: 0;
    padding: 12px 20px;
    font-size: 16px;
    font-family: 'Poppins', sans-serif;
    font-weight: 500;
    color: #333;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: none;
    flex-grow: 1;
    flex-shrink: 1;
    flex-basis: auto;
    min-width: 100px;
}

.tab-buttons button:hover {
    background-color: #d1d5db;
    color: #000;
}

.tab-buttons button.active {
    background-color: #fff;
    color: #000;
    border-bottom: 2px solid #3b82f6;
    font-weight: 600;
}

.tab-content {
    display: none;
    padding: 20px;
    border: 1px solid #ccc;
    border-top: none;
    background-color: #fff;
}

.tab-content.active {
    display: block;
}

.tab-buttons button i {
    font-size: 14px;
    vertical-align: middle;
    margin-right: 4px;
}

.tab-buttons button.active i {
    color: #000;
}

/* Media Query for Small Screens */
@media (max-width: 768px) {
    .tab-buttons button {
        padding: 10px;
        font-size: 14px;
        border-bottom: 1px solid #eee;
        min-width: 80px;
    }
    .tab-buttons button:last-child {
        border-bottom: none;
    }
}

/* Containers (Shared) */
#dropdownContainer, #savedDropdowns {
    width: calc(100% - 40px);
    margin: 10px auto;
    text-align: left;
    padding: 20px;
    border-radius: 10px;
    box-sizing: border-box;
    position: relative;
    overflow: visible; /* Ensure dropdowns aren't clipped */
}

/* Section Containers for Full Width (Index-Specific) */
#dropdownContainer, #flightContainer, #inclusionContainer, #exclusionContainer, #imageContainer {
    width: 100%;
    margin: 0 auto 10px;
    padding: 0;
    box-sizing: border-box;
}

/* Itinerary Area */
#itineraryArea {
    width: 100%;
    margin: 0 auto;
    padding: 0;
    overflow: visible; /* Prevent unwanted scrolling */
}

/* Watermark for dropdownContainer */
#watermark {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-45deg);
    font-size: 30px;
    font-weight: 700;
    color: rgba(44, 62, 80, 0.1);
    pointer-events: none;
    z-index: 2000;
    white-space: nowrap;
}

/* Ensure itinerary content stays above watermark */
.itinerary-wrapper {
    position: relative;
    margin-bottom: 0;
    display: grid;
    grid-template-columns: minmax(80px, 150px) minmax(50px, 80px) minmax(200px, 1fr) minmax(150px, 250px) auto;
    align-items: center;
    width: 100%;
    justify-content: flex-start;
    padding: 0;
}

/* Add margins to child elements to simulate the gap */
.itinerary-wrapper > * {
    margin: 2px 10px; /* 10px left and right, 0 top and bottom */
}

/* Remove left margin from the first child to align with the grid's left edge */
.itinerary-wrapper > *:first-child {
    margin-left: 0;
}

/* Remove right margin from the last child to align with the grid's right edge */
.itinerary-wrapper > *:last-child {
    margin-right: 0;
}

/* Itinerary Label Above dropdownContainer */
.itinerary-label {
    color: #2c3e50;
    font-size: 24px;
    font-weight: 600;
    margin: 0 0 10px 0;
    text-align: center;
    width: 100%;
}

/* Dropdowns and Inputs (Shared) */
.wide-dropdown, .short-dropdown, .flight-dropdown, .baggage-dropdown, #searchDropdowns, #searchFlights, #searchBaggage {
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-family: 'Poppins', sans-serif;
    white-space: normal;
    overflow: auto;
    text-overflow: ellipsis;
    line-height: 1.2;
    height: auto;
    max-height: 200px;
    width: 100%;
    min-width: 0;
}

.wide-dropdown, .short-dropdown { width: 100%; max-width: 100%; }
.flight-dropdown { width: 70%; max-width: 70%; }
.baggage-dropdown { width: 20%; max-width: 20%; }
#searchDropdowns, #searchFlights, #searchBaggage { width: 100%; margin: 0 auto 15px auto; display: block; }

input[type="date"], select, input[type="text"], input[type="file"], .image-input, .position-input {
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 14px;
    width: 200px;
    font-family: 'Poppins', sans-serif;
}

.image-input { width: 50%; max-width: 50%; }
.position-input { width: 60px; margin-left: 10px; }

/* Full-width input for inclusions/exclusions */
.editor-input.full-width {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

/* Start Options */
.start-options {
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    margin-top: 20px;
    flex-wrap: wrap;
}

/* Labels in start-options */
.start-options label {
    font-size: 14px;
    color: #2c3e50;
    white-space: nowrap;
}

/* Adjust input and select within start-options */
.start-options input[type="date"],
.start-options select {
    width: 100%;
    max-width: 200px;
    box-sizing: border-box;
}

/* Prepared Date */
.prepared-date {
    font-size: 14px;
    color: #555;
    font-family: 'Poppins', sans-serif;
    margin: 0;
    text-align: center;
    width: 100%;
}

/* Title Wrapper */
.title-wrapper {
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    margin-top: 20px;
    flex-direction: row; /* Changed to row to place label and input side by side */
}

.title-wrapper label {
    font-size: 14px;
    color: #2c3e50;
    white-space: nowrap; /* Prevent label from wrapping */
}

#titleInput {
    width: 100%;
    max-width: 100%;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 14px;
    font-family: 'Poppins', sans-serif;
    box-sizing: border-box;
    text-align: center; /* Center the text */
    font-weight: bold;
}

/* Buttons */
button, .small-btn {
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    font-weight: 600;
    text-transform: none;
    padding: 10px 20px;
    transition: background-color 0.3s ease, transform 0.2s ease;
    background-color: #3498db;
    color: #fff;
}

button:hover, .small-btn:hover {
    background-color: #2980b9;
    transform: translateY(-1px);
}

button:active, .small-btn:active {
    transform: translateY(0);
}

.small-btn {
    padding: 6px 12px;
    border-radius: 6px;
}

#addManualinclusion {
    background-color: #27ae60;
}

#addManualExclusion {
    background-color: #e74c3c;
}

#exportItineraries {
    background-color: #2ecc71;
}
#exportItineraries:hover {
    background-color: #27ae60;
}

#addItinerary, #addHotel {
    background-color: #f1c40f;
}
#addItinerary:hover, #addHotel:hover {
    background-color: #d4ac0d;
}

#addImage {
    background-color: #9b59b6;
}
#addImage:hover {
    background-color: #8e44ad;
}

#exportWordButton {
    background-color: #ff9800;
}
#exportWordButton:hover {
    background-color: #e68900;
}

button[color-icon-red], button#deleteAllClients, #clearAllItineraries {
    background-color: #e74c3c;
}
button[color-icon-red]:hover, button#deleteAllClients:hover, #clearAllItineraries:hover {
    background-color: #c0392b;
}

/* Smaller Button with Trash Icon */
.smaller-btn {
    padding: 6px;
    font-size: 12px;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #e74c3c;
    transition: background-color 0.3s ease;
}

.smaller-btn:hover {
    background-color: #c0392b;
}

.smaller-btn i {
    margin: 0;
    color: #fff;
}

/* Sections */
.itinerary-section, .inclusions-section, .exclusions-section, .flights-section, .image-section, .cancellation-section {
    margin-bottom: 10px;
    width: 100%;
    text-align: center;
}

.inclusion-wrapper, .exclusion-wrapper, .visa-wrapper {
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: center;
    width: 100%;
    flex-wrap: nowrap;
}

/* Reduced margin for tighter spacing in flight rows */
.flight-wrapper {
    margin-bottom: 5px; /* Reduced gap */
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: flex-start;
    width: 100%;
    flex-wrap: nowrap;
}

.image-wrapper, .cancellation-wrapper {
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: center;
    width: 100%;
    flex-wrap: nowrap;
}

/* Reduce margin on separators within hotel/flight items */
.hotel-wrapper .separator,
.flight-wrapper .separator {
    margin-top: 5px; /* Reduce top margin */
    margin-bottom: 5px; /* Reduce bottom margin */
    border-color: #eee; /* Optional: make it less prominent */
}

/* --- Styles for Image Input Row --- */
.image-wrapper {
    justify-content: flex-start; /* Align items (input row + button) to the start */
}

.image-input-row {
    display: flex; /* Arrange URL and Position inputs horizontally */
    flex-grow: 1; /* Allow this row to take up available space next to the button */
    gap: 10px; /* Space between URL and Position inputs */
    align-items: center; /* Vertically align items in the row */
}

.image-url-input {
    flex-grow: 1; /* Make URL input take most of the space */
    width: auto; /* Override default fixed width if any */
    min-width: 150px; /* Optional: Ensure it doesn't get too small */
}

.image-position-input {
    width: 60px; /* Fixed width for 2 digits */
    flex-shrink: 0; /* Prevent shrinking */
    text-align: center; /* Center the number */
}

/* Ensure inputs use consistent styling */
input.image-url-input, input.image-position-input {
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 14px;
    font-family: 'Poppins', sans-serif;
    box-sizing: border-box;
}
/* --- End Image Input Row Styles --- */


.rich-text-wrapper {
    margin-bottom: 20px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    width: 100%;
    flex-wrap: nowrap;
}

/* Meal Checkboxes */
.meal-checkboxes {
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: flex-start;
    min-width: 150px;
    flex-wrap: wrap;
}

.meal-checkboxes input[type="checkbox"] { margin: 0; }
.meal-checkboxes label { font-size: 14px; color: #333; }

/* Day Label and Date Display */
.day-label {
    font-size: 14px;
    font-weight: 600;
    color: #2c3e50;
    padding: 4px;
    background-color: #f1c40f;
    border-radius: 5px;
    text-align: center;
    flex-shrink: 0;
}

.date-display {
    font-size: 12px;
    color: #555;
    white-space: nowrap;
    font-family: 'Poppins', sans-serif;
    background-color: #f8f9fa;
    padding: 4px 8px;
    border-radius: 3px;
    text-align: center;
    flex-shrink: 0;
}

/* Backend and Editor Specific */
.dropdown-item, .inline-editor {
    border: 1px solid #ddd;
    border-radius: 5px;
    background-color: #fff;
    text-align: left;
    font-size: 14px;
    font-family: 'Poppins', sans-serif;
}

.dropdown-item {
    padding: 10px;
    margin: 5px 0;
    flex: 1;
    max-height: none;
    overflow: visible;
}

.dropdown-entry {
    display: flex;
    flex-wrap: nowrap;
    margin-bottom: 10px;
    background: #fff;
    padding: 10px;
    border-radius: 8px;
    box-shadow: 0 1px 5px rgba(0, 0, 0, 0.05);
    align-items: flex-start;
    width: 100%;
}

.dropdown-number {
    width: 30px;
    font-weight: 700;
    color: #2c3e50;
    flex-shrink: 0;
    padding-top: 5px;
}

.button-group {
    margin: 5px 0;
    justify-content: center;
    display: flex;
    gap: 10px;
}

.centered-button {
    text-align: center;
    margin-bottom: 20px;
}

.top-controls {
    position: static;
    top: 20px;
    right: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.ellipsis {
    color: #999;
    font-style: italic;
}

/* Custom Scrollbar */
.short-dropdown::-webkit-scrollbar { width: 8px; }
.short-dropdown::-webkit-scrollbar-track { background: #f1f1f1; }
.short-dropdown::-webkit-scrollbar-thumb { background: #888; }
.short-dropdown::-webkit-scrollbar-thumb:hover { background: #555; }

/* Subheader */
.subheader {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-bottom: 20px;
}

/* Import JSON */
#importJson {
    padding: 8px;
    font-size: 14px;
    font-family: 'Poppins', sans-serif;
}

/* Centered Button */
.centered-button {
    text-align: center;
    margin: 20px auto 0;
    width: 100%;
    display: block;
}

/* Horizontal Divider for Sections */
.itinerary-section,
.flights-section,
.inclusions-section,
.exclusions-section,
.image-section,
.visa-section,
.rich-text-section {
    position: relative;
    margin-bottom: 20px;
}

/* Apply border/padding to sections */
.hotels-section:not(:last-child), /* Added hotels back */
.flights-section:not(:last-child),
.inclusions-section:not(:last-child),
.exclusions-section:not(:last-child),
.image-section:not(:last-child),
.visa-section:not(:last-child),
.rich-text-section:not(:last-child) {
    border-bottom: 2px dashed #ddd;
    padding-bottom: 20px;
}

/* Inline Editor */
.inline-editor {
    width: 100%;
    min-height: 300px;
    border: 1px solid #ddd;
    border-radius: 5px;
    overflow: visible;
}

/* TinyMCE Specific Fixes */
.tox-tinymce {
    width: 100% !important;
    min-height: 350px !important;
    border: 1px solid #ddd !important;
    border-radius: 5px !important;
}

/* New Styles for Meal Dropdown */
select[id^="meals"] {
    width: 100%;
    max-width: 250px;
    padding: 8px;
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    background-color: transparent;
    border: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: none;
    line-height: 1.4;
    height: 34px;
}

select[id^="meals"] option {
    padding: 5px;
    background-color: #fff;
}

/* Screenshot Area */
#screenshotArea {
    width: 100%;
    margin: 0 auto;
    padding: 0;
    box-sizing: border-box;
    position: relative;
}

/* Suggestion Dropdown */
.suggestion-dropdown {
    position: absolute;
    background-color: #fff;
    border: 1px solid #ccc;
    border-radius: 5px;
    z-index: 5000;
    display: none;
    margin-top: 2px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    width: auto;
    min-width: 200px; /* Ensure it’s wide enough */
    max-height: 200px; /* Limit height for scrollbar */
    overflow-y: auto; /* Enable vertical scrollbar */
    overflow-x: hidden; /* Prevent horizontal scrollbar */
}

/* Textarea for Itinerary */
textarea[id^="itinerary"] {
    width: 100%;
    max-width: 100%;
    height: 32px;
    min-height: 32px;
    padding: 8px;
    box-sizing: border-box;
    white-space: normal;
    word-wrap: break-word;
    overflow-wrap: break-word;
    resize: vertical;
    line-height: 1.4;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    overflow: hidden;
    min-width: 0;
}

textarea[id^="itinerary"]:focus {
    height: auto;
}

/* Tags and Tag Suggestions */
.tags {
    font-size: 0.9em;
    color: #555;
    margin-top: 5px;
}

.tag-suggestions {
    display: inline-block;
    margin-left: 5px;
    color: #888;
    font-style: italic;
    pointer-events: none;
}

.tag-input-wrapper {
    position: relative;
    display: inline-block;
    width: 50%;
}

.tag-input-wrapper input {
    width: 100%;
}

.tags-container {
    margin-bottom: 10px;
}

.tag {
    display: inline-block;
    background-color: #f0f0f0;
    padding: 5px 10px;
    margin: 0 5px 5px 0;
    border-radius: 15px;
    cursor: pointer;
    font-size: 0.9em;
    transition: background-color 0.2s;
}

.tag:hover {
    background-color: #e0e0e0;
}

.tag.active {
    background-color: #007bff;
    color: white;
}

/* Hotel Wrapper and Checkboxes */
.hotel-wrapper {
    margin-bottom: 5px; /* Reduced gap */
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: flex-start;
    width: 100%;
    flex-wrap: nowrap;
}

.hotel-checkboxes {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: center;
}

.hotel-checkboxes label {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 14px;
    color: #333;
}

.hotel-checkboxes input[type="checkbox"] {
    margin: 0;
}

/* Editor Container Adjustments for Itinerary */
#editorContainer {
    margin: 20px auto;
    padding: 20px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    max-width: 100%;
    box-sizing: border-box;
}

#editorContainer input[type="text"],
#editorContainer .tag-input-wrapper input {
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 14px;
    font-family: 'Poppins', sans-serif;
    margin-bottom: 10px;
    width: 100%;
}

#editorContainer .tag-input-wrapper {
    display: inline-block;
    vertical-align: top;
    width: 50%;
    margin-left: 0;
    padding-left: 5px;
}

#editorContainer #itineraryTitle {
    width: 100%;
    display: block;
    margin-bottom: 15px;
}

/* Tag and Country Row */
.tag-country-row {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.tag-country-row .input-group {
    flex: 1;
    position: relative;
}

.tag-suggestions, .country-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 5px;
    color: #888;
    font-style: italic;
    z-index: 10;
}

/* Hide suggestion elements when they are empty */
.tag-suggestions:empty,
.country-suggestions:empty {
    display: none; /* Hide the element if it has no content */
}

/* Meal Selection */
.meal-selection {
    margin-bottom: 15px;
    display: flex;
    gap: 15px;
    align-items: center;
}

.meal-selection label {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 14px;
    color: #333;
}

/* Inclusions and Exclusions */
.inclusions-exclusions {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 15px;
    margin-bottom: 15px;
}

.inclusions-exclusions .input-group {
    flex: 1;
}

.inclusions-exclusions label {
    font-size: 14px;
    color: #2c3e50;
    margin-bottom: 5px;
    display: block;
}

/* Inclusions and Exclusions List View */
.inclusions-list, .exclusions-list {
    margin-top: 10px;
}

.inclusions-list strong, .exclusions-list strong {
    display: block;
    color: #2c3e50;
    margin-bottom: 5px;
}

.inclusion-item, .exclusion-item {
    display: block; /* Changed from inline-block to block */
    background-color: #f0f9ff;
    padding: 5px 10px;
    margin: 2px 5px;
    border-radius: 5px;
    font-size: 13px;
    color: #333;
}

.exclusion-item {
    background-color: #fff0f0;
}

.inclusion-exclusion-divider {
    border: none;
    border-top: 1px solid #ddd;
    margin: 10px 0;
}

/* CRUD Buttons Container */
.crud-buttons {
    display: flex;
    gap: 5px;
    justify-content: flex-start;
    margin-top: 10px;
    flex-wrap: wrap;
}

/* Filters Row */
.filters-row {
    display: block;
    margin-bottom: 15px;
}

.countries-container, .tags-container {
    min-width: 200px;
    margin-bottom: 10px;
}

.country, .tag {
    display: inline-block;
    padding: 5px 10px;
    margin: 0 5px 5px 0;
    background-color: #f0f0f0;
    border-radius: 15px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.country.active, .tag.active {
    background-color: #007bff;
    color: white;
}

/* Styles for Itinerary Editing Form */
.dropdown-item .edit-label { /* Style for the new labels */
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #2c3e50;
    font-size: 14px;
}

.dropdown-item .edit-title,
.dropdown-item .edit-tags,
.dropdown-item .edit-country { /* Make edit inputs full width */
    width: 100%;
    box-sizing: border-box; /* Include padding and border in the element's total width and height */
    margin-bottom: 10px; /* Add some space below inputs */
}

/* Ensure input groups within the edit form also behave correctly */
.dropdown-item .tag-country-row .input-group {
    width: 100%; /* Allow input groups to take full width if needed */
}

/* Additional Styles for Arrange Buttons */
.suggestion-item {
    padding: 5px 10px;
    cursor: pointer;
}
.suggestion-item:hover {
    background-color: #f0f0f0;
}
.suggestion-dropdown {
    position: absolute;
    background-color: white;
    border: 1px solid #ddd;
    z-index: 1000;
    max-height: 200px;
    overflow-y: auto;
    overflow-x: hidden;
}
.hotel-wrapper label {
    display: block;
    margin: 5px 0;
}
.inclusion-wrapper label {
    display: block;
    margin: 5px 0;
}
.manual-inclusion-wrapper {
    display: flex;
    align-items: center;
    margin: 5px 0;
}
.manual-inclusion-wrapper input[type="text"] {
    flex-grow: 1;
    margin-right: 10px;
}
.exclusion-wrapper label {
    display: block;
    margin: 5px 0;
}
.manual-exclusion-wrapper {
    display: flex;
    align-items: center;
    margin: 5px 0;
}
.manual-exclusion-wrapper input[type="text"] {
    flex-grow: 1;
    margin-right: 10px;
}
.visa-wrapper {
    display: flex;
    align-items: center;
    margin: 5px 0;
}
.visa-wrapper select {
    flex-grow: 1;
    margin-right: 10px;
}
.cancellation-wrapper {
    display: flex;
    align-items: center;
    margin: 5px 0;
}
.cancellation-wrapper select {
    flex-grow: 1;
    margin-right: 10px;
}
.itinerary-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 20px;
    position: relative;
}

.arrange-buttons {
    display: inline-flex;
    gap: 8px;
    margin-left: 10px;
    vertical-align: middle;
    flex-wrap: nowrap;
}
.arrange-btn {
    background: #0c80a9;
    border: 1px solid #ccc;
    border-radius: 3px;
    padding: 2px 6px;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    min-width: 24px;
    min-height: 24px;
}
.arrange-btn:disabled {
    background: #e0e0e0;
    color: #999;
    cursor: not-allowed;
}
.arrange-btn i {
    vertical-align: middle;
}

.drag-handle {
    cursor: move;
    margin-right: 10px;
    color: #666;
}

.hotel-checkboxes {
    flex-grow: 1;
}

.visa-wrapper {
    position: relative;
}
#visaContainer {
    display: flex;
    flex-direction: column;
}

.flight-info-section {
    margin: 20px 0;
}

.flight-info-wrapper {
    display: flex;
    align-items: center;
    margin: 10px 0;
    padding: 5px;
    border-radius: 4px;
}

.flight-info-wrapper select.wide-dropdown {
    flex: 1;
    margin-left: 10px;
    padding: 5px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

/* .drag-handle is duplicated - removed */

.flight-info-wrapper .small-btn {
    margin-left: 10px;
    padding: 5px 10px;
    background-color: #e74c3c;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.flight-info-wrapper .small-btn:hover {
    background-color: #c0392b;
}

button#addFlightInfo {
    margin-top: 10px;
    padding: 8px 16px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

button#addFlightInfo:hover {
    background-color: #2980b9;
}

.countries-container, .tags-container {
    margin-bottom: 10px;
}

.custom-textbox-container {
    text-align: center;
    margin: 20px 0;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

.custom-textbox-label {
    font-size: 16px;
    font-weight: bold;
    color: #2c3e50;
    margin: 0;
}

.custom-textbox {
    padding: 10px 15px;
    font-size: 16px;
    width: 300px;
    text-align: left;
}

.custom-textbox:focus {
    border-color: #2980b9;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* Remove border from Price textbox */
#priceInput {
    border: none; /* Remove the border */
}

/* Ensure the focus state also has no border but keeps the shadow */
#priceInput:focus {
    border: none; /* Remove border on focus */
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15); /* Retain the shadow for visual feedback */
}

.itinerary-image {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 10px 0;
    border-radius: 5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}
.image-wrap {
    margin: 10px 0;
    text-align: center;
}
.image-wrap p {
    color: #e74c3c;
    font-size: 14px;
    margin: 0;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    position: relative;
}

.logout-btn {
    background-color: #f44336;
    color: white;
    border: none;
    padding: 8px 16px;
    font-size: 16px;
    cursor: pointer;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.logout-btn:hover {
    background-color: #d32f2f;
}

.logout-btn i {
    margin-right: 5px;
    vertical-align: middle;
}

/* Date Buttons */
.date-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin: 10px 0;
    padding: 0 10px;
}

.date-btn {
    width: 25px;
    height: 25px;
    background-color: #E0E0E0;
    color: black;
    border: none;
    border-radius: 3px;
    font-size: 12px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.date-btn:hover {
    background-color: #B0B0B0;
}

.date-btn:active {
    background-color: #808080;
}

.date-btn.selected {
    background-color: #4CAF50;
    color: white;
}

.date-btn.selected:hover {
    background-color: #45a049;
}

.date-btn.selected:active {
    background-color: #388E3C;
}

.clear-btn {
    width: 50px;
    height: 25px;
    background-color: #FF5722;
    color: white;
    border: none;
    border-radius: 3px;
    font-size: 12px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.clear-btn:hover {
    background-color: #E64A19;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 60px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #333333;
    color: white;
    padding: 10px;
    border-radius: 5px;
    font-size: 14px;
    text-align: center;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
    z-index: 1000;
}

.toast.show {
    opacity: 1;
}

/* Hidden Elements */
#loadedData, #currentItineraryId, #loggedInUsername, #hotelData, #flightData, #baggageData, #visaData, #flightInfoData, #cancellationData, #notesData, #clientsData {
    display: none;
}

/* Client Form */
#clientForm {
    display: none;
}

/* Edit Mode Button */
#editMode {
    display: none;
}

/* Import Clients File */
#importClientsFile {
    display: none;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .start-options {
        flex-direction: column;
        align-items: flex-start;
    }

    .start-options input[type="date"],
    .start-options select {
        max-width: 100%;
    }

    .start-options label {
        margin-bottom: 5px;
    }

    .prepared-date {
        margin-top: 5px;
    }

    .title-wrapper {
        flex-direction: column;
    }

    #titleInput {
        width: 100%;
    }

    .itinerary-wrapper {
        grid-template-columns: 60px 50px 1fr 80px auto;
        gap: 5px;
        align-items: start;
    }

    .flight-wrapper, .inclusion-wrapper, .exclusion-wrapper, .visa-wrapper, .hotel-wrapper {
        flex-direction: column;
        align-items: stretch;
        gap: 5px;
    }

    .arrange-buttons {
        margin-left: 0;
        margin-top: 5px;
        gap: 5px;
    }

    .arrange-btn {
        min-width: 20px;
        min-height: 20px;
        font-size: 14px;
    }

    .small-btn, .smaller-btn {
        width: 28px;
        height: 28px;
        margin: 0;
    }

    .meal-checkboxes {
        flex-direction: row;
        flex-wrap: wrap;
        min-width: 0;
        gap: 5px;
    }

    .day-label, .date-display {
        font-size: 12px;
        padding: 4px;
    }

    textarea[id^="itinerary"] {
        min-width: 0;
    }

    .hotel-checkboxes {
        flex-direction: column;
        gap: 10px;
    }

    .rich-text-wrapper .tox-tinymce {
        min-height: 200px !important;
    }
}

@media (max-width: 480px) {
    .start-options input[type="date"],
    .start-options select {
        max-width: 100%;
    }

    .itinerary-wrapper {
        grid-template-columns: 50px 40px 1fr auto;
        grid-template-rows: auto auto;
        gap: 5px;
    }

    .meal-checkboxes {
        grid-column: 1 / -1;
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: flex-start;
        gap: 5px;
    }

    .small-btn {
        grid-column: -2 / -1;
        margin: 5px 0;
    }

    textarea[id^="itinerary"] {
        grid-column: 1 / -1;
    }

    .arrange-buttons {
        flex-direction: row;
        gap: 3px;
    }

    .arrange-btn {
        min-width: 18px;
        min-height: 18px;
        font-size: 12px;
    }
}

.hotels-section, .flights-section, .visa-section, .cancellations-section, .rich-text-section {
    width: 100%;
}

/* Ensure Title, Tags, and Country are in the same row */
.input-group.inline {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: nowrap;
    margin-bottom: 15px;
}

.input-group.inline label {
    white-space: nowrap;
    margin-bottom: 0;
}

.input-group.inline input {
    flex: 1;
    min-width: 0;
}

/* Adjust tag-country-row for better alignment */
.tag-country-row {
    display: flex;
    gap: 20px;
    flex-wrap: nowrap;
    align-items: center;
}

.tag-country-row .input-group {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
}

.tag-country-row .input-group label {
    white-space: nowrap;
    margin-bottom: 0;
}

.tag-country-row .input-group input {
    flex: 1;
    min-width: 0;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .input-group.inline {
        flex-direction: column;
        align-items: flex-start;
    }

    .input-group.inline label {
        margin-bottom: 5px;
    }

    .tag-country-row {
        flex-direction: column;
        gap: 15px;
    }

    .tag-country-row .input-group {
        flex-direction: column;
        align-items: flex-start;
    }

    .tag-country-row .input-group label {
        margin-bottom: 5px;
    }
}

#clearFilters {
    margin-bottom: 10px; /* Adjust spacing as needed */
}

/* Itinerary Suggestion Tooltip */
#itinerary-tooltip {
    position: absolute; /* Positioned by JS */
    display: none; /* Hidden by default */
    background-color: #ffffe0; /* Light yellow background */
    border: 1px solid #ccc;
    padding: 10px;
    z-index: 1002 !important; /* Ensure it's above dropdown */
    max-width: 450px; /* Limit width */
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    pointer-events: none; /* Prevent tooltip from interfering with mouse events */
    font-size: 13px; /* Slightly smaller font */
    color: #333;
    line-height: 1.4;
    word-wrap: break-word; /* Wrap long words/content */
    border-radius: 4px;
}

/* Styles for Group By Dropdown in Itinerary Tab */
#groupItineraries {
    background-color: #f0f0f0; /* Light gray background */
    color: #333; /* Dark text color */
    border: 1px solid #ccc;
    border-radius: 6px; /* Match small-btn */
    padding: 5px 10px; /* Adjusted padding slightly */
    height: 30px; /* Match button height */
    vertical-align: middle; /* Align with adjacent buttons */
    margin-left: 10px; /* Space from clear button */
    cursor: pointer;
    font-family: 'Poppins', sans-serif; /* Match font */
    font-size: 14px; /* Match font size */
    font-weight: 600; /* Match button weight */
    -webkit-appearance: none; /* Remove default OS styling */
    -moz-appearance: none;
    appearance: none;

    /* Add custom dropdown arrow */
    background-image: url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23333333%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.4-12.8z%22%2F%3E%3C%2Fsvg%3E');
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 10px auto;
    padding-right: 30px; /* Space for the arrow */
    line-height: normal; /* Reset line-height if needed */
}

#groupItineraries:hover {
    background-color: #e0e0e0; /* Slightly darker on hover */
    border-color: #bbb;
}

#groupItineraries:focus {
    outline: none;
    border-color: #999;
    box-shadow: 0 0 3px rgba(0, 0, 0, 0.1);
}

/* --- Styles for Dynamic Lists --- */
.dynamic-list-section {
    border: 1px solid #eee;
    padding: 10px;
    margin-bottom: 15px;
    border-radius: 4px;
    background-color: #f9f9f9;
}

.dynamic-list-section label {
    margin-bottom: 8px;
    font-weight: bold;
    color: #555;
    display: block; /* Ensure label is on its own line */
    text-align: left; /* Align label text left */
}

.dynamic-list-item {
    display: flex;
    align-items: center;
    margin-bottom: 5px;
    gap: 5px; /* Add small gap between input and button */
}

.dynamic-list-item input[type="text"] {
    flex-grow: 1; /* Allow input to grow */
    flex-shrink: 1; /* Allow input to shrink */
    width: 1%; /* Start small, let flex-grow expand it. Prevents overflow pushing button. */
    min-width: 150px; /* Ensure it's usable */
    margin-right: 0; /* Remove margin, use gap instead */
    margin-bottom: 0; /* Override default bottom margin */
    /* Inherit general input styles */
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 14px;
    font-family: 'Poppins', sans-serif;
    box-sizing: border-box;
}

.add-item-btn, .remove-item-btn {
    padding: 4px 8px; /* Slightly more padding for better click area */
    font-size: 1em;
    line-height: 1;
    min-width: 28px; /* Adjust min-width */
    text-align: center;
    flex-shrink: 0; /* Prevent buttons from shrinking */
    /* Inherit general button styles */
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.add-item-btn {
    background-color: #5cb85c; /* Green */
    color: white;
    margin-top: 5px; /* Space above add button */
    display: inline-block; /* Change to inline-block */
    margin-left: 0; /* Align with the list */
}
.add-item-btn:hover {
     background-color: #4cae4c;
}


.remove-item-btn {
    background-color: #d9534f; /* Red */
    color: white;
}
.remove-item-btn:hover {
     background-color: #c9302c;
}


/* Adjustments for inline edit lists (ensure consistency) */
#savedItineraries .dynamic-list-section {
    padding: 8px;
    background-color: #fff; /* Match background */
}

/* No specific overrides needed anymore for inline edit inputs/buttons */

/* --- Suggestion List Styles --- */
.suggestions-container {
    display: none; /* Hidden by default */
    position: absolute; /* Positioned by JS relative to the dynamic-list-section */
    border: 1px solid #ccc;
    background-color: white;
    max-height: 150px; /* Limit height */
    overflow-y: auto; /* Add scroll if needed */
    z-index: 1000; /* Ensure it's on top */
    box-shadow: 0 2px 5px rgba(0,0,0,0.15);
    border-radius: 4px;
    text-align: left; /* Align text left */
    font-size: 14px; /* Match input font size */
}

.suggestion-item {
    padding: 8px 10px;
    cursor: pointer;
    white-space: nowrap; /* Prevent wrapping */
    overflow: hidden;
    text-overflow: ellipsis; /* Add ellipsis if too long */
}

.suggestion-item:hover {
    background-color: #f0f0f0;
}

/* Ensure dynamic list section allows absolute positioning of children */
.dynamic-list-section {
    position: relative; /* Needed for absolute positioning of suggestions-container */
}

/* --- Custom Dropdown Styles --- */
.custom-dropdown {
    position: relative;
    display: inline-block; /* Or block, depending on layout */
    border: 1px solid #ccc;
    border-radius: 4px;
    background-color: #fff;
    cursor: pointer;
    min-width: 150px;
    user-select: none;
    box-sizing: border-box;
    overflow: visible !important;
    height: 34px; /* Match the computed height of wide-dropdown (padding 8px + 8px + border 1px + 1px + content) */
}

/* Mimic wide-dropdown style if needed */
.custom-dropdown.wide-dropdown {
    width: 100%; /* Or specific width */
    margin-bottom: 5px; /* Match spacing */
    flex-grow: 1; /* Make it take available space in flex container */
}


.custom-dropdown .selected-option {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: normal;
    position: relative;
    box-sizing: border-box;
    font-size: 14px;
    padding: 8px 30px 8px 8px; /* Matches wide-dropdown padding, with space for arrow */
    height: 100%; /* Fills the parent custom-dropdown height */
    display: flex; /* Keep flex for vertical centering */
    align-items: center; /* Vertically center the text */
    justify-content: flex-start; /* Align text to the left */
}

/* Add arrow indicator */
.custom-dropdown .selected-option::after {
    content: ' ▼'; /* Simple down arrow */
    font-size: 0.8em;
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #555;
    pointer-events: none; /* Prevent arrow from capturing clicks */
}


.custom-dropdown .options-list {
    position: absolute;
    top: 100%; /* Position below the selected option */
    left: -1px; /* Align with border */
    right: -1px; /* Align with border */
    background-color: #fff;
    border: 1px solid #ccc;
    border-top: none; /* Avoid double border */
    border-radius: 0 0 4px 4px;
    max-height: 200px; /* Limit height and allow scrolling */
    overflow-y: auto;
    z-index: 1001; /* Ensure it's above other elements */
    list-style: none;
    padding: 0;
    margin: 0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    text-align: left; /* Align text to the left */
}

.custom-dropdown .options-list li {
    padding: 8px 12px;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    border-bottom: 1px solid #eee; /* Add divider line */
}

.custom-dropdown .options-list li:last-child {
    border-bottom: none; /* Remove border from last item */
}

.custom-dropdown .options-list li:hover {
    background-color: #f0f0f0;
}

/* Style for the placeholder/default option */
.custom-dropdown .options-list li[data-value=""] {
    color: #888;
}

/* Ensure tooltip is above dropdown list */
#itinerary-tooltip {
    z-index: 1002 !important;
    position: absolute;
    border: 1px solid #ccc;
    background-color: #f9f9f9;
    padding: 10px;
    max-width: 400px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    pointer-events: none; /* Important so it doesn't interfere with mouse events */
    font-size: 0.9em;
    line-height: 1.4;
    border-radius: 3px;
}

/* --- End Custom Dropdown Styles --- */

/* Styles for Meal Controls Container */
.meal-controls {
    display: flex; /* Arrange items horizontally */
    align-items: center; /* Vertically align items */
    gap: 5px; /* Add small gap between items */
    margin-top: 5px; /* Space above the controls */
    margin-bottom: 5px; /* Space below the controls */
}

.meal-controls i.fa-utensils {
    /* Icon specific styles if needed, e.g., color */
    color: #130b20; /* Example color */
    flex-shrink: 0; /* Prevent icon from shrinking */
    margin-left: 10px;
}

.meal-controls select {
    /* Adjust select width if needed, or let it take default width */
    max-width: 200px; /* Example max-width */
    flex-grow: 0; /* Don't let select grow excessively */
    flex-shrink: 1;
    /* Reset margins if they interfere */
    margin: 0;
}

.meal-controls .smaller-btn {
    /* Adjust button margin if needed */
    margin: 0; /* Reset margin */
    flex-shrink: 0; /* Prevent button from shrinking */
}


/* Suggestion Dropdown Styles */
.suggestion-dropdown {
    position: absolute;
    border: 1px solid #ccc;
    background-color: white;
    z-index: 1000;
    max-height: 200px; /* Adjust as needed */
    overflow-y: auto;
    box-shadow: 0 2px 5px rgba(0,0,0,0.15);
}

.suggestion-item {
    padding: 8px 12px;
    cursor: pointer;
    border-bottom: 1px solid #eee;
}

.suggestion-item:last-child {
    border-bottom: none;
}

.suggestion-item:hover,
.suggestion-item:focus {
    background-color: #f0f0f0; /* Style for hover/focus */
    outline: none; /* Remove default focus outline if desired */
}

/* Style for the explicitly highlighted item (via mousedown or keyboard nav) */
/* Increased specificity slightly and removed !important */
.itinerary-wrapper > .suggestion-dropdown > .suggestion-item.highlighted {
    background-color: #cce5ff; /* Light blue highlight */
    color: #000; /* Ensure text is readable */
    font-weight: normal; /* Override potential bolding from focus */
}


/* Add other styles below */
.client-item.archived, .client-card.archived {
    background-color: #f0f0f0;
    opacity: 0.8;
}
.archived-label {
    color: #888;
    font-style: italic;
}
button.archive, button.unarchive {
    background-color: #f0ad4e;
    color: white;
    border: none;
    padding: 5px 10px;
    cursor: pointer;
}
button.unarchive {
    background-color: #5bc0de;
}
button.archive:hover, button.unarchive:hover {
    opacity: 0.9;
}


.input-group.inline {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}
.input-group.inline label {
    width: 100px;
    margin-right: 10px;
}
.editor-input {
    padding: 5px;
    border: 1px solid #ccc;
    border-radius: 4px;
    width: 100%;
}