body, html {
    height: 100%; /* Ensure body and html take full height for overlay */
    overflow: hidden; /* Prevent scrolling when overlay is active initially */
}

body.app-unlocked {
    overflow: auto; /* Allow scrolling once app is unlocked */
}

#pin-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.85); /* Darker overlay */
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column; /* Stack items vertically */
    z-index: 2000;
}

#pin-box {
    background-color: var(--bg-color);
    padding: 30px 40px;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
    text-align: center;
    /* position: relative; */ /* No longer needed */
    /* padding-top: 60px; */ /* No longer needed as logo is outside */
}

#pin-screen-logo {
    /* position: absolute; */ /* No longer needed */
    /* top: 15px; */ /* No longer needed */
    /* left: 15px; */ /* No longer needed */
    width: 80px; /* A bit bigger */
    height: auto;
    margin-bottom: 20px; /* Space between logo and pin-box */
}

#pin-box h2 {
    color: #fabd2f; /* Gruvbox bright yellow */
    margin-top: 0;
    margin-bottom: 25px;
}

#pin-input {
    width: 150px;
    padding: 12px;
    margin-bottom: 20px;
    border: 1px solid #504945; /* Gruvbox bg2 */
    border-radius: 5px;
    background-color: #3c3836; /* Gruvbox bg1 */
    color: #ebdbb2;
    font-size: 1.5em;
    text-align: center;
    letter-spacing: 5px; /* So numbers are spaced out a bit */
}

#pin-input:focus {
    outline: none;
    border-color: #fabd2f;
    box-shadow: 0 0 8px rgba(250, 189, 47, 0.5);
}

#pin-submit-btn {
    background-color: #b16286; /* Gruvbox purple */
    color: #fbf1c7;
    border: none;
    padding: 12px 25px;
    cursor: pointer;
    border-radius: 5px;
    font-weight: bold;
    font-size: 1em;
    transition: background-color 0.3s ease;
    display: block; /* Make it block to center it easily or use flex on parent */
    margin: 0 auto; /* Center button */
}

#pin-submit-btn:hover {
    background-color: #d3869b; /* Lighter Gruvbox purple */
}

#pin-error {
    margin-top: 15px;
    min-height: 20px; /* Reserve space for error message */
}

/* App container styling to take full height after unlock */
#app-container {
    display: flex;
    height: 100vh;
    /* visibility is controlled by JS */
}

/* Ensure body styles are applied correctly after PIN overlay */
body {
    font-family: 'Consolas', 'Menlo', 'DejaVu Sans Mono', monospace;
    margin: 0;
    /* display: flex; This is now on #app-container */
    /* height: 100vh; This is now on #app-container */
    background-color: #282828; /* Gruvbox bg */
    color: #ebdbb2; /* Gruvbox fg */
}

.sidebar {
    width: 250px;
    background-color: #1d2021;
    padding: 20px;
    box-shadow: 3px 0 8px rgba(0,0,0,0.25);
    display: flex;
    flex-direction: column;
    border-right: 1px solid #3c3836;
    /* Adjusted transition for desktop */
    transition: width 0.3s ease-in-out, padding-left 0.3s ease-in-out, padding-right 0.3s ease-in-out, opacity 0.3s ease-in-out, border-right-width 0.3s ease-in-out;
    min-width: 250px; /* Base min-width for desktop when expanded */
    opacity: 1;
}

.sidebar.collapsed {
    /* Desktop collapsed state */
    width: 0;
    min-width: 0; /* Allow shrinking to zero */
    padding-left: 0;
    padding-right: 0;
    opacity: 0;
    overflow: hidden;
    border-right-width: 0;
}

.sidebar h2 {
    margin-top: 0;
    font-size: 1.4em;
    color: #fabd2f; /* Gruvbox bright yellow */
    text-align: center;
    margin-bottom: 20px;
}

#add-country-btn {
    background-color: #458588; /* Gruvbox blue */
    color: #ebdbb2;
    border: none;
    padding: 12px;
    margin-bottom: 20px;
    cursor: pointer;
    border-radius: 5px;
    text-align: center;
    font-weight: bold;
    transition: background-color 0.3s ease;
}

#add-country-btn:hover {
    background-color: #83a598; /* Gruvbox bright blue */
}

/* Menu Button and Dropdown Styles */
.menu-container {
    position: relative;
    display: inline-block;
    margin-left: auto; /* Push main menu to the far right */
}

#menu-toggle-btn, #sidebar-toggle-btn {
    background-color: #3c3836; /* Gruvbox bg1 */
    color: #fabd2f; /* Gruvbox bright yellow */
    border: 1px solid #504945; /* Gruvbox bg2 */
    padding: 8px 12px;
    cursor: pointer;
    border-radius: 5px;
    font-size: 1.2em; /* Consistent font size */
    transition: background-color 0.3s ease, color 0.3s ease;
}

#sidebar-toggle-btn {
    margin-right: 15px; /* Space between sidebar toggle and title */
}

#menu-toggle-btn:hover, #sidebar-toggle-btn:hover {
    background-color: #504945; /* Gruvbox bg2 */
    color: #fbf1c7; /* Gruvbox bright fg */
}

.dropdown-content {
    display: none; /* Hidden by default */
    position: absolute;
    right: 0;
    top: calc(100% + 5px); /* Position below the button with a small gap */
    background-color: #1d2021; /* Gruvbox bg0_h */
    min-width: 180px;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.3);
    z-index: 100;
    border-radius: 5px;
    padding: 8px 0;
    overflow: hidden; /* For animation */
    transform-origin: top right;
    animation: fadeInDown 0.3s ease-out forwards;
}

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

/* Keyframe animation for dropdown */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-10px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.dropdown-content button {
    background-color: transparent;
    color: #ebdbb2; /* Gruvbox fg */
    padding: 10px 16px;
    text-decoration: none;
    display: block;
    width: 100%;
    text-align: left;
    border: none;
    cursor: pointer;
    font-size: 0.95em;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.dropdown-content button:hover {
    background-color: #b16286; /* Gruvbox purple */
    color: #fbf1c7; /* Gruvbox bright fg */
}

/* Remove specific styling for export/import buttons if they were full width */
/* Or adjust if they are now in dropdown */
#export-data-btn,
#import-data-btn {
    /* background-color: #689d6a; Already handled by .dropdown-content button */
    /* color: #ebdbb2; */
    /* border: none; */
    /* padding: 10px; */ /* Handled by .dropdown-content button */
    margin-bottom: 0; /* Remove bottom margin if they are stacked in dropdown */
    /* cursor: pointer; */
    /* border-radius: 5px; */ /* Dropdown has its own radius */
    /* text-align: center; */ /* Now text-align: left from .dropdown-content button */
    /* font-weight: bold; */
    /* transition: background-color 0.3s ease; */
    width: 100%; /* Ensure they take full width of dropdown */
}

#country-list {
    list-style-type: none;
    padding: 0;
    margin: 0;
    overflow-y: auto;
    flex-grow: 1;
}

#country-list li {
    margin-bottom: 8px;
    display: flex; /* For aligning country name and buttons */
    align-items: center;
    justify-content: space-between; /* Puts buttons to the right */
    position: relative; /* For dropdown positioning */
    transition: none; /* Remove transition so clicks don't animate */
}

#country-list li a {
    flex-grow: 1; /* Allow link to take available space */
    padding: 10px 12px;
    text-decoration: none;
    color: #d5c4a1; /* Gruvbox fg (slightly dimmer) */
    border-radius: 4px;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    border-left: none; /* No left border */
    position: relative; /* For background pseudo-element */
}

/* Default background fill for all countries with theme colors */
#country-list li a.color-theme::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--country-color);
    opacity: 0.15; /* Very subtle background color */
    z-index: -1;
    border-radius: 4px;
    transition: opacity 0.3s ease;
}

/* Hover state for country items */
#country-list li a:hover::after {
    opacity: 0.25; /* Slightly more visible on hover */
}

#country-list li a:hover {
    background-color: transparent; /* Remove default background color */
    color: #fbf1c7; /* Gruvbox bright fg */
}

/* Active state for country items */
#country-list li a.active {
    background-color: transparent; /* Remove background color */
    color: #fbf1c7;
    font-weight: bold;
    position: relative;
    z-index: 1;
    border-left: none;
}

/* Background fill for active countries */
#country-list li a.active::after {
    opacity: 0.3; /* More visible when active */
}

/* Themed country styling with glow */
#country-list li a.active.color-theme {
    background-color: transparent; /* Remove the blend background */
}

/* Make each country's color styling more noticeable when active */
#country-list li a.color-theme {
    border-left: none;
}

#country-list li a:hover.color-theme {
    background-color: transparent; /* Remove the blend background */
    border-left: none;
}

/* Country Menu Button and Dropdown */
.country-menu-btn {
    background: none;
    border: none;
    color: #a89984; /* Gruvbox fg4 (dim) */
    cursor: pointer;
    padding: 5px;
    font-size: 1.2em;
    transition: transform 0.2s ease, color 0.2s ease;
}

.country-menu-btn:hover {
    color: #fabd2f; /* Gruvbox bright yellow */
    transform: scale(1.2);
}

.country-dropdown {
    position: absolute;
    right: 0;
    top: 100%;
    background-color: #32302f; /* Gruvbox bg0 */
    border: 1px solid #504945; /* Gruvbox bg2 */
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    z-index: 10;
    min-width: 120px;
    display: none;
    overflow: hidden;
    transform-origin: top right;
    animation: fadeInDown 0.2s ease forwards;
}

.country-dropdown.show {
    display: block;
}

.country-dropdown-option {
    display: block;
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    padding: 8px 12px;
    color: #ebdbb2; /* Gruvbox fg */
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.country-dropdown-option:hover {
    background-color: #504945; /* Gruvbox bg2 */
}

/* Country Buttons Container and Delete Button - can be removed or kept for reference */
/* 
.country-buttons {
    display: flex;
    gap: 5px;
}

.rename-country-btn,
.delete-country-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    font-size: 0.9em;
    transition: transform 0.2s ease, color 0.2s ease;
}

.rename-country-btn {
    color: #a89984;
}

.delete-country-btn {
    color: #cc241d;
}

.rename-country-btn:hover {
    color: #fabd2f;
    transform: scale(1.2);
}

.delete-country-btn:hover {
    color: #fb4934;
    transform: scale(1.2);
}
*/

.main-content {
    flex-grow: 1;
    padding: 25px;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    background-color: #282828; 
    transition: margin-left 0.3s ease-in-out;
}

.content-header {
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid #504945; /* Gruvbox bg2 */
    display: flex; /* Use flexbox */
    justify-content: space-between; /* Space between title and menu */
    align-items: center; /* Align items vertically */
}

.content-header h1 {
    margin: 0;
    color: #fe8019; /* Gruvbox bright orange */
    font-size: 1.8em;
    flex-grow: 1; /* Allow title to take space */
}

.notes-section {
    margin-bottom: 25px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.notes-section h3, .gallery-section h3 {
    color: #8ec07c; /* Gruvbox bright aqua */
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 1.2em;
}

.notes-section textarea {
    width: 100%;
    min-height: 250px;
    flex-grow: 1;
    padding: 15px;
    border: 1px solid #504945; /* Gruvbox bg2 */
    border-radius: 5px;
    box-sizing: border-box;
    resize: vertical;
    background-color: #3c3836; /* Gruvbox bg1 */
    color: #ebdbb2; /* Gruvbox fg */
    font-family: inherit;
    font-size: 1em;
}

.notes-section textarea:focus, #upload-controls button:focus {
    outline: none;
    border-color: #fabd2f; /* Gruvbox bright yellow */
    box-shadow: 0 0 5px rgba(250, 189, 47, 0.5);
}

.gallery-section {
    margin-bottom: 20px;
}

#image-gallery {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    border: 1px dashed #504945;
    padding: 15px;
    min-height: 120px;
    background-color: #32302f;
    border-radius: 6px;
    margin-bottom: 15px;
    align-content: flex-start;
    position: relative;
    transition: border-color 0.3s ease, transform 0.3s ease, background-color 0.3s ease;
}

#image-gallery:hover {
    border-color: #83a598; /* Gruvbox bright blue on hover */
}

#image-gallery.drag-over {
    border-color: #fabd2f; /* Bright Gruvbox yellow */
    background-color: rgba(250, 189, 47, 0.1); /* Subtle yellow background */
    transform: scale(1.01);
    box-shadow: 0 0 15px rgba(250, 189, 47, 0.3);
}

/* Enhanced gallery item styling */
.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 6px;
    margin: 5px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.gallery-item:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 5px 10px rgba(0,0,0,0.3);
    z-index: 2;
}

.gallery-item img {
    max-width: 120px;
    max-height: 120px;
    object-fit: cover;
    display: block;
    border-radius: 5px;
    transition: filter 0.3s ease;
}

.gallery-item:hover img {
    filter: brightness(1.1);
}

.delete-image-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    background-color: rgba(29, 32, 33, 0.7); /* Semi-transparent background */
    color: #fb4934; /* Gruvbox bright red */
    border: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 0.9em;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0; /* Hidden by default */
    transition: opacity 0.2s ease, background-color 0.2s ease;
}

.gallery-item:hover .delete-image-btn {
    opacity: 1; /* Show on hover */
}

.delete-image-btn:hover {
    background-color: rgba(251, 73, 52, 0.2); /* Transparent red background */
    color: #fb4934; /* Keep text color the same */
}

/* Visual cue for pasting when gallery is empty */
#image-gallery:empty::before {
    content: "Click here and paste images (Ctrl+V or Cmd+V) or use Upload button";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #a89984; /* Gruvbox fg4 (dim) */
    font-size: 0.9em;
    text-align: center;
    padding: 10px;
    pointer-events: none; /* So it doesn't interfere with paste or clicks */
}

#image-gallery div { /* Container for image and delete button */
    position: relative;
    transition: transform 0.2s ease-in-out;
}
#image-gallery div:hover {
    transform: scale(1.05);
}


#image-gallery img {
    width: 150px; /* Fixed width */
    height: 150px; /* Fixed height */
    border: 2px solid #665c54; /* Gruvbox bg3 */
    border-radius: 4px;
    object-fit: cover;
    cursor: pointer; /* Indicate it can be clicked/viewed larger (future feature) */
    transition: border-color 0.2s ease;
}
#image-gallery img:hover {
    border-color: #8ec07c; /* Gruvbox bright aqua */
}

#image-gallery .delete-image-btn { /* Style for the delete button on images */
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(204, 36, 29, 0.8); /* Gruvbox red with transparency */
    color: #fbf1c7;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    cursor: pointer;
    font-size: 14px;
    line-height: 24px;
    text-align: center;
    opacity: 0; /* Hidden by default */
    transition: opacity 0.2s ease, background-color 0.2s ease;
}

#image-gallery div:hover .delete-image-btn {
    opacity: 1; /* Show on hover of the container */
}

#image-gallery .delete-image-btn:hover {
    background: #fb4934; /* Gruvbox bright red */
}


#upload-controls button {
    background-color: #98971a; /* Gruvbox green */
    color: #282828; /* Dark text for contrast on green */
    border: none;
    padding: 12px 18px;
    cursor: pointer;
    border-radius: 5px;
    font-size: 1em;
    font-weight: bold;
    transition: background-color 0.3s ease;
}

#upload-controls button:hover {
    background-color: #b8bb26; /* Gruvbox bright green */
}

#upload-controls button:disabled,
#add-country-btn:disabled,
.notes-section textarea:disabled,
/* Add new disabled states here */
#link-url-input:disabled,
#link-name-input:disabled,
#add-link-btn:disabled,
#hotel-price-input:disabled,
#flight-price-input:disabled,
#package-price-input:disabled {
    background-color: #7c6f64 !important; /* Gruvbox grey */
    color: #3c3836 !important;
    cursor: not-allowed;
    border-color: #7c6f64 !important; /* Ensure border also reflects disabled state */
}


/* Hide the actual file input */
#image-upload {
    display: none;
}

/* Scrollbar styling for webkit browsers */
::-webkit-scrollbar {
    width: 10px;
}
::-webkit-scrollbar-track {
    background: #1d2021; /* Gruvbox bg0_h */
}
::-webkit-scrollbar-thumb {
    background: #665c54; /* Gruvbox bg3 */
    border-radius: 5px;
}
::-webkit-scrollbar-thumb:hover {
    background: #7c6f64; /* Gruvbox bg4 */
}


/* Basic responsiveness */
@media (max-width: 768px) {
    body {
        flex-direction: column;
        height: auto; /* Allow content to dictate height */
        min-height: 100vh;
    }

    #sidebar-toggle-btn {
        display: inline-block;
    }

    .sidebar-close-btn-inside {
        display: block; /* Visible on mobile */
    }

    .sidebar {
        position: fixed;
        height: 100%;
        z-index: 1000;
        left: 0;
        top: 0;
        transform: translateX(-100%); /* Start collapsed on mobile by default */
        transition: transform 0.3s ease-in-out, box-shadow 0.3s ease-in-out;
        width: 250px;
        min-width: 250px; 
        padding: 20px;
        opacity: 1;
        border-right-width: 1px;
        /* Add box-shadow when expanded on mobile */
        box-shadow: 3px 0 8px rgba(0,0,0,0.25);
    }

    .sidebar.collapsed {
        transform: translateX(-100%);
        box-shadow: none;
    }
    /* When sidebar is NOT collapsed (i.e., expanded) on mobile */
    .sidebar:not(.collapsed) {
        transform: translateX(0%);
    }

    .main-content {
        /* No margin-left adjustment needed if sidebar is overlaying */
        /* width: 100%; */
    }

    .content-header h1 {
        font-size: 1.3em; /* Adjust title size for smaller screens */
    }
    #menu-toggle-btn, #sidebar-toggle-btn {
        font-size: 1.1em; /* Slightly smaller buttons on mobile */
        padding: 6px 10px;
    }
}

/* Styling for the delete button on images, moved from script.js */
/* This will be referenced by class .delete-image-btn */

/* Links Section Styling */
.links-section {
    margin-top: 25px;
    margin-bottom: 25px;
}

.links-section h3, .prices-section h3 {
    color: #8ec07c; /* Gruvbox bright aqua - consistent with other section titles */
    margin-bottom: 10px;
    font-size: 1.2em;
    display: flex; /* To align button and text */
    align-items: center; /* To align button and text */
}

.section-toggle-btn {
    background: none;
    border: none;
    color: #8ec07c; /* Match h3 color */
    font-size: 1em; /* Adjust as needed, relative to h3 */
    cursor: pointer;
    padding: 0 8px 0 0; /* Space to the right of the icon */
    margin-right: 5px; /* Space between icon and title text */
    transition: transform 0.3s ease;
}

.section-toggle-btn.collapsed {
    transform: rotate(90deg);
}

.section-content {
    max-height: 1000px; /* Large enough for content, for transition */
    overflow: hidden;
    transition: max-height 0.4s ease-in-out, opacity 0.3s ease-in-out, margin-top 0.4s ease-in-out, margin-bottom 0.4s ease-in-out;
    opacity: 1;
    margin-top: 0;
    margin-bottom: 0; /* Adjust if sections have their own margin */
}

.section-content.collapsed {
    max-height: 0;
    opacity: 0;
    margin-top: 0 !important; /* Override any specific margins when collapsed */
    margin-bottom: 0 !important;
    /* visibility: hidden; Using max-height and opacity for transition */
}

#add-link-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    align-items: center;
    flex-wrap: wrap; /* Allow wrapping on smaller screens */
}

#add-link-controls input[type="text"] {
    flex-grow: 1;
    padding: 10px;
    border: 1px solid #504945; /* Gruvbox bg2 */
    border-radius: 4px;
    background-color: #3c3836; /* Gruvbox bg1 */
    color: #ebdbb2;
    font-family: inherit;
    min-width: 150px; /* Ensure minimum width */
}

#add-link-controls input[type="text"]:focus {
    outline: none;
    border-color: #fabd2f; /* Gruvbox bright yellow */
    box-shadow: 0 0 5px rgba(250, 189, 47, 0.5);
}

#add-link-controls button {
    background-color: #458588; /* Gruvbox blue */
    color: #ebdbb2;
    border: none;
    padding: 10px 15px;
    cursor: pointer;
    border-radius: 4px;
    font-weight: bold;
    transition: background-color 0.3s ease;
    white-space: nowrap; /* Prevent button text from wrapping */
}

#add-link-controls button:hover {
    background-color: #83a598; /* Gruvbox bright blue */
}

/* Mobile layout adjustments */
@media (max-width: 600px) {
    #add-link-controls {
        flex-direction: column;
        align-items: stretch;
    }

    #add-link-controls input[type="text"],
    #add-link-controls button {
        width: 100%;
        margin-bottom: 8px;
    }

    #add-link-controls button {
        padding: 12px; /* Larger touch target */
        font-size: 1.1em; /* Slightly larger text */
    }
}

#useful-links-list {
    list-style-type: none;
    padding: 0;
    margin: 0;
    max-height: 200px; /* Limit height and allow scroll */
    overflow-y: auto;
    border: 1px dashed #504945;
    padding: 10px;
    border-radius: 4px;
    background-color: #32302f; /* Darker variant of bg1 */
}

#useful-links-list li {
    padding: 8px 5px;
    border-bottom: 1px solid #504945; /* Gruvbox bg2 */
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.2s ease;
}

#useful-links-list li:last-child {
    border-bottom: none;
}

#useful-links-list li:hover {
    background-color: #3c3836; /* Gruvbox bg1 */
}

.link-content {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-grow: 1;
    overflow: hidden;
}

.link-favicon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    border-radius: 2px;
}

#useful-links-list li a {
    color: #83a598; /* Gruvbox bright blue for links */
    text-decoration: none;
    flex-grow: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#useful-links-list li a:hover {
    color: #b8bb26; /* Gruvbox bright green for link hover */
    text-decoration: underline;
}

#useful-links-list .delete-link-btn {
    background: none;
    border: none;
    color: #a89984; /* Gruvbox fg4 (dim) */
    cursor: pointer;
    padding: 3px 6px;
    margin-left: 10px;
    font-size: 0.9em;
    border-radius: 3px;
    transition: color 0.2s ease, background-color 0.2s ease;
}

#useful-links-list .delete-link-btn:hover {
    color: #fb4934; /* Gruvbox bright red */
    background-color: rgba(251, 73, 52, 0.1);
}

/* Prices Section Styling */
.prices-section {
    margin-top: 25px;

}

.price-input-group {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    gap: 10px;
}

.price-input-group label {
    flex-basis: 180px; /* Give labels a fixed basis */
    flex-shrink: 0; /* Prevent labels from shrinking */
    color: #d5c4a1; /* Gruvbox fg (slightly dimmer) */
    font-size: 0.95em;
}

.price-input-group input[type="text"] {
    flex-grow: 1;
    padding: 10px;
    border: 1px solid #504945; /* Gruvbox bg2 */
    border-radius: 4px;
    background-color: #3c3836; /* Gruvbox bg1 */
    color: #ebdbb2;
    font-family: inherit;
}
.price-input-group input[type="text"]:focus {
    outline: none;
    border-color: #fabd2f; /* Gruvbox bright yellow */
    box-shadow: 0 0 5px rgba(250, 189, 47, 0.5);
}

/* Fullscreen Image Modal Styling */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85); /* Darker overlay for focus */
    display: flex;
    flex-direction: column; /* To stack image and zoom controls */
    justify-content: center;
    align-items: center;
    z-index: 3000; /* Above PIN overlay if that was ever used simultaneously */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

.modal-close-btn {
    position: absolute;
    top: 20px;
    right: 35px;
    color: #fbf1c7; /* Gruvbox bright fg */
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.2s ease;
}

.modal-close-btn:hover {
    color: #fb4934; /* Gruvbox bright red */
}

.modal-content-wrapper {
    max-width: 90vw;
    max-height: 80vh; /* Leave space for zoom controls */
    display: flex; /* For centering image if it's smaller than wrapper */
    justify-content: center;
    align-items: center;
    overflow: hidden; /* Important for containing the zooming image */
    cursor: grab; /* Indicate it can be panned when zoomed */
}

.modal-content-wrapper.grabbing {
    cursor: grabbing;
}

#fullscreen-image-src {
    display: block;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain; /* Show entire image without cropping */
    transition: transform 0.2s ease-out; /* For zoom animation */
    transform-origin: center center; /* Zoom from center by default */
    /* User select none prevents image dragging issues when panning */
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

.zoom-controls {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(29, 32, 33, 0.8); /* Gruvbox bg0_h with transparency */
    padding: 8px 15px;
    border-radius: 20px;
    display: flex;
    gap: 10px;
}

.zoom-controls button {
    background-color: #458588; /* Gruvbox blue */
    color: #ebdbb2;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 1.2em;
    cursor: pointer;
    transition: background-color 0.2s ease;
    display: flex;
    justify-content: center;
    align-items: center;
}

.zoom-controls button:hover {
    background-color: #83a598; /* Gruvbox bright blue */
}

/* Close button inside the sidebar for mobile */
.sidebar-close-btn-inside {
    display: none; /* Hidden by default on desktop */
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    color: #fabd2f; /* Gruvbox bright yellow */
    font-size: 24px; /* Larger for touch */
    font-weight: bold;
    cursor: pointer;
    padding: 5px 10px;
    line-height: 1;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.sidebar-close-btn-inside:hover {
    background-color: rgba(250, 189, 47, 0.1);
}

/* Additional shit section styling */
.additional-section {
    margin-top: 25px;
    border-top: 1px solid #504945;
    padding-top: 20px;
}

.additional-section > h3 {
    color: #fe8019; /* Bright orange for main section header */
    margin-bottom: 15px;
    font-size: 1.3em;
}

/* Nested section headers */
.additional-section h4 {
    color: #8ec07c; /* Same color as original h3 sections */
    margin: 15px 0 10px;
    font-size: 1.1em;
    display: flex;
    align-items: center;
}

/* Adjust spacing in nested sections */
.gallery-section, .links-section, .prices-section {
    margin-bottom: 15px;
    margin-left: 15px; /* Indent nested sections */
}

/* Last section shouldn't have bottom margin */
.prices-section {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

/* Country Edit Modal with glowing border effect */
.country-edit-container {
    background-color: #1d2021; /* Gruvbox bg0_h */
    border-radius: 8px;
    box-shadow: 0 5px 25px rgba(0,0,0,0.6);
    padding: 25px;
    max-width: 500px;
    width: 90%;
    position: relative;
}

/* Glowing border effect for country edit modal */
.country-edit-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 2px solid #98971a; /* Gruvbox green */
    border-radius: 8px;
    box-sizing: border-box;
    pointer-events: none;
    z-index: 1;
    animation: 
        drawGreenBorder 0.5s linear forwards, 
        glowGreenPulse 2s ease-in-out infinite 0.5s;
}

@keyframes drawGreenBorder {
    0% {
        box-shadow: 0 0 0 0 rgba(152, 151, 26, 0);
        clip-path: polygon(0 0, 0 0, 0 0, 0 0);
        opacity: 0;
    }
    25% {
        clip-path: polygon(0 0, 100% 0, 100% 0, 0 0);
        opacity: 1;
    }
    50% {
        clip-path: polygon(0 0, 100% 0, 100% 100%, 0 0);
        opacity: 1;
    }
    75% {
        clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
        opacity: 1;
    }
    100% {
        box-shadow: 0 0 15px 2px rgba(152, 151, 26, 0.3);
        clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
        opacity: 1;
    }
}

@keyframes glowGreenPulse {
    0% {
        box-shadow: 0 0 15px 2px rgba(152, 151, 26, 0.3);
    }
    50% {
        box-shadow: 0 0 20px 3px rgba(152, 151, 26, 0.5);
    }
    100% {
        box-shadow: 0 0 15px 2px rgba(152, 151, 26, 0.3);
    }
}

.country-edit-container h2 {
    color: #fabd2f; /* Gruvbox bright yellow */
    margin-top: 0;
    margin-bottom: 20px;
    text-align: center;
}

.country-edit-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.form-group label {
    color: #ebdbb2; /* Gruvbox fg */
    font-weight: bold;
}

#country-name-input {
    padding: 10px;
    border: 1px solid #504945; /* Gruvbox bg2 */
    border-radius: 4px;
    background-color: #3c3836; /* Gruvbox bg1 */
    color: #ebdbb2;
    font-size: 1em;
}

#country-name-input:focus {
    outline: none;
    border-color: #fabd2f; /* Gruvbox bright yellow */
    box-shadow: 0 0 5px rgba(250, 189, 47, 0.5);
}

.emoji-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 10px;
    max-height: 200px;
    overflow-y: auto;
    padding: 10px;
    border: 1px solid #504945;
    border-radius: 4px;
    background-color: #32302f;
}

.emoji-flag {
    font-size: 1.8em;
    cursor: pointer;
    text-align: center;
    padding: 8px;
    border-radius: 4px;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.emoji-flag:hover {
    background-color: #504945;
    transform: scale(1.1);
}

.emoji-flag.selected {
    background-color: #b16286; /* Gruvbox purple */
    transform: scale(1.1);
}

.selected-flag-container {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #ebdbb2;
}

.selected-flag {
    font-size: 2em;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    margin-top: 10px;
}

.form-actions button {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.3s ease;
}

#country-edit-cancel {
    background-color: #504945; /* Gruvbox bg2 */
    color: #ebdbb2;
}

#country-edit-save {
    background-color: #b16286; /* Gruvbox purple */
    color: #fbf1c7;
}

#country-edit-cancel:hover {
    background-color: #665c54; /* Gruvbox bg3 */
}

#country-edit-save:hover {
    background-color: #d3869b; /* Lighter Gruvbox purple */
}

/* Flag Search Styling */
.flag-search-container {
    display: flex;
    margin-bottom: 10px;
    position: relative;
}

#flag-search-input {
    flex-grow: 1;
    padding: 10px;
    padding-right: 30px; /* Space for the clear button */
    border: 1px solid #504945;
    border-radius: 4px;
    background-color: #3c3836;
    color: #ebdbb2;
    font-size: 0.9em;
}

#flag-search-input:focus {
    outline: none;
    border-color: #fabd2f;
    box-shadow: 0 0 5px rgba(250, 189, 47, 0.5);
}

#flag-search-clear {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #a89984;
    cursor: pointer;
    font-size: 0.9em;
    display: none; /* Hide by default, show when input has value */
}

#flag-search-clear:hover {
    color: #fb4934;
}

/* Country name in the header */
#current-country-name.color-theme {
    color: var(--country-color);
}

/* Sidebar watermark at bottom */
.sidebar-watermark {
    margin-top: auto;
    padding-top: 15px;
    border-top: 1px solid #3c3836;
    display: flex;
    align-items: center;
    gap: 10px;
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.sidebar-watermark:hover {
    opacity: 1;
}

.watermark-logo {
    width: 24px;
    height: auto;
    border-radius: 3px;
}

.sidebar-watermark span,
.mobile-watermark span {
    font-size: 0.9em;
    color: #a89984;
    font-weight: 500;
}

.sidebar-watermark:hover,
.mobile-watermark:hover {
    opacity: 1;
}

/* Mobile watermark (hidden by default on desktop) */
.mobile-watermark {
    display: none;
}

/* Mobile adjustments */
@media (max-width: 768px) {
    /* Hide sidebar watermark on mobile */
    .sidebar-watermark {
        display: none;
    }
    
    /* Show mobile watermark instead */
    .mobile-watermark {
        display: flex;
        position: fixed;
        bottom: 15px;
        right: 15px; /* Changed from left to right */
        background-color: rgba(29, 32, 33, 0.85);
        padding: 8px;
        border-radius: 50%; /* Circular background */
        box-shadow: 0 2px 5px rgba(0,0,0,0.3);
        z-index: 999;
        opacity: 0.5;
        align-items: center;
        justify-content: center;
        transition: opacity 0.3s ease, transform 0.3s ease;
    }
    
    .mobile-watermark:hover {
        opacity: 0.8;
        transform: scale(1.1);
    }
    
    /* Hide the text on mobile */
    .mobile-watermark span {
        display: none;
    }
    
    /* Make the logo slightly larger on mobile */
    .mobile-watermark .watermark-logo {
        width: 32px;
        height: 32px;
    }
}

/* Success overlay for correct PIN */
#success-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #8ec07c; /* Softer Gruvbox bright aqua/green */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 3000; /* Above PIN overlay */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.8s ease, visibility 0.8s ease;
    overflow: hidden; /* Prevent logo from overflowing during animation */
}

#success-overlay.active {
    opacity: 1;
    visibility: visible;
}

#success-overlay.fade-out {
    opacity: 0;
    visibility: hidden;
}

#success-logo {
    width: 120px;
    height: auto; /* Maintain aspect ratio */
    object-fit: contain; /* Ensure it doesn't stretch */
    border-radius: 10px;
    animation: crazyLogo 0.5s ease-in-out;
    margin-bottom: 20px;
    position: relative;
    z-index: 2;
}

#success-text {
    font-family: 'Consolas', 'Menlo', 'DejaVu Sans Mono', monospace;
    color: #282828; /* Dark text for contrast on green */
    font-size: 1.5em;
    text-align: center;
    animation: bounce 0.5s ease-in-out 0.1s;
    animation-fill-mode: both;
    font-weight: 500;
    text-shadow: 2px 2px 0 rgba(0,0,0,0.1);
}

/* Crazy confetti animation in background */
#success-overlay::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(circle, transparent 20%, transparent 20%),
        radial-gradient(circle, #fabd2f 10%, transparent 10%),
        radial-gradient(circle, #fb4934 15%, transparent 15%),
        radial-gradient(circle, #b8bb26 12%, transparent 12%),
        radial-gradient(circle, #d3869b 18%, transparent 18%);
    background-position: 0 0, 50px 50px, 100px 100px, 150px 150px, 200px 200px;
    background-size: 250px 250px;
    opacity: 0.4;
    animation: bgMove 3s linear infinite;
    z-index: 1;
}

/* Crazy spinning logo animation */
@keyframes crazyLogo {
    0% {
        transform: rotate(0deg) scale(0.1);
        opacity: 0;
    }
    25% {
        transform: rotate(180deg) scale(1.5);
    }
    50% {
        transform: rotate(360deg) scale(0.8);
    }
    75% {
        transform: rotate(540deg) scale(1.2);
    }
    100% {
        transform: rotate(720deg) scale(1);
        opacity: 1;
    }
}

/* Text bounce animation */
@keyframes bounce {
    0% {
        transform: translateY(50px);
        opacity: 0;
    }
    60% {
        transform: translateY(-20px);
        opacity: 1;
    }
    80% {
        transform: translateY(10px);
    }
    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Background pattern movement */
@keyframes bgMove {
    0% {
        background-position: 0 0, 50px 50px, 100px 100px, 150px 150px, 200px 200px;
    }
    100% {
        background-position: 250px 250px, 300px 300px, 350px 350px, 400px 400px, 450px 450px;
    }
}

/* Toast notification styling */
.toast-notification {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background-color: #1d2021; /* Gruvbox bg0_h */
    color: #ebdbb2;
    padding: 12px 15px;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 1500;
    max-width: 90%;
    min-width: 280px;
    opacity: 0;
    transition: transform 0.4s ease, opacity 0.4s ease;
    border-left: 4px solid #b8bb26; /* Gruvbox bright green */
}

.toast-notification.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.toast-icon {
    font-size: 1.5rem;
    color: #b8bb26; /* Gruvbox bright green */
    flex-shrink: 0;
}

.toast-content {
    flex-grow: 1;
    min-width: 0; /* Allow text to truncate if needed */
}

.toast-title {
    font-weight: bold;
    margin-bottom: 3px;
    color: #fabd2f; /* Gruvbox bright yellow */
}

.toast-message {
    font-size: 0.9rem;
    white-space: normal;
    overflow: hidden;
    line-height: 1.3;
}

.toast-close {
    background: none;
    border: none;
    color: #a89984; /* Gruvbox fg4 (dim) */
    cursor: pointer;
    font-size: 1rem;
    padding: 5px;
    transition: color 0.2s ease;
    flex-shrink: 0;
}

.toast-close:hover {
    color: #fb4934; /* Gruvbox bright red */
}

/* Media query for small screens */
@media (max-width: 480px) {
    .toast-notification {
        min-width: auto;
        width: 90%;
    }
}

/* Calendar Button Container and Label */
.calendar-button-container {
    margin-top: 15px;
    margin-bottom: 15px;
    padding: 5px;
    border-top: 1px solid #3c3836;
    border-bottom: 1px solid #3c3836;
}

.calendar-toggle-btn {
    display: flex;
    align-items: center;
    background-color: #3c3836; /* Gruvbox bg1 */
    color: #ebdbb2; /* Gruvbox fg */
    border: none;
    border-radius: 6px;
    padding: 10px 15px;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
    width: 100%;
    justify-content: flex-start;
    gap: 10px;
}

.calendar-toggle-btn:hover {
    background-color: #504945; /* Gruvbox bg2 */
    transform: translateY(-2px);
}

.calendar-toggle-btn:active {
    transform: translateY(0px);
}

.calendar-icon {
    font-size: 1.3em;
    color: #fabd2f; /* Gruvbox bright yellow */
}

.calendar-button-label {
    color: #d5c4a1; /* Gruvbox fg (slightly dimmer) */
    font-size: 0.95em;
    font-weight: 500;
}

/* Count container for days and nights */
.count-container {
    display: flex;
    justify-content: space-around;
    margin: 5px 0;
}

#days-count, #nights-count {
    font-size: 1em;
    text-align: center;
    padding: 5px 10px;
    border-radius: 4px;
}

#days-count {
    color: #fabd2f; /* Gruvbox bright yellow */
    font-weight: bold;
    background-color: rgba(250, 189, 47, 0.1); /* Subtle yellow background */
}

#nights-count {
    color: #83a598; /* Gruvbox bright blue */
    font-weight: bold;
    background-color: rgba(131, 165, 152, 0.1); /* Subtle blue background */
}

/* Calendar Modal */
.calendar-container {
    background-color: #1d2021; /* Gruvbox bg0_h */
    border-radius: 10px;
    box-shadow: 0 5px 25px rgba(0,0,0,0.6);
    padding: 25px;
    max-width: 400px;
    width: 90%;
    position: relative;
    user-select: none; /* Prevent text selection */
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.calendar-container h2 {
    color: #fabd2f; /* Gruvbox bright yellow */
    margin-top: 0;
    margin-bottom: 20px;
    text-align: center;
}

.calendar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 15px;
}

.calendar-header button {
    background-color: #504945; /* Gruvbox bg2 */
    color: #ebdbb2;
    border: none;
    border-radius: 4px;
    width: 30px;
    height: 30px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.calendar-header button:hover {
    background-color: #665c54; /* Gruvbox bg3 */
}

#current-month {
    font-size: 1.2em;
    color: #83a598; /* Gruvbox bright blue */
    font-weight: bold;
}

.weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 5px;
    margin-bottom: 10px;
}

.weekdays div {
    text-align: center;
    padding: 5px;
    font-weight: bold;
    color: #d79921; /* Gruvbox yellow */
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 5px;
}

.calendar-day {
    text-align: center;
    padding: 8px;
    border-radius: 4px;
    cursor: default;
    transition: background-color 0.2s ease;
}

.calendar-day.other-month {
    color: #665c54; /* Gruvbox bg3 - dimmed for days from other months */
}

.calendar-day.today {
    background-color: #b16286; /* Gruvbox purple */
    color: #fbf1c7; /* Gruvbox bright fg */
    font-weight: bold;
}

.calendar-day:hover:not(.empty-day) {
    background-color: #504945; /* Gruvbox bg2 */
}

.today-display {
    margin-top: 20px;
    text-align: center;
    padding: 10px;
    background-color: #32302f; /* Gruvbox bg0 */
    border-radius: 4px;
}

#today-date {
    color: #8ec07c; /* Gruvbox bright aqua */
    font-weight: bold;
}

/* Calendar day selection styles */
.calendar-day.selected {
    background-color: #98971a; /* Gruvbox green */
    color: #fbf1c7; /* Gruvbox bright fg */
}

.calendar-day.selection-start {
    background-color: #d79921; /* Gruvbox yellow */
    color: #1d2021; /* Gruvbox bg0_h */
    font-weight: bold;
}

.calendar-day.selection-end {
    background-color: #d79921; /* Gruvbox yellow */
    color: #1d2021; /* Gruvbox bg0_h */
    font-weight: bold;
}

.calendar-day.other-month.selected {
    background-color: #79740e; /* Darker Gruvbox green */
    color: #d5c4a1; /* Gruvbox fg (slightly dimmer) */
}

/* Selection info section */
.selection-info {
    margin-top: 15px;
    padding: 10px;
    background-color: #32302f; /* Gruvbox bg0 */
    border-radius: 4px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

#selected-range {
    font-size: 0.9em;
    color: #ebdbb2; /* Gruvbox fg */
    text-align: center;
}

#days-count {
    font-size: 1em;
    color: #fabd2f; /* Gruvbox bright yellow */
    font-weight: bold;
    text-align: center;
}

#copy-dates-btn {
    background-color: #458588; /* Gruvbox blue */
    color: #ebdbb2; /* Gruvbox fg */
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.3s ease, opacity 0.3s ease;
    margin-top: 5px;
}

#copy-dates-btn:hover:not(:disabled) {
    background-color: #83a598; /* Gruvbox bright blue */
}

#copy-dates-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.remember-me-container {
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.remember-me-container input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid #504945;
    border-radius: 3px;
    background-color: #3c3836;
    cursor: pointer;
    position: relative;
    vertical-align: middle;
}

.remember-me-container input[type="checkbox"]:checked {
    background-color: #b16286; /* Gruvbox purple */
    border-color: #b16286;
}

.remember-me-container input[type="checkbox"]:checked::after {
    content: '✓';
    position: absolute;
    color: #fbf1c7; /* Gruvbox bright fg */
    font-size: 14px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.remember-me-container label {
    color: #d5c4a1; /* Gruvbox fg (slightly dimmer) */
    font-size: 0.9em;
    cursor: pointer;
}

/* New Country Toast Notification */
.new-country-toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background-color: #1d2021; /* Gruvbox bg0_h */
    color: #ebdbb2;
    padding: 12px 15px;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 1500;
    max-width: 90%;
    min-width: 280px;
    opacity: 0;
    transition: transform 0.4s ease, opacity 0.4s ease;
    border-left: 4px solid #b8bb26; /* Gruvbox bright green */
}

.new-country-toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.new-country-toast .toast-icon {
    font-size: 1.5rem;
    color: #b8bb26; /* Gruvbox bright green */
    flex-shrink: 0;
}

.new-country-toast .toast-content {
    flex-grow: 1;
    min-width: 0; /* Allow text to truncate if needed */
}

.new-country-toast .toast-title {
    font-weight: bold;
    margin-bottom: 3px;
    color: #fabd2f; /* Gruvbox bright yellow */
}

.new-country-toast .toast-message {
    font-size: 0.9rem;
    white-space: normal;
    overflow: hidden;
    line-height: 1.3;
}

.new-country-toast .toast-close {
    background: none;
    border: none;
    color: #a89984; /* Gruvbox fg4 (dim) */
    cursor: pointer;
    font-size: 1rem;
    padding: 5px;
    transition: color 0.2s ease;
    flex-shrink: 0;
}

.new-country-toast .toast-close:hover {
    color: #fb4934; /* Gruvbox bright red */
}

/* Fancy border drawing and glow animation for active country */
@keyframes drawBorder {
    0% {
        box-shadow: 0 0 0 0 rgba(251, 241, 199, 0);
        clip-path: polygon(0 0, 0 0, 0 0, 0 0);
        opacity: 0;
    }
    25% {
        clip-path: polygon(0 0, 100% 0, 100% 0, 0 0);
        opacity: 1;
    }
    50% {
        clip-path: polygon(0 0, 100% 0, 100% 100%, 0 0);
        opacity: 1;
    }
    75% {
        clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
        opacity: 1;
    }
    100% {
        box-shadow: 0 0 15px 2px rgba(251, 241, 199, 0.3);
        clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
        opacity: 1;
    }
}

@keyframes glowPulse {
    0% {
        box-shadow: 0 0 15px 2px rgba(251, 241, 199, 0.3);
        opacity: 1;
    }
    50% {
        box-shadow: 0 0 20px 3px rgba(251, 241, 199, 0.5);
        opacity: 1;
    }
    100% {
        box-shadow: 0 0 15px 2px rgba(251, 241, 199, 0.3);
        opacity: 1;
    }
}

@keyframes fadeOutBorder {
    0% {
        opacity: 1;
    }
    100% {
        opacity: 0;
    }
}

#country-list li a.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 2px solid #fbf1c7; /* Gruvbox bright fg */
    border-radius: 4px;
    box-sizing: border-box;
    animation: 
        drawBorder 0.5s linear forwards, 
        glowPulse 2s ease-in-out 0.5s,
        fadeOutBorder 1s ease-in-out 3.5s forwards; /* Fade out after 3.5s */
    pointer-events: none; /* Don't interfere with clicks */
    z-index: 1;
}

/* Themed country styling with glow */
#country-list li a.active.color-theme::before {
    border-color: var(--country-color);
    animation: 
        drawBorder 0.5s linear forwards, 
        glowPulse 2s ease-in-out 0.5s,
        fadeOutBorder 1s ease-in-out 3.5s forwards; /* Fade out after 3.5s */
}

/* Search filter container */
.search-filter-container {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    position: relative;
}

.search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #a89984; /* Gruvbox fg4 (dim) */
    font-size: 0.9em;
    pointer-events: none; /* Allow clicks to pass through to the input */
    opacity: 0.7;
}

#country-search {
    flex-grow: 1;
    padding: 12px;
    padding-left: 35px; /* Space for the search icon */
    padding-right: 35px; /* Space for the clear button */
    border: 1px solid #504945; /* Gruvbox bg2 */
    border-radius: 5px;
    background-color: #3c3836; /* Gruvbox bg1 */
    color: #ebdbb2; /* Gruvbox fg */
    font-size: 1em;
    font-family: inherit;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

#country-search:focus {
    outline: none;
    border-color: #fabd2f; /* Gruvbox bright yellow */
    box-shadow: 0 0 5px rgba(250, 189, 47, 0.3);
}

#country-search::placeholder {
    color: #a89984; /* Gruvbox fg4 (dim) */
    opacity: 0.7;
}

.clear-search-btn {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #a89984; /* Gruvbox fg4 (dim) */
    font-size: 0.9em;
    font-weight: bold;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s ease, background-color 0.2s ease;
    pointer-events: none;
}

.clear-search-btn.visible {
    opacity: 1;
    pointer-events: auto;
}

.clear-search-btn:hover {
    background-color: rgba(251, 73, 52, 0.2); /* Transparent red */
    color: #fb4934; /* Gruvbox bright red */
}

/* Hide country items that don't match search */
#country-list li.filtered-out {
    display: none;
    animation: fadeOut 0.3s ease-out forwards;
    height: 0;
    opacity: 0;
    margin: 0;
    padding: 0;
    overflow: hidden;
    pointer-events: none;
}

/* Cascading fade animation for country list filtering */
@keyframes fadeOut {
    0% {
        opacity: 1;
        transform: translateY(0) scale(1);
        height: auto;
        margin-bottom: 8px;
    }
    100% {
        opacity: 0;
        transform: translateY(-15px) scale(0.95);
        height: 0;
        margin-bottom: 0;
        padding: 0;
    }
}

/* Filtered-in animation for visible countries (during search only) */
#country-list li.filtered-in {
    animation: fadeIn 0.4s ease-out forwards;
    opacity: 1;
    height: auto;
}

@keyframes fadeIn {
    0% {
        opacity: 0;
        transform: translateY(15px) scale(0.95);
    }
    60% {
        transform: translateY(-5px) scale(1.02);
    }
    80% {
        transform: translateY(2px) scale(1);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* No results message */
#no-results-message {
    color: #a89984; /* Gruvbox fg4 (dim) */
    text-align: center;
    padding: 15px;
    font-style: italic;
    display: none;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

#no-results-message.visible {
    display: block;
    opacity: 1;
    transform: translateY(0);
    animation: fadeInMessage 0.5s ease-out forwards;
}

@keyframes fadeInMessage {
    0% {
        opacity: 0;
        transform: translateY(10px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Remove animations from default list items */
#country-list li {
    transition: none; /* Remove transition so clicks don't animate */
}

/* Keep animation for search filtering only */
#country-list li.filtered-out, 
#country-list li.filtered-in {
    transition: opacity 0.3s ease, transform 0.3s ease; /* Re-enable transitions for filtering */
}

/* Toolbar toggle button */
.toolbar-toggle-btn {
    background: none;
    border: none;
    color: #928374; /* Gruvbox dimmed foreground for subtlety */
    font-size: 0.8em;
    cursor: pointer;
    padding: 0 4px;
    margin-left: 6px;
    transition: transform 0.2s ease, color 0.2s ease;
    opacity: 0.7;
    vertical-align: middle;
}

.toolbar-toggle-btn:hover {
    color: #8ec07c; /* Gruvbox bright aqua */
    opacity: 1;
}

.toolbar-toggle-btn.collapsed {
    transform: rotate(-90deg);
}

/* Rich Text Editor Styles */
.rich-text-toolbar {
    display: flex;
    gap: 4px;
    margin-bottom: 8px;
    padding: 5px;
    background-color: #32302f; /* Gruvbox bg0 */
    border-radius: 4px 4px 0 0;
    border: 1px solid #504945; /* Gruvbox bg2 */
    border-bottom: none;
    transition: max-height 0.3s ease, opacity 0.3s ease, transform 0.3s ease, margin 0.3s ease;
    transform-origin: top;
    overflow: hidden;
    max-height: 40px;
    opacity: 1;
}

.rich-text-toolbar.collapsed {
    max-height: 0;
    opacity: 0;
    margin: 0;
    padding-top: 0;
    padding-bottom: 0;
    border: none;
}

.format-btn {
    background-color: #3c3836; /* Gruvbox bg1 */
    color: #ebdbb2; /* Gruvbox fg */
    border: 1px solid #504945; /* Gruvbox bg2 */
    border-radius: 3px;
    height: 30px;
    width: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
}

.format-btn:hover {
    background-color: #504945; /* Gruvbox bg2 */
}

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

.format-btn.active {
    background-color: #83a598; /* Gruvbox bright blue */
    color: #282828; /* Gruvbox bg */
}

.toolbar-divider {
    width: 1px;
    background-color: #504945; /* Gruvbox bg2 */
    margin: 0 4px;
}

/* Adjust notes border radius when toolbar is collapsed */
.rich-text-toolbar.collapsed + .rich-text-editor {
    border-radius: 5px;
}

.rich-text-editor {
    min-height: 250px;
    padding: 15px;
    border: 1px solid #504945; /* Gruvbox bg2 */
    border-radius: 0 0 5px 5px;
    background-color: #3c3836; /* Gruvbox bg1 */
    color: #ebdbb2; /* Gruvbox fg */
    font-family: inherit;
    font-size: 1em;
    line-height: 1.4;
    overflow-y: auto;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.rich-text-editor:focus {
    outline: none;
    border-color: #fabd2f; /* Gruvbox bright yellow */
    box-shadow: 0 0 5px rgba(250, 189, 47, 0.5);
}

.rich-text-editor:empty:before {
    content: attr(placeholder);
    color: #928374; /* Gruvbox fg4 */
    pointer-events: none;
}

.rich-text-editor[contenteditable="false"] {
    background-color: #7c6f64 !important; /* Gruvbox grey */
    color: #3c3836 !important;
    cursor: not-allowed;
}

.rich-text-toolbar:has(+ .rich-text-editor[contenteditable="false"]) .format-btn {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Update references from textarea to rich-text-editor */
.notes-section .rich-text-editor {
    width: 100%;
    flex-grow: 1;
    box-sizing: border-box;
    resize: vertical;
}

/* Handle draggable images in rich text editor */
.rich-text-editor img {
    max-width: 100%;
    height: auto;
    margin: 5px;
    cursor: move;
    border: 2px solid transparent;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.rich-text-editor img:hover {
    border-color: #83a598; /* Gruvbox bright blue */
    box-shadow: 0 0 8px rgba(131, 165, 152, 0.4);
}

.rich-text-editor img.dragging {
    opacity: 0.7;
    border-color: #fe8019; /* Gruvbox bright orange */
    box-shadow: 0 0 12px rgba(254, 128, 25, 0.6);
}

/* Save button and status styles */
.save-status-container {
    display: flex;
    align-items: center;
    margin-right: 15px;
}

#manual-save-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    padding: 5px;
    margin-right: 5px;
    border-radius: 4px;
    transition: background-color 0.3s, transform 0.2s;
}

#manual-save-btn:hover {
    background-color: rgba(146, 131, 116, 0.2);
}

#manual-save-btn:active {
    transform: scale(0.92);
}

#manual-save-btn.has-unsaved {
    animation: pulse 2s infinite;
    position: relative;
}

#last-saved-info {
    font-size: 0.75rem;
    color: #a89984;
    opacity: 0.8;
    transition: opacity 0.3s, color 0.3s;
}

#last-saved-info.highlight {
    color: #b8bb26;
    opacity: 1;
    animation: fadeHighlight 2s;
}

/* Unsaved country indicator */
#country-list li.unsaved a::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background-color: #fe8019;
    border-radius: 0 2px 2px 0;
    opacity: 0;
    animation: appearFromLeft 0.3s forwards;
}

/* Animations */
@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(254, 128, 25, 0.4);
    }
    70% {
        box-shadow: 0 0 0 6px rgba(254, 128, 25, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(254, 128, 25, 0);
    }
}

@keyframes fadeHighlight {
    0% {
        background-color: rgba(184, 187, 38, 0.2);
    }
    100% {
        background-color: transparent;
    }
}

@keyframes appearFromLeft {
    from {
        opacity: 0;
        transform: translateX(-100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Additional Features Section - Modern Menu Style */
.additional-section {
    margin-top: 25px;
    border-top: 1px solid #504945;
    padding-top: 20px;
}

.additional-section > h3 {
    color: #fe8019; /* Bright orange for main section header */
    margin-bottom: 15px;
    font-size: 1.3em;
}

/* Nested section headers */
.additional-section h4 {
    color: #8ec07c; /* Same color as original h3 sections */
    margin: 15px 0 10px;
    font-size: 1.1em;
    display: flex;
    align-items: center;
}

/* Adjust spacing in nested sections */
.gallery-section, .links-section, .prices-section {
    margin-bottom: 15px;
    margin-left: 15px; /* Indent nested sections */
}

/* Last section shouldn't have bottom margin */
.prices-section {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

/* Country Edit Modal with glowing border effect */
.country-edit-container {
    background-color: #1d2021; /* Gruvbox bg0_h */
    border-radius: 8px;
    box-shadow: 0 5px 25px rgba(0,0,0,0.6);
    padding: 25px;
    max-width: 500px;
    width: 90%;
    position: relative;
}

/* Glowing border effect for country edit modal */
.country-edit-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 2px solid #98971a; /* Gruvbox green */
    border-radius: 8px;
    box-sizing: border-box;
    pointer-events: none;
    z-index: 1;
    animation: 
        drawGreenBorder 0.5s linear forwards, 
        glowGreenPulse 2s ease-in-out infinite 0.5s;
}

@keyframes drawGreenBorder {
    0% {
        box-shadow: 0 0 0 0 rgba(152, 151, 26, 0);
        clip-path: polygon(0 0, 0 0, 0 0, 0 0);
        opacity: 0;
    }
    25% {
        clip-path: polygon(0 0, 100% 0, 100% 0, 0 0);
        opacity: 1;
    }
    50% {
        clip-path: polygon(0 0, 100% 0, 100% 100%, 0 0);
        opacity: 1;
    }
    75% {
        clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
        opacity: 1;
    }
    100% {
        box-shadow: 0 0 15px 2px rgba(152, 151, 26, 0.3);
        clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
        opacity: 1;
    }
}

@keyframes glowGreenPulse {
    0% {
        box-shadow: 0 0 15px 2px rgba(152, 151, 26, 0.3);
    }
    50% {
        box-shadow: 0 0 20px 3px rgba(152, 151, 26, 0.5);
    }
    100% {
        box-shadow: 0 0 15px 2px rgba(152, 151, 26, 0.3);
    }
}

.country-edit-container h2 {
    color: #fabd2f; /* Gruvbox bright yellow */
    margin-top: 0;
    margin-bottom: 20px;
    text-align: center;
}

.country-edit-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.form-group label {
    color: #ebdbb2; /* Gruvbox fg */
    font-weight: bold;
}

#country-name-input {
    padding: 10px;
    border: 1px solid #504945; /* Gruvbox bg2 */
    border-radius: 4px;
    background-color: #3c3836; /* Gruvbox bg1 */
    color: #ebdbb2;
    font-size: 1em;
}

#country-name-input:focus {
    outline: none;
    border-color: #fabd2f; /* Gruvbox bright yellow */
    box-shadow: 0 0 5px rgba(250, 189, 47, 0.5);
}

.emoji-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 10px;
    max-height: 200px;
    overflow-y: auto;
    padding: 10px;
    border: 1px solid #504945;
    border-radius: 4px;
    background-color: #32302f;
}

.emoji-flag {
    font-size: 1.8em;
    cursor: pointer;
    text-align: center;
    padding: 8px;
    border-radius: 4px;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.emoji-flag:hover {
    background-color: #504945;
    transform: scale(1.1);
}

.emoji-flag.selected {
    background-color: #b16286; /* Gruvbox purple */
    transform: scale(1.1);
}

.selected-flag-container {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #ebdbb2;
}

.selected-flag {
    font-size: 2em;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    margin-top: 10px;
}

.form-actions button {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.3s ease;
}

#country-edit-cancel {
    background-color: #504945; /* Gruvbox bg2 */
    color: #ebdbb2;
}

#country-edit-save {
    background-color: #b16286; /* Gruvbox purple */
    color: #fbf1c7;
}

#country-edit-cancel:hover {
    background-color: #665c54; /* Gruvbox bg3 */
}

#country-edit-save:hover {
    background-color: #d3869b; /* Lighter Gruvbox purple */
}

/* Flag Search Styling */
.flag-search-container {
    display: flex;
    margin-bottom: 10px;
    position: relative;
}

#flag-search-input {
    flex-grow: 1;
    padding: 10px;
    padding-right: 30px; /* Space for the clear button */
    border: 1px solid #504945;
    border-radius: 4px;
    background-color: #3c3836;
    color: #ebdbb2;
    font-size: 0.9em;
}

#flag-search-input:focus {
    outline: none;
    border-color: #fabd2f;
    box-shadow: 0 0 5px rgba(250, 189, 47, 0.5);
}

#flag-search-clear {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #a89984;
    cursor: pointer;
    font-size: 0.9em;
    display: none; /* Hide by default, show when input has value */
}

#flag-search-clear:hover {
    color: #fb4934;
}

/* Country name in the header */
#current-country-name.color-theme {
    color: var(--country-color);
}

/* Sidebar watermark at bottom */
.sidebar-watermark {
    margin-top: auto;
    padding-top: 15px;
    border-top: 1px solid #3c3836;
    display: flex;
    align-items: center;
    gap: 10px;
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.sidebar-watermark:hover {
    opacity: 1;
}

.watermark-logo {
    width: 24px;
    height: auto;
    border-radius: 3px;
}

.sidebar-watermark span,
.mobile-watermark span {
    font-size: 0.9em;
    color: #a89984;
    font-weight: 500;
}

.sidebar-watermark:hover,
.mobile-watermark:hover {
    opacity: 1;
}

/* Mobile watermark (hidden by default on desktop) */
.mobile-watermark {
    display: none;
}

/* Mobile adjustments */
@media (max-width: 768px) {
    /* Hide sidebar watermark on mobile */
    .sidebar-watermark {
        display: none;
    }
    
    /* Show mobile watermark instead */
    .mobile-watermark {
        display: flex;
        position: fixed;
        bottom: 15px;
        right: 15px; /* Changed from left to right */
        background-color: rgba(29, 32, 33, 0.85);
        padding: 8px;
        border-radius: 50%; /* Circular background */
        box-shadow: 0 2px 5px rgba(0,0,0,0.3);
        z-index: 999;
        opacity: 0.5;
        align-items: center;
        justify-content: center;
        transition: opacity 0.3s ease, transform 0.3s ease;
    }
    
    .mobile-watermark:hover {
        opacity: 0.8;
        transform: scale(1.1);
    }
    
    /* Hide the text on mobile */
    .mobile-watermark span {
        display: none;
    }
    
    /* Make the logo slightly larger on mobile */
    .mobile-watermark .watermark-logo {
        width: 32px;
        height: 32px;
    }
}

/* Success overlay for correct PIN */
#success-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #8ec07c; /* Softer Gruvbox bright aqua/green */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 3000; /* Above PIN overlay */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.8s ease, visibility 0.8s ease;
    overflow: hidden; /* Prevent logo from overflowing during animation */
}

#success-overlay.active {
    opacity: 1;
    visibility: visible;
}

#success-overlay.fade-out {
    opacity: 0;
    visibility: hidden;
}

#success-logo {
    width: 120px;
    height: auto; /* Maintain aspect ratio */
    object-fit: contain; /* Ensure it doesn't stretch */
    border-radius: 10px;
    animation: crazyLogo 0.5s ease-in-out;
    margin-bottom: 20px;
    position: relative;
    z-index: 2;
}

#success-text {
    font-family: 'Consolas', 'Menlo', 'DejaVu Sans Mono', monospace;
    color: #282828; /* Dark text for contrast on green */
    font-size: 1.5em;
    text-align: center;
    animation: bounce 0.5s ease-in-out 0.1s;
    animation-fill-mode: both;
    font-weight: 500;
    text-shadow: 2px 2px 0 rgba(0,0,0,0.1);
}

/* Crazy confetti animation in background */
#success-overlay::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(circle, transparent 20%, transparent 20%),
        radial-gradient(circle, #fabd2f 10%, transparent 10%),
        radial-gradient(circle, #fb4934 15%, transparent 15%),
        radial-gradient(circle, #b8bb26 12%, transparent 12%),
        radial-gradient(circle, #d3869b 18%, transparent 18%);
    background-position: 0 0, 50px 50px, 100px 100px, 150px 150px, 200px 200px;
    background-size: 250px 250px;
    opacity: 0.4;
    animation: bgMove 3s linear infinite;
    z-index: 1;
}

/* Crazy spinning logo animation */
@keyframes crazyLogo {
    0% {
        transform: rotate(0deg) scale(0.1);
        opacity: 0;
    }
    25% {
        transform: rotate(180deg) scale(1.5);
    }
    50% {
        transform: rotate(360deg) scale(0.8);
    }
    75% {
        transform: rotate(540deg) scale(1.2);
    }
    100% {
        transform: rotate(720deg) scale(1);
        opacity: 1;
    }
}

/* Text bounce animation */
@keyframes bounce {
    0% {
        transform: translateY(50px);
        opacity: 0;
    }
    60% {
        transform: translateY(-20px);
        opacity: 1;
    }
    80% {
        transform: translateY(10px);
    }
    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Background pattern movement */
@keyframes bgMove {
    0% {
        background-position: 0 0, 50px 50px, 100px 100px, 150px 150px, 200px 200px;
    }
    100% {
        background-position: 250px 250px, 300px 300px, 350px 350px, 400px 400px, 450px 450px;
    }
}

/* Toast notification styling */
.toast-notification {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background-color: #1d2021; /* Gruvbox bg0_h */
    color: #ebdbb2;
    padding: 12px 15px;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 1500;
    max-width: 90%;
    min-width: 280px;
    opacity: 0;
    transition: transform 0.4s ease, opacity 0.4s ease;
    border-left: 4px solid #b8bb26; /* Gruvbox bright green */
}

.toast-notification.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.toast-icon {
    font-size: 1.5rem;
    color: #b8bb26; /* Gruvbox bright green */
    flex-shrink: 0;
}

.toast-content {
    flex-grow: 1;
    min-width: 0; /* Allow text to truncate if needed */
}

.toast-title {
    font-weight: bold;
    margin-bottom: 3px;
    color: #fabd2f; /* Gruvbox bright yellow */
}

.toast-message {
    font-size: 0.9rem;
    white-space: normal;
    overflow: hidden;
    line-height: 1.3;
}

.toast-close {
    background: none;
    border: none;
    color: #a89984; /* Gruvbox fg4 (dim) */
    cursor: pointer;
    font-size: 1rem;
    padding: 5px;
    transition: color 0.2s ease;
    flex-shrink: 0;
}

.toast-close:hover {
    color: #fb4934; /* Gruvbox bright red */
}

/* Media query for small screens */
@media (max-width: 480px) {
    .toast-notification {
        min-width: auto;
        width: 90%;
    }
}

/* Calendar Button Container and Label */
.calendar-button-container {
    margin-top: 15px;
    margin-bottom: 15px;
    padding: 5px;
    border-top: 1px solid #3c3836;
    border-bottom: 1px solid #3c3836;
}

.calendar-toggle-btn {
    display: flex;
    align-items: center;
    background-color: #3c3836; /* Gruvbox bg1 */
    color: #ebdbb2; /* Gruvbox fg */
    border: none;
    border-radius: 6px;
    padding: 10px 15px;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
    width: 100%;
    justify-content: flex-start;
    gap: 10px;
}

.calendar-toggle-btn:hover {
    background-color: #504945; /* Gruvbox bg2 */
    transform: translateY(-2px);
}

.calendar-toggle-btn:active {
    transform: translateY(0px);
}

.calendar-icon {
    font-size: 1.3em;
    color: #fabd2f; /* Gruvbox bright yellow */
}

.calendar-button-label {
    color: #d5c4a1; /* Gruvbox fg (slightly dimmer) */
    font-size: 0.95em;
    font-weight: 500;
}

/* Count container for days and nights */
.count-container {
    display: flex;
    justify-content: space-around;
    margin: 5px 0;
}

#days-count, #nights-count {
    font-size: 1em;
    text-align: center;
    padding: 5px 10px;
    border-radius: 4px;
}

#days-count {
    color: #fabd2f; /* Gruvbox bright yellow */
    font-weight: bold;
    background-color: rgba(250, 189, 47, 0.1); /* Subtle yellow background */
}

#nights-count {
    color: #83a598; /* Gruvbox bright blue */
    font-weight: bold;
    background-color: rgba(131, 165, 152, 0.1); /* Subtle blue background */
}

/* Calendar Modal */
.calendar-container {
    background-color: #1d2021; /* Gruvbox bg0_h */
    border-radius: 10px;
    box-shadow: 0 5px 25px rgba(0,0,0,0.6);
    padding: 25px;
    max-width: 400px;
    width: 90%;
    position: relative;
    user-select: none; /* Prevent text selection */
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.calendar-container h2 {
    color: #fabd2f; /* Gruvbox bright yellow */
    margin-top: 0;
    margin-bottom: 20px;
    text-align: center;
}

.calendar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 15px;
}

.calendar-header button {
    background-color: #504945; /* Gruvbox bg2 */
    color: #ebdbb2;
    border: none;
    border-radius: 4px;
    width: 30px;
    height: 30px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.calendar-header button:hover {
    background-color: #665c54; /* Gruvbox bg3 */
}

#current-month {
    font-size: 1.2em;
    color: #83a598; /* Gruvbox bright blue */
    font-weight: bold;
}

.weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 5px;
    margin-bottom: 10px;
}

.weekdays div {
    text-align: center;
    padding: 5px;
    font-weight: bold;
    color: #d79921; /* Gruvbox yellow */
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 5px;
}

.calendar-day {
    text-align: center;
    padding: 8px;
    border-radius: 4px;
    cursor: default;
    transition: background-color 0.2s ease;
}

.calendar-day.other-month {
    color: #665c54; /* Gruvbox bg3 - dimmed for days from other months */
}

.calendar-day.today {
    background-color: #b16286; /* Gruvbox purple */
    color: #fbf1c7; /* Gruvbox bright fg */
    font-weight: bold;
}

.calendar-day:hover:not(.empty-day) {
    background-color: #504945; /* Gruvbox bg2 */
}

.today-display {
    margin-top: 20px;
    text-align: center;
    padding: 10px;
    background-color: #32302f; /* Gruvbox bg0 */
    border-radius: 4px;
}

#today-date {
    color: #8ec07c; /* Gruvbox bright aqua */
    font-weight: bold;
}

/* Calendar day selection styles */
.calendar-day.selected {
    background-color: #98971a; /* Gruvbox green */
    color: #fbf1c7; /* Gruvbox bright fg */
}

.calendar-day.selection-start {
    background-color: #d79921; /* Gruvbox yellow */
    color: #1d2021; /* Gruvbox bg0_h */
    font-weight: bold;
}

.calendar-day.selection-end {
    background-color: #d79921; /* Gruvbox yellow */
    color: #1d2021; /* Gruvbox bg0_h */
    font-weight: bold;
}

.calendar-day.other-month.selected {
    background-color: #79740e; /* Darker Gruvbox green */
    color: #d5c4a1; /* Gruvbox fg (slightly dimmer) */
}

/* Selection info section */
.selection-info {
    margin-top: 15px;
    padding: 10px;
    background-color: #32302f; /* Gruvbox bg0 */
    border-radius: 4px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

#selected-range {
    font-size: 0.9em;
    color: #ebdbb2; /* Gruvbox fg */
    text-align: center;
}

#days-count {
    font-size: 1em;
    color: #fabd2f; /* Gruvbox bright yellow */
    font-weight: bold;
    text-align: center;
}

#copy-dates-btn {
    background-color: #458588; /* Gruvbox blue */
    color: #ebdbb2; /* Gruvbox fg */
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.3s ease, opacity 0.3s ease;
    margin-top: 5px;
}

#copy-dates-btn:hover:not(:disabled) {
    background-color: #83a598; /* Gruvbox bright blue */
}

#copy-dates-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.remember-me-container {
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.remember-me-container input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid #504945;
    border-radius: 3px;
    background-color: #3c3836;
    cursor: pointer;
    position: relative;
    vertical-align: middle;
}

.remember-me-container input[type="checkbox"]:checked {
    background-color: #b16286; /* Gruvbox purple */
    border-color: #b16286;
}

.remember-me-container input[type="checkbox"]:checked::after {
    content: '✓';
    position: absolute;
    color: #fbf1c7; /* Gruvbox bright fg */
    font-size: 14px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.remember-me-container label {
    color: #d5c4a1; /* Gruvbox fg (slightly dimmer) */
    font-size: 0.9em;
    cursor: pointer;
}

/* New Country Toast Notification */
.new-country-toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background-color: #1d2021; /* Gruvbox bg0_h */
    color: #ebdbb2;
    padding: 12px 15px;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 1500;
    max-width: 90%;
    min-width: 280px;
    opacity: 0;
    transition: transform 0.4s ease, opacity 0.4s ease;
    border-left: 4px solid #b8bb26; /* Gruvbox bright green */
}

.new-country-toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.new-country-toast .toast-icon {
    font-size: 1.5rem;
    color: #b8bb26; /* Gruvbox bright green */
    flex-shrink: 0;
}

.new-country-toast .toast-content {
    flex-grow: 1;
    min-width: 0; /* Allow text to truncate if needed */
}

.new-country-toast .toast-title {
    font-weight: bold;
    margin-bottom: 3px;
    color: #fabd2f; /* Gruvbox bright yellow */
}

.new-country-toast .toast-message {
    font-size: 0.9rem;
    white-space: normal;
    overflow: hidden;
    line-height: 1.3;
}

.new-country-toast .toast-close {
    background: none;
    border: none;
    color: #a89984; /* Gruvbox fg4 (dim) */
    cursor: pointer;
    font-size: 1rem;
    padding: 5px;
    transition: color 0.2s ease;
    flex-shrink: 0;
}

.new-country-toast .toast-close:hover {
    color: #fb4934; /* Gruvbox bright red */
}

/* Fancy border drawing and glow animation for active country */
@keyframes drawBorder {
    0% {
        box-shadow: 0 0 0 0 rgba(251, 241, 199, 0);
        clip-path: polygon(0 0, 0 0, 0 0, 0 0);
        opacity: 0;
    }
    25% {
        clip-path: polygon(0 0, 100% 0, 100% 0, 0 0);
        opacity: 1;
    }
    50% {
        clip-path: polygon(0 0, 100% 0, 100% 100%, 0 0);
        opacity: 1;
    }
    75% {
        clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
        opacity: 1;
    }
    100% {
        box-shadow: 0 0 15px 2px rgba(251, 241, 199, 0.3);
        clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
        opacity: 1;
    }
}

@keyframes glowPulse {
    0% {
        box-shadow: 0 0 15px 2px rgba(251, 241, 199, 0.3);
        opacity: 1;
    }
    50% {
        box-shadow: 0 0 20px 3px rgba(251, 241, 199, 0.5);
        opacity: 1;
    }
    100% {
        box-shadow: 0 0 15px 2px rgba(251, 241, 199, 0.3);
        opacity: 1;
    }
}

@keyframes fadeOutBorder {
    0% {
        opacity: 1;
    }
    100% {
        opacity: 0;
    }
}

#country-list li a.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 2px solid #fbf1c7; /* Gruvbox bright fg */
    border-radius: 4px;
    box-sizing: border-box;
    animation: 
        drawBorder 0.5s linear forwards, 
        glowPulse 2s ease-in-out 0.5s,
        fadeOutBorder 1s ease-in-out 3.5s forwards; /* Fade out after 3.5s */
    pointer-events: none; /* Don't interfere with clicks */
    z-index: 1;
}

/* Themed country styling with glow */
#country-list li a.active.color-theme::before {
    border-color: var(--country-color);
    animation: 
        drawBorder 0.5s linear forwards, 
        glowPulse 2s ease-in-out 0.5s,
        fadeOutBorder 1s ease-in-out 3.5s forwards; /* Fade out after 3.5s */
}

/* Search filter container */
.search-filter-container {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    position: relative;
}

.search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #a89984; /* Gruvbox fg4 (dim) */
    font-size: 0.9em;
    pointer-events: none; /* Allow clicks to pass through to the input */
    opacity: 0.7;
}

#country-search {
    flex-grow: 1;
    padding: 12px;
    padding-left: 35px; /* Space for the search icon */
    padding-right: 35px; /* Space for the clear button */
    border: 1px solid #504945; /* Gruvbox bg2 */
    border-radius: 5px;
    background-color: #3c3836; /* Gruvbox bg1 */
    color: #ebdbb2; /* Gruvbox fg */
    font-size: 1em;
    font-family: inherit;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

#country-search:focus {
    outline: none;
    border-color: #fabd2f; /* Gruvbox bright yellow */
    box-shadow: 0 0 5px rgba(250, 189, 47, 0.3);
}

#country-search::placeholder {
    color: #a89984; /* Gruvbox fg4 (dim) */
    opacity: 0.7;
}

.clear-search-btn {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #a89984; /* Gruvbox fg4 (dim) */
    font-size: 0.9em;
    font-weight: bold;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s ease, background-color 0.2s ease;
    pointer-events: none;
}

.clear-search-btn.visible {
    opacity: 1;
    pointer-events: auto;
}

.clear-search-btn:hover {
    background-color: rgba(251, 73, 52, 0.2); /* Transparent red */
    color: #fb4934; /* Gruvbox bright red */
}

/* Hide country items that don't match search */
#country-list li.filtered-out {
    display: none;
    animation: fadeOut 0.3s ease-out forwards;
    height: 0;
    opacity: 0;
    margin: 0;
    padding: 0;
    overflow: hidden;
    pointer-events: none;
}

/* Cascading fade animation for country list filtering */
@keyframes fadeOut {
    0% {
        opacity: 1;
        transform: translateY(0) scale(1);
        height: auto;
        margin-bottom: 8px;
    }
    100% {
        opacity: 0;
        transform: translateY(-15px) scale(0.95);
        height: 0;
        margin-bottom: 0;
        padding: 0;
    }
}

/* Filtered-in animation for visible countries (during search only) */
#country-list li.filtered-in {
    animation: fadeIn 0.4s ease-out forwards;
    opacity: 1;
    height: auto;
}

@keyframes fadeIn {
    0% {
        opacity: 0;
        transform: translateY(15px) scale(0.95);
    }
    60% {
        transform: translateY(-5px) scale(1.02);
    }
    80% {
        transform: translateY(2px) scale(1);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* No results message */
#no-results-message {
    color: #a89984; /* Gruvbox fg4 (dim) */
    text-align: center;
    padding: 15px;
    font-style: italic;
    display: none;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

#no-results-message.visible {
    display: block;
    opacity: 1;
    transform: translateY(0);
    animation: fadeInMessage 0.5s ease-out forwards;
}

@keyframes fadeInMessage {
    0% {
        opacity: 0;
        transform: translateY(10px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Remove animations from default list items */
#country-list li {
    transition: none; /* Remove transition so clicks don't animate */
}

/* Keep animation for search filtering only */
#country-list li.filtered-out, 
#country-list li.filtered-in {
    transition: opacity 0.3s ease, transform 0.3s ease; /* Re-enable transitions for filtering */
}

/* Toolbar toggle button */
.toolbar-toggle-btn {
    background: none;
    border: none;
    color: #928374; /* Gruvbox dimmed foreground for subtlety */
    font-size: 0.8em;
    cursor: pointer;
    padding: 0 4px;
    margin-left: 6px;
    transition: transform 0.2s ease, color 0.2s ease;
    opacity: 0.7;
    vertical-align: middle;
}

.toolbar-toggle-btn:hover {
    color: #8ec07c; /* Gruvbox bright aqua */
    opacity: 1;
}

.toolbar-toggle-btn.collapsed {
    transform: rotate(-90deg);
}

/* Rich Text Editor Styles */
.rich-text-toolbar {
    display: flex;
    gap: 4px;
    margin-bottom: 8px;
    padding: 5px;
    background-color: #32302f; /* Gruvbox bg0 */
    border-radius: 4px 4px 0 0;
    border: 1px solid #504945; /* Gruvbox bg2 */
    border-bottom: none;
    transition: max-height 0.3s ease, opacity 0.3s ease, transform 0.3s ease, margin 0.3s ease;
    transform-origin: top;
    overflow: hidden;
    max-height: 40px;
    opacity: 1;
}

.rich-text-toolbar.collapsed {
    max-height: 0;
    opacity: 0;
    margin: 0;
    padding-top: 0;
    padding-bottom: 0;
    border: none;
}

.format-btn {
    background-color: #3c3836; /* Gruvbox bg1 */
    color: #ebdbb2; /* Gruvbox fg */
    border: 1px solid #504945; /* Gruvbox bg2 */
    border-radius: 3px;
    height: 30px;
    width: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
}

.format-btn:hover {
    background-color: #504945; /* Gruvbox bg2 */
}

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

.format-btn.active {
    background-color: #83a598; /* Gruvbox bright blue */
    color: #282828; /* Gruvbox bg */
}

.toolbar-divider {
    width: 1px;
    background-color: #504945; /* Gruvbox bg2 */
    margin: 0 4px;
}

/* Adjust notes border radius when toolbar is collapsed */
.rich-text-toolbar.collapsed + .rich-text-editor {
    border-radius: 5px;
}

.rich-text-editor {
    min-height: 250px;
    padding: 15px;
    border: 1px solid #504945; /* Gruvbox bg2 */
    border-radius: 0 0 5px 5px;
    background-color: #3c3836; /* Gruvbox bg1 */
    color: #ebdbb2; /* Gruvbox fg */
    font-family: inherit;
    font-size: 1em;
    line-height: 1.4;
    overflow-y: auto;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.rich-text-editor:focus {
    outline: none;
    border-color: #fabd2f; /* Gruvbox bright yellow */
    box-shadow: 0 0 5px rgba(250, 189, 47, 0.5);
}

.rich-text-editor:empty:before {
    content: attr(placeholder);
    color: #928374; /* Gruvbox fg4 */
    pointer-events: none;
}

.rich-text-editor[contenteditable="false"] {
    background-color: #7c6f64 !important; /* Gruvbox grey */
    color: #3c3836 !important;
    cursor: not-allowed;
}

.rich-text-toolbar:has(+ .rich-text-editor[contenteditable="false"]) .format-btn {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Update references from textarea to rich-text-editor */
.notes-section .rich-text-editor {
    width: 100%;
    flex-grow: 1;
    box-sizing: border-box;
    resize: vertical;
}

/* Handle draggable images in rich text editor */
.rich-text-editor img {
    max-width: 100%;
    height: auto;
    margin: 5px;
    cursor: move;
    border: 2px solid transparent;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.rich-text-editor img:hover {
    border-color: #83a598; /* Gruvbox bright blue */
    box-shadow: 0 0 8px rgba(131, 165, 152, 0.4);
}

.rich-text-editor img.dragging {
    opacity: 0.7;
    border-color: #fe8019; /* Gruvbox bright orange */
    box-shadow: 0 0 12px rgba(254, 128, 25, 0.6);
}

/* Save button and status styles */
.save-status-container {
    display: flex;
    align-items: center;
    margin-right: 15px;
}

#manual-save-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    padding: 5px;
    margin-right: 5px;
    border-radius: 4px;
    transition: background-color 0.3s, transform 0.2s;
}

#manual-save-btn:hover {
    background-color: rgba(146, 131, 116, 0.2);
}

#manual-save-btn:active {
    transform: scale(0.92);
}

#manual-save-btn.has-unsaved {
    animation: pulse 2s infinite;
    position: relative;
}

#last-saved-info {
    font-size: 0.75rem;
    color: #a89984;
    opacity: 0.8;
    transition: opacity 0.3s, color 0.3s;
}

#last-saved-info.highlight {
    color: #b8bb26;
    opacity: 1;
    animation: fadeHighlight 2s;
}

/* Unsaved country indicator */
#country-list li.unsaved a::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background-color: #fe8019;
    border-radius: 0 2px 2px 0;
    opacity: 0;
    animation: appearFromLeft 0.3s forwards;
}

/* Animations */
@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(254, 128, 25, 0.4);
    }
    70% {
        box-shadow: 0 0 0 6px rgba(254, 128, 25, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(254, 128, 25, 0);
    }
}

@keyframes fadeHighlight {
    0% {
        background-color: rgba(184, 187, 38, 0.2);
    }
    100% {
        background-color: transparent;
    }
}

@keyframes appearFromLeft {
    from {
        opacity: 0;
        transform: translateX(-100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Additional Features Section - Modern Menu Style */
.additional-section {
    margin-top: 25px;
    border-top: 1px solid #504945;
    padding-top: 20px;
}

.additional-section > h3 {
    color: #fe8019; /* Bright orange for main section header */
    margin-bottom: 15px;
    font-size: 1.3em;
}

/* Nested section headers */
.additional-section h4 {
    color: #8ec07c; /* Same color as original h3 sections */
    margin: 15px 0 10px;
    font-size: 1.1em;
    display: flex;
    align-items: center;
}

/* Adjust spacing in nested sections */
.gallery-section, .links-section, .prices-section {
    margin-bottom: 15px;
    margin-left: 15px; /* Indent nested sections */
}

/* Last section shouldn't have bottom margin */
.prices-section {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

/* Country Edit Modal with glowing border effect */
.country-edit-container {
    background-color: #1d2021; /* Gruvbox bg0_h */
    border-radius: 8px;
    box-shadow: 0 5px 25px rgba(0,0,0,0.6);
    padding: 25px;
    max-width: 500px;
    width: 90%;
    position: relative;
}

/* Glowing border effect for country edit modal */
.country-edit-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 2px solid #98971a; /* Gruvbox green */
    border-radius: 8px;
    box-sizing: border-box;
    pointer-events: none;
    z-index: 1;
    animation: 
        drawGreenBorder 0.5s linear forwards, 
        glowGreenPulse 2s ease-in-out infinite 0.5s;
}

@keyframes drawGreenBorder {
    0% {
        box-shadow: 0 0 0 0 rgba(152, 151, 26, 0);
        clip-path: polygon(0 0, 0 0, 0 0, 0 0);
        opacity: 0;
    }
    25% {
        clip-path: polygon(0 0, 100% 0, 100% 0, 0 0);
        opacity: 1;
    }
    50% {
        clip-path: polygon(0 0, 100% 0, 100% 100%, 0 0);
        opacity: 1;
    }
    75% {
        clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
        opacity: 1;
    }
    100% {
        box-shadow: 0 0 15px 2px rgba(152, 151, 26, 0.3);
        clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
        opacity: 1;
    }
}

@keyframes glowGreenPulse {
    0% {
        box-shadow: 0 0 15px 2px rgba(152, 151, 26, 0.3);
    }
    50% {
        box-shadow: 0 0 20px 3px rgba(152, 151, 26, 0.5);
    }
    100% {
        box-shadow: 0 0 15px 2px rgba(152, 151, 26, 0.3);
    }
}

.country-edit-container h2 {
    color: #fabd2f; /* Gruvbox bright yellow */
    margin-top: 0;
    margin-bottom: 20px;
    text-align: center;
}

.country-edit-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.form-group label {
    color: #ebdbb2; /* Gruvbox fg */
    font-weight: bold;
}

#country-name-input {
    padding: 10px;
    border: 1px solid #504945; /* Gruvbox bg2 */
    border-radius: 4px;
    background-color: #3c3836; /* Gruvbox bg1 */
    color: #ebdbb2;
    font-size: 1em;
}

#country-name-input:focus {
    outline: none;
    border-color: #fabd2f; /* Gruvbox bright yellow */
    box-shadow: 0 0 5px rgba(250, 189, 47, 0.5);
}

.emoji-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 10px;
    max-height: 200px;
    overflow-y: auto;
    padding: 10px;
    border: 1px solid #504945;
    border-radius: 4px;
    background-color: #32302f;
}

.emoji-flag {
    font-size: 1.8em;
    cursor: pointer;
    text-align: center;
    padding: 8px;
    border-radius: 4px;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.emoji-flag:hover {
    background-color: #504945;
    transform: scale(1.1);
}

.emoji-flag.selected {
    background-color: #b16286; /* Gruvbox purple */
    transform: scale(1.1);
}

.selected-flag-container {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #ebdbb2;
}

.selected-flag {
    font-size: 2em;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    margin-top: 10px;
}

.form-actions button {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.3s ease;
}

#country-edit-cancel {
    background-color: #504945; /* Gruvbox bg2 */
    color: #ebdbb2;
}

#country-edit-save {
    background-color: #b16286; /* Gruvbox purple */
    color: #fbf1c7;
}

#country-edit-cancel:hover {
    background-color: #665c54; /* Gruvbox bg3 */
}

#country-edit-save:hover {
    background-color: #d3869b; /* Lighter Gruvbox purple */
}

/* Flag Search Styling */
.flag-search-container {
    display: flex;
    margin-bottom: 10px;
    position: relative;
}

#flag-search-input {
    flex-grow: 1;
    padding: 10px;
    padding-right: 30px; /* Space for the clear button */
    border: 1px solid #504945;
    border-radius: 4px;
    background-color: #3c3836;
    color: #ebdbb2;
    font-size: 0.9em;
}

#flag-search-input:focus {
    outline: none;
    border-color: #fabd2f;
    box-shadow: 0 0 5px rgba(250, 189, 47, 0.5);
}

#flag-search-clear {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #a89984;
    cursor: pointer;
    font-size: 0.9em;
    display: none; /* Hide by default, show when input has value */
}

#flag-search-clear:hover {
    color: #fb4934;
}

/* Country name in the header */
#current-country-name.color-theme {
    color: var(--country-color);
}

/* Sidebar watermark at bottom */
.sidebar-watermark {
    margin-top: auto;
    padding-top: 15px;
    border-top: 1px solid #3c3836;
    display: flex;
    align-items: center;
    gap: 10px;
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.sidebar-watermark:hover {
    opacity: 1;
}

.watermark-logo {
    width: 24px;
    height: auto;
    border-radius: 3px;
}

.sidebar-watermark span,
.mobile-watermark span {
    font-size: 0.9em;
    color: #a89984;
    font-weight: 500;
}

.sidebar-watermark:hover,
.mobile-watermark:hover {
    opacity: 1;
}

/* Mobile watermark (hidden by default on desktop) */
.mobile-watermark {
    display: none;
}

/* Mobile adjustments */
@media (max-width: 768px) {
    /* Hide sidebar watermark on mobile */
    .sidebar-watermark {
        display: none;
    }
    
    /* Show mobile watermark instead */
    .mobile-watermark {
        display: flex;
        position: fixed;
        bottom: 15px;
        right: 15px; /* Changed from left to right */
        background-color: rgba(29, 32, 33, 0.85);
        padding: 8px;
        border-radius: 50%; /* Circular background */
        box-shadow: 0 2px 5px rgba(0,0,0,0.3);
        z-index: 999;
        opacity: 0.5;
        align-items: center;
        justify-content: center;
        transition: opacity 0.3s ease, transform 0.3s ease;
    }
    
    .mobile-watermark:hover {
        opacity: 0.8;
        transform: scale(1.1);
    }
    
    /* Hide the text on mobile */
    .mobile-watermark span {
        display: none;
    }
    
    /* Make the logo slightly larger on mobile */
    .mobile-watermark .watermark-logo {
        width: 32px;
        height: 32px;
    }
}

/* Success overlay for correct PIN */
#success-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #8ec07c; /* Softer Gruvbox bright aqua/green */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 3000; /* Above PIN overlay */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.8s ease, visibility 0.8s ease;
    overflow: hidden; /* Prevent logo from overflowing during animation */
}

#success-overlay.active {
    opacity: 1;
    visibility: visible;
}

#success-overlay.fade-out {
    opacity: 0;
    visibility: hidden;
}

#success-logo {
    width: 120px;
    height: auto; /* Maintain aspect ratio */
    object-fit: contain; /* Ensure it doesn't stretch */
    border-radius: 10px;
    animation: crazyLogo 0.5s ease-in-out;
    margin-bottom: 20px;
    position: relative;
    z-index: 2;
}

#success-text {
    font-family: 'Consolas', 'Menlo', 'DejaVu Sans Mono', monospace;
    color: #282828; /* Dark text for contrast on green */
    font-size: 1.5em;
    text-align: center;
    animation: bounce 0.5s ease-in-out 0.1s;
    animation-fill-mode: both;
    font-weight: 500;
    text-shadow: 2px 2px 0 rgba(0,0,0,0.1);
}

/* Crazy confetti animation in background */
#success-overlay::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(circle, transparent 20%, transparent 20%),
        radial-gradient(circle, #fabd2f 10%, transparent 10%),
        radial-gradient(circle, #fb4934 15%, transparent 15%),
        radial-gradient(circle, #b8bb26 12%, transparent 12%),
        radial-gradient(circle, #d3869b 18%, transparent 18%);
    background-position: 0 0, 50px 50px, 100px 100px, 150px 150px, 200px 200px;
    background-size: 250px 250px;
    opacity: 0.4;
    animation: bgMove 3s linear infinite;
    z-index: 1;
}

/* Crazy spinning logo animation */
@keyframes crazyLogo {
    0% {
        transform: rotate(0deg) scale(0.1);
        opacity: 0;
    }
    25% {
        transform: rotate(180deg) scale(1.5);
    }
    50% {
        transform: rotate(360deg) scale(0.8);
    }
    75% {
        transform: rotate(540deg) scale(1.2);
    }
    100% {
        transform: rotate(720deg) scale(1);
        opacity: 1;
    }
}

/* Text bounce animation */
@keyframes bounce {
    0% {
        transform: translateY(50px);
        opacity: 0;
    }
    60% {
        transform: translateY(-20px);
        opacity: 1;
    }
    80% {
        transform: translateY(10px);
    }
    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Background pattern movement */
@keyframes bgMove {
    0% {
        background-position: 0 0, 50px 50px, 100px 100px, 150px 150px, 200px 200px;
    }
    100% {
        background-position: 250px 250px, 300px 300px, 350px 350px, 400px 400px, 450px 450px;
    }
}

/* Toast notification styling */
.toast-notification {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background-color: #1d2021; /* Gruvbox bg0_h */
    color: #ebdbb2;
    padding: 12px 15px;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 1500;
    max-width: 90%;
    min-width: 280px;
    opacity: 0;
    transition: transform 0.4s ease, opacity 0.4s ease;
    border-left: 4px solid #b8bb26; /* Gruvbox bright green */
}

.toast-notification.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.toast-icon {
    font-size: 1.5rem;
    color: #b8bb26; /* Gruvbox bright green */
    flex-shrink: 0;
}

.toast-content {
    flex-grow: 1;
    min-width: 0; /* Allow text to truncate if needed */
}

.toast-title {
    font-weight: bold;
    margin-bottom: 3px;
    color: #fabd2f; /* Gruvbox bright yellow */
}

.toast-message {
    font-size: 0.9rem;
    white-space: normal;
    overflow: hidden;
    line-height: 1.3;
}

.toast-close {
    background: none;
    border: none;
    color: #a89984; /* Gruvbox fg4 (dim) */
    cursor: pointer;
    font-size: 1rem;
    padding: 5px;
    transition: color 0.2s ease;
    flex-shrink: 0;
}

.toast-close:hover {
    color: #fb4934; /* Gruvbox bright red */
}

/* Media query for small screens */
@media (max-width: 480px) {
    .toast-notification {
        min-width: auto;
        width: 90%;
    }
}

/* Calendar Button Container and Label */
.calendar-button-container {
    margin-top: 15px;
    margin-bottom: 15px;
    padding: 5px;
    border-top: 1px solid #3c3836;
    border-bottom: 1px solid #3c3836;
}

.calendar-toggle-btn {
    display: flex;
    align-items: center;
    background-color: #3c3836; /* Gruvbox bg1 */
    color: #ebdbb2; /* Gruvbox fg */
    border: none;
    border-radius: 6px;
    padding: 10px 15px;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
    width: 100%;
    justify-content: flex-start;
    gap: 10px;
}

.calendar-toggle-btn:hover {
    background-color: #504945; /* Gruvbox bg2 */
    transform: translateY(-2px);
}

.calendar-toggle-btn:active {
    transform: translateY(0px);
}

.calendar-icon {
    font-size: 1.3em;
    color: #fabd2f; /* Gruvbox bright yellow */
}

.calendar-button-label {
    color: #d5c4a1; /* Gruvbox fg (slightly dimmer) */
    font-size: 0.95em;
    font-weight: 500;
}

/* Count container for days and nights */
.count-container {
    display: flex;
    justify-content: space-around;
    margin: 5px 0;
}

#days-count, #nights-count {
    font-size: 1em;
    text-align: center;
    padding: 5px 10px;
    border-radius: 4px;
}

#days-count {
    color: #fabd2f; /* Gruvbox bright yellow */
    font-weight: bold;
    background-color: rgba(250, 189, 47, 0.1); /* Subtle yellow background */
}

#nights-count {
    color: #83a598; /* Gruvbox bright blue */
    font-weight: bold;
    background-color: rgba(131, 165, 152, 0.1); /* Subtle blue background */
}

/* Calendar Modal */
.calendar-container {
    background-color: #1d2021; /* Gruvbox bg0_h */
    border-radius: 10px;
    box-shadow: 0 5px 25px rgba(0,0,0,0.6);
    padding: 25px;
    max-width: 400px;
    width: 90%;
    position: relative;
    user-select: none; /* Prevent text selection */
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.calendar-container h2 {
    color: #fabd2f; /* Gruvbox bright yellow */
    margin-top: 0;
    margin-bottom: 20px;
    text-align: center;
}

.calendar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 15px;
}

.calendar-header button {
    background-color: #504945; /* Gruvbox bg2 */
    color: #ebdbb2;
    border: none;
    border-radius: 4px;
    width: 30px;
    height: 30px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.calendar-header button:hover {
    background-color: #665c54; /* Gruvbox bg3 */
}

#current-month {
    font-size: 1.2em;
    color: #83a598; /* Gruvbox bright blue */
    font-weight: bold;
}

.weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 5px;
    margin-bottom: 10px;
}

.weekdays div {
    text-align: center;
    padding: 5px;
    font-weight: bold;
    color: #d79921; /* Gruvbox yellow */
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 5px;
}

.calendar-day {
    text-align: center;
    padding: 8px;
    border-radius: 4px;
    cursor: default;
    transition: background-color 0.2s ease;
}

.calendar-day.other-month {
    color: #665c54; /* Gruvbox bg3 - dimmed for days from other months */
}

.calendar-day.today {
    background-color: #b16286; /* Gruvbox purple */
    color: #fbf1c7; /* Gruvbox bright fg */
    font-weight: bold;
}

.calendar-day:hover:not(.empty-day) {
    background-color: #504945; /* Gruvbox bg2 */
}

.today-display {
    margin-top: 20px;
    text-align: center;
    padding: 10px;
    background-color: #32302f; /* Gruvbox bg0 */
    border-radius: 4px;
}

#today-date {
    color: #8ec07c; /* Gruvbox bright aqua */
    font-weight: bold;
}

/* Calendar day selection styles */
.calendar-day.selected {
    background-color: #98971a; /* Gruvbox green */
    color: #fbf1c7; /* Gruvbox bright fg */
}

.calendar-day.selection-start {
    background-color: #d79921; /* Gruvbox yellow */
    color: #1d2021; /* Gruvbox bg0_h */
    font-weight: bold;
}

.calendar-day.selection-end {
    background-color: #d79921; /* Gruvbox yellow */
    color: #1d2021; /* Gruvbox bg0_h */
    font-weight: bold;
}

.calendar-day.other-month.selected {
    background-color: #79740e; /* Darker Gruvbox green */
    color: #d5c4a1; /* Gruvbox fg (slightly dimmer) */
}

/* Selection info section */
.selection-info {
    margin-top: 15px;
    padding: 10px;
    background-color: #32302f; /* Gruvbox bg0 */
    border-radius: 4px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

#selected-range {
    font-size: 0.9em;
    color: #ebdbb2; /* Gruvbox fg */
    text-align: center;
}

#days-count {
    font-size: 1em;
    color: #fabd2f; /* Gruvbox bright yellow */
    font-weight: bold;
    text-align: center;
}

#copy-dates-btn {
    background-color: #458588; /* Gruvbox blue */
    color: #ebdbb2; /* Gruvbox fg */
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.3s ease, opacity 0.3s ease;
    margin-top: 5px;
}

#copy-dates-btn:hover:not(:disabled) {
    background-color: #83a598; /* Gruvbox bright blue */
}

#copy-dates-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.remember-me-container {
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.remember-me-container input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid #504945;
    border-radius: 3px;
    background-color: #3c3836;
    cursor: pointer;
    position: relative;
    vertical-align: middle;
}

.remember-me-container input[type="checkbox"]:checked {
    background-color: #b16286; /* Gruvbox purple */
    border-color: #b16286;
}

.remember-me-container input[type="checkbox"]:checked::after {
    content: '✓';
    position: absolute;
    color: #fbf1c7; /* Gruvbox bright fg */
    font-size: 14px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.remember-me-container label {
    color: #d5c4a1; /* Gruvbox fg (slightly dimmer) */
    font-size: 0.9em;
    cursor: pointer;
}

/* New Country Toast Notification */
.new-country-toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background-color: #1d2021; /* Gruvbox bg0_h */
    color: #ebdbb2;
    padding: 12px 15px;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 1500;
    max-width: 90%;
    min-width: 280px;
    opacity: 0;
    transition: transform 0.4s ease, opacity 0.4s ease;
    border-left: 4px solid #b8bb26; /* Gruvbox bright green */
}

.new-country-toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.new-country-toast .toast-icon {
    font-size: 1.5rem;
    color: #b8bb26; /* Gruvbox bright green */
    flex-shrink: 0;
}

.new-country-toast .toast-content {
    flex-grow: 1;
    min-width: 0; /* Allow text to truncate if needed */
}

.new-country-toast .toast-title {
    font-weight: bold;
    margin-bottom: 3px;
    color: #fabd2f; /* Gruvbox bright yellow */
}

.new-country-toast .toast-message {
    font-size: 0.9rem;
    white-space: normal;
    overflow: hidden;
    line-height: 1.3;
}

.new-country-toast .toast-close {
    background: none;
    border: none;
    color: #a89984; /* Gruvbox fg4 (dim) */
    cursor: pointer;
    font-size: 1rem;
    padding: 5px;
    transition: color 0.2s ease;
    flex-shrink: 0;
}

.new-country-toast .toast-close:hover {
    color: #fb4934; /* Gruvbox bright red */
}

/* Fancy border drawing and glow animation for active country */
@keyframes drawBorder {
    0% {
        box-shadow: 0 0 0 0 rgba(251, 241, 199, 0);
        clip-path: polygon(0 0, 0 0, 0 0, 0 0);
        opacity: 0;
    }
    25% {
        clip-path: polygon(0 0, 100% 0, 100% 0, 0 0);
        opacity: 1;
    }
    50% {
        clip-path: polygon(0 0, 100% 0, 100% 100%, 0 0);
        opacity: 1;
    }
    75% {
        clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
        opacity: 1;
    }
    100% {
        box-shadow: 0 0 15px 2px rgba(251, 241, 199, 0.3);
        clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
        opacity: 1;
    }
}

@keyframes glowPulse {
    0% {
        box-shadow: 0 0 15px 2px rgba(251, 241, 199, 0.3);
        opacity: 1;
    }
    50% {
        box-shadow: 0 0 20px 3px rgba(251, 241, 199, 0.5);
        opacity: 1;
    }
    100% {
        box-shadow: 0 0 15px 2px rgba(251, 241, 199, 0.3);
        opacity: 1;
    }
}

@keyframes fadeOutBorder {
    0% {
        opacity: 1;
    }
    100% {
        opacity: 0;
    }
}

#country-list li a.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 2px solid #fbf1c7; /* Gruvbox bright fg */
    border-radius: 4px;
    box-sizing: border-box;
    animation: 
        drawBorder 0.5s linear forwards, 
        glowPulse 2s ease-in-out 0.5s,
        fadeOutBorder 1s ease-in-out 3.5s forwards; /* Fade out after 3.5s */
    pointer-events: none; /* Don't interfere with clicks */
    z-index: 1;
}

/* Themed country styling with glow */
#country-list li a.active.color-theme::before {
    border-color: var(--country-color);
    animation: 
        drawBorder 0.5s linear forwards, 
        glowPulse 2s ease-in-out 0.5s,
        fadeOutBorder 1s ease-in-out 3.5s forwards; /* Fade out after 3.5s */
}

/* Search filter container */
.search-filter-container {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    position: relative;
}

.search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #a89984; /* Gruvbox fg4 (dim) */
    font-size: 0.9em;
    pointer-events: none; /* Allow clicks to pass through to the input */
    opacity: 0.7;
}

#country-search {
    flex-grow: 1;
    padding: 12px;
    padding-left: 35px; /* Space for the search icon */
    padding-right: 35px; /* Space for the clear button */
    border: 1px solid #504945; /* Gruvbox bg2 */
    border-radius: 5px;
    background-color: #3c3836; /* Gruvbox bg1 */
    color: #ebdbb2; /* Gruvbox fg */
    font-size: 1em;
    font-family: inherit;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

#country-search:focus {
    outline: none;
    border-color: #fabd2f; /* Gruvbox bright yellow */
    box-shadow: 0 0 5px rgba(250, 189, 47, 0.3);
}

#country-search::placeholder {
    color: #a89984; /* Gruvbox fg4 (dim) */
    opacity: 0.7;
}

.clear-search-btn {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #a89984; /* Gruvbox fg4 (dim) */
    font-size: 0.9em;
    font-weight: bold;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s ease, background-color 0.2s ease;
    pointer-events: none;
}

.clear-search-btn.visible {
    opacity: 1;
    pointer-events: auto;
}

.clear-search-btn:hover {
    background-color: rgba(251, 73, 52, 0.2); /* Transparent red */
    color: #fb4934; /* Gruvbox bright red */
}

/* Hide country items that don't match search */
#country-list li.filtered-out {
    display: none;
    animation: fadeOut 0.3s ease-out forwards;
    height: 0;
    opacity: 0;
    margin: 0;
    padding: 0;
    overflow: hidden;
    pointer-events: none;
}

/* Cascading fade animation for country list filtering */
@keyframes fadeOut {
    0% {
        opacity: 1;
        transform: translateY(0) scale(1);
        height: auto;
        margin-bottom: 8px;
}
    100% {
        opacity: 0;
        transform: translateY(-15px) scale(0.95);
        height: 0;
        margin-bottom: 0;
    padding: 0;
    }
}

/* Filtered-in animation for visible countries (during search only) */
#country-list li.filtered-in {
    animation: fadeIn 0.4s ease-out forwards;
    opacity: 1;
    height: auto;
}

@keyframes fadeIn {
    0% {
        opacity: 0;
        transform: translateY(15px) scale(0.95);
    }
    60% {
        transform: translateY(-5px) scale(1.02);
    }
    80% {
        transform: translateY(2px) scale(1);
}
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* No results message */
#no-results-message {
    color: #a89984; /* Gruvbox fg4 (dim) */
    text-align: center;
    padding: 15px;
    font-style: italic;
    display: none;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

#no-results-message.visible {
    display: block;
    opacity: 1;
    transform: translateY(0);
    animation: fadeInMessage 0.5s ease-out forwards;
}

@keyframes fadeInMessage {
    0% {
        opacity: 0;
        transform: translateY(10px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Remove animations from default list items */
#country-list li {
    transition: none; /* Remove transition so clicks don't animate */
}

/* Keep animation for search filtering only */
#country-list li.filtered-out, 
#country-list li.filtered-in {
    transition: opacity 0.3s ease, transform 0.3s ease; /* Re-enable transitions for filtering */
}

/* Toolbar toggle button */
.toolbar-toggle-btn {
    background: none;
    border: none;
    color: #928374; /* Gruvbox dimmed foreground for subtlety */
    font-size: 0.8em;
    cursor: pointer;
    padding: 0 4px;
    margin-left: 6px;
    transition: transform 0.2s ease, color 0.2s ease;
    opacity: 0.7;
    vertical-align: middle;
}

.toolbar-toggle-btn:hover {
    color: #8ec07c; /* Gruvbox bright aqua */
    opacity: 1;
}

.toolbar-toggle-btn.collapsed {
    transform: rotate(-90deg);
}

/* Rich Text Editor Styles */
.rich-text-toolbar {
    display: flex;
    gap: 4px;
    margin-bottom: 8px;
    padding: 5px;
    background-color: #32302f; /* Gruvbox bg0 */
    border-radius: 4px 4px 0 0;
    border: 1px solid #504945; /* Gruvbox bg2 */
    border-bottom: none;
    transition: max-height 0.3s ease, opacity 0.3s ease, transform 0.3s ease, margin 0.3s ease;
    transform-origin: top;
    overflow: hidden;
    max-height: 40px;
    opacity: 1;
}

.rich-text-toolbar.collapsed {
    max-height: 0;
    opacity: 0;
    margin: 0;
    padding-top: 0;
    padding-bottom: 0;
    border: none;
}

.format-btn {
    background-color: #3c3836; /* Gruvbox bg1 */
    color: #ebdbb2; /* Gruvbox fg */
    border: 1px solid #504945; /* Gruvbox bg2 */
    border-radius: 3px;
    height: 30px;
    width: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
}

.format-btn:hover {
    background-color: #504945; /* Gruvbox bg2 */
}

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

.format-btn.active {
    background-color: #83a598; /* Gruvbox bright blue */
    color: #282828; /* Gruvbox bg */
}

.toolbar-divider {
    width: 1px;
    background-color: #504945; /* Gruvbox bg2 */
    margin: 0 4px;
}

/* Adjust notes border radius when toolbar is collapsed */
.rich-text-toolbar.collapsed + .rich-text-editor {
    border-radius: 5px;
}

.rich-text-editor {
    min-height: 250px;
    padding: 15px;
    border: 1px solid #504945; /* Gruvbox bg2 */
    border-radius: 0 0 5px 5px;
    background-color: #3c3836; /* Gruvbox bg1 */
    color: #ebdbb2; /* Gruvbox fg */
    font-family: inherit;
    font-size: 1em;
    line-height: 1.4;
    overflow-y: auto;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.rich-text-editor:focus {
    outline: none;
    border-color: #fabd2f; /* Gruvbox bright yellow */
    box-shadow: 0 0 5px rgba(250, 189, 47, 0.5);
}

.rich-text-editor:empty:before {
    content: attr(placeholder);
    color: #928374; /* Gruvbox fg4 */
    pointer-events: none;
}

.rich-text-editor[contenteditable="false"] {
    background-color: #7c6f64 !important; /* Gruvbox grey */
    color: #3c3836 !important;
    cursor: not-allowed;
}

.rich-text-toolbar:has(+ .rich-text-editor[contenteditable="false"]) .format-btn {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Update references from textarea to rich-text-editor */
.notes-section .rich-text-editor {
    width: 100%;
    flex-grow: 1;
    box-sizing: border-box;
    resize: vertical;
}

/* Handle draggable images in rich text editor */
.rich-text-editor img {
    max-width: 100%;
    height: auto;
    margin: 5px;
    cursor: move;
    border: 2px solid transparent;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.rich-text-editor img:hover {
    border-color: #83a598; /* Gruvbox bright blue */
    box-shadow: 0 0 8px rgba(131, 165, 152, 0.4);
}

.rich-text-editor img.dragging {
    opacity: 0.7;
    border-color: #fe8019; /* Gruvbox bright orange */
    box-shadow: 0 0 12px rgba(254, 128, 25, 0.6);
}

/* Save button and status styles */
.save-status-container {
    display: flex;
    align-items: center;
    margin-right: 15px;
}

#manual-save-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    padding: 5px;
    margin-right: 5px;
    border-radius: 4px;
    transition: background-color 0.3s, transform 0.2s;
}

#manual-save-btn:hover {
    background-color: rgba(146, 131, 116, 0.2);
}

#manual-save-btn:active {
    transform: scale(0.92);
}

#manual-save-btn.has-unsaved {
    animation: pulse 2s infinite;
    position: relative;
}

#last-saved-info {
    font-size: 0.75rem;
    color: #a89984;
    opacity: 0.8;
    transition: opacity 0.3s, color 0.3s;
}

#last-saved-info.highlight {
    color: #b8bb26;
    opacity: 1;
    animation: fadeHighlight 2s;
}

/* Unsaved country indicator */
#country-list li.unsaved a::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background-color: #fe8019;
    border-radius: 0 2px 2px 0;
    opacity: 0;
    animation: appearFromLeft 0.3s forwards;
}

/* Animations */
@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(254, 128, 25, 0.4);
    }
    70% {
        box-shadow: 0 0 0 6px rgba(254, 128, 25, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(254, 128, 25, 0);
    }
}

@keyframes fadeHighlight {
    0% {
        background-color: rgba(184, 187, 38, 0.2);
    }
    100% {
        background-color: transparent;
    }
}

@keyframes appearFromLeft {
    from {
        opacity: 0;
        transform: translateX(-100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Additional Features Section - Modern Menu Style */
.additional-section {
    margin-top: 25px;
    border-top: 1px solid #504945;
    padding-top: 20px;
}

.additional-section > h3 {
    color: #fe8019; /* Bright orange for main section header */
    margin-bottom: 15px;
    font-size: 1.3em;
}

/* Nested section headers */
.additional-section h4 {
    color: #8ec07c; /* Same color as original h3 sections */
    margin: 15px 0 10px;
    font-size: 1.1em;
    display: flex;
    align-items: center;
}

/* Adjust spacing in nested sections */
.gallery-section, .links-section, .prices-section {
    margin-bottom: 15px;
    margin-left: 15px; /* Indent nested sections */
}

/* Last section shouldn't have bottom margin */
.prices-section {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

/* Country Edit Modal with glowing border effect */
.country-edit-container {
    background-color: #1d2021; /* Gruvbox bg0_h */
    border-radius: 8px;
    box-shadow: 0 5px 25px rgba(0,0,0,0.6);
    padding: 25px;
    max-width: 500px;
    width: 90%;
    position: relative;
}

/* Glowing border effect for country edit modal */
.country-edit-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 2px solid #98971a; /* Gruvbox green */
    border-radius: 8px;
    box-sizing: border-box;
    pointer-events: none;
    z-index: 1;
    animation: 
        drawGreenBorder 0.5s linear forwards, 
        glowGreenPulse 2s ease-in-out infinite 0.5s;
}

@keyframes drawGreenBorder {
    0% {
        box-shadow: 0 0 0 0 rgba(152, 151, 26, 0);
        clip-path: polygon(0 0, 0 0, 0 0, 0 0);
        opacity: 0;
    }
    25% {
        clip-path: polygon(0 0, 100% 0, 100% 0, 0 0);
        opacity: 1;
    }
    50% {
        clip-path: polygon(0 0, 100% 0, 100% 100%, 0 0);
        opacity: 1;
    }
    75% {
        clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
        opacity: 1;
    }
    100% {
        box-shadow: 0 0 15px 2px rgba(152, 151, 26, 0.3);
        clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
        opacity: 1;
    }
}

@keyframes glowGreenPulse {
    0% {
        box-shadow: 0 0 15px 2px rgba(152, 151, 26, 0.3);
    }
    50% {
        box-shadow: 0 0 20px 3px rgba(152, 151, 26, 0.5);
    }
    100% {
        box-shadow: 0 0 15px 2px rgba(152, 151, 26, 0.3);
    }
}

.country-edit-container h2 {
    color: #fabd2f; /* Gruvbox bright yellow */
    margin-top: 0;
    margin-bottom: 20px;
    text-align: center;
}

.country-edit-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.form-group label {
    color: #ebdbb2; /* Gruvbox fg */
    font-weight: bold;
}

#country-name-input {
    padding: 10px;
    border: 1px solid #504945; /* Gruvbox bg2 */
    border-radius: 4px;
    background-color: #3c3836; /* Gruvbox bg1 */
    color: #ebdbb2;
    font-size: 1em;
}

#country-name-input:focus {
    outline: none;
    border-color: #fabd2f; /* Gruvbox bright yellow */
    box-shadow: 0 0 5px rgba(250, 189, 47, 0.5);
}

.emoji-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 10px;
    max-height: 200px;
    overflow-y: auto;
    padding: 10px;
    border: 1px solid #504945;
    border-radius: 4px;
    background-color: #32302f;
}

.emoji-flag {
    font-size: 1.8em;
    cursor: pointer;
    text-align: center;
    padding: 8px;
    border-radius: 4px;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.emoji-flag:hover {
    background-color: #504945;
    transform: scale(1.1);
}

.emoji-flag.selected {
    background-color: #b16286; /* Gruvbox purple */
    transform: scale(1.1);
}

.selected-flag-container {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #ebdbb2;
}

.selected-flag {
    font-size: 2em;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    margin-top: 10px;
}

.form-actions button {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.3s ease;
}

#country-edit-cancel {
    background-color: #504945; /* Gruvbox bg2 */
    color: #ebdbb2;
}

#country-edit-save {
    background-color: #b16286; /* Gruvbox purple */
    color: #fbf1c7;
}

#country-edit-cancel:hover {
    background-color: #665c54; /* Gruvbox bg3 */
}

#country-edit-save:hover {
    background-color: #d3869b; /* Lighter Gruvbox purple */
}

/* Flag Search Styling */
.flag-search-container {
    display: flex;
    margin-bottom: 10px;
    position: relative;
}

#flag-search-input {
    flex-grow: 1;
    padding: 10px;
    padding-right: 30px; /* Space for the clear button */
    border: 1px solid #504945;
    border-radius: 4px;
    background-color: #3c3836;
    color: #ebdbb2;
    font-size: 0.9em;
}

#flag-search-input:focus {
    outline: none;
    border-color: #fabd2f;
    box-shadow: 0 0 5px rgba(250, 189, 47, 0.5);
}

#flag-search-clear {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #a89984;
    cursor: pointer;
    font-size: 0.9em;
    display: none; /* Hide by default, show when input has value */
}

#flag-search-clear:hover {
    color: #fb4934;
}

/* Country name in the header */
#current-country-name.color-theme {
    color: var(--country-color);
}

/* Sidebar watermark at bottom */
.sidebar-watermark {
    margin-top: auto;
    padding-top: 15px;
    border-top: 1px solid #3c3836;
    display: flex;
    align-items: center;
    gap: 10px;
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.sidebar-watermark:hover {
    opacity: 1;
}

.watermark-logo {
    width: 24px;
    height: auto;
    border-radius: 3px;
}

.sidebar-watermark span,
.mobile-watermark span {
    font-size: 0.9em;
    color: #a89984;
    font-weight: 500;
}

.sidebar-watermark:hover,
.mobile-watermark:hover {
    opacity: 1;
}

/* Mobile watermark (hidden by default on desktop) */
.mobile-watermark {
    display: none;
}

/* Mobile adjustments */
@media (max-width: 768px) {
    /* Hide sidebar watermark on mobile */
    .sidebar-watermark {
        display: none;
        font-size: 1.2em;
        padding: 10px 12px;
    }
}

/* Image Gallery Styles */
#image-gallery {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    border: 1px dashed #504945;
    padding: 15px;
    min-height: 120px;
    background-color: #32302f;
    border-radius: 6px;
    margin-bottom: 15px;
    align-content: flex-start;
    position: relative;
    transition: border-color 0.3s ease, transform 0.3s ease;
}

#image-gallery:hover {
    border-color: #83a598; /* Gruvbox bright blue on hover */
}

/* Upload controls with enhanced styling */
#upload-controls {
    display: flex;
    justify-content: center;
}

#upload-btn {
    background-color: #98971a; /* Gruvbox green */
    color: #fbf1c7; /* Light text for contrast */
    border: none;
    padding: 12px 18px;
    cursor: pointer;
    border-radius: 5px;
    font-size: 1em;
    font-weight: bold;
    transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

#upload-btn:hover {
    background-color: #b8bb26; /* Gruvbox bright green */
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

#upload-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* Empty state styling for sections */
#image-gallery:empty::before {
    content: "Click here to paste images or use Upload button";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #a89984; /* Gruvbox fg4 (dim) */
    font-size: 0.9em;
    text-align: center;
    width: 90%;
    pointer-events: none;
}

#useful-links-list:empty::before {
    content: "No links added yet";
    display: block;
    color: #a89984;
    text-align: center;
    padding: 20px 0;
    font-style: italic;
}

/* Menu style container */
.section-content.menu-style {
    background-color: #32302f;
    border-radius: 8px;
    padding: 10px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.2);
    margin-top: 5px;
    transition: all 0.3s ease;
}

/* Menu items with hover effects */
.menu-item {
    margin-bottom: 12px;
    border-radius: 8px;
    overflow: hidden;
    background-color: #3c3836;
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.menu-item:hover {
    transform: translateX(2px);
    box-shadow: 0 2px 5px rgba(0,0,0,0.25);
}

.menu-item:last-child {
    margin-bottom: 0;
}

/* Menu headers with enhanced interaction */
.menu-header {
    display: flex;
    align-items: center;
    padding: 15px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    background-color: #3c3836;
}

.menu-header:hover {
    background-color: #504945;
}

/* Menu icons with styling */
.menu-icon {
    font-size: 1.4em;
    margin-right: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background-color: rgba(152, 151, 26, 0.15); /* Subtle gruvbox green background */
    border-radius: 50%;
    transition: transform 0.2s ease, background-color 0.2s ease;
}
    
.menu-header:hover .menu-icon {
    transform: scale(1.1);
    background-color: rgba(152, 151, 26, 0.25); /* Brighter on hover */
}

/* Menu header titles */
.menu-header h4 {
    flex-grow: 1;
    margin: 0;
    color: #8ec07c; /* Gruvbox bright aqua */
    font-size: 1.1em;
    transition: color 0.2s ease;
}

.menu-header:hover h4 {
    color: #fabd2f; /* Change to bright yellow on hover */
}

/* Toggle buttons in menu headers */
.menu-header .section-toggle-btn {
    padding: 0;
    margin: 0;
    color: #a89984;
    transition: transform 0.3s ease, color 0.3s ease;
    font-size: 1.2em;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.menu-header:hover .section-toggle-btn {
    color: #ebdbb2;
}

.menu-header .section-toggle-btn.collapsed {
    transform: rotate(0deg);
}

/* Menu content with smooth animations */
.menu-content {
    padding: 18px;
    border-top: 1px solid #504945;
    background-color: #282828;
    max-height: 1000px;
    overflow: hidden;
    transition: max-height 0.4s ease-in-out, opacity 0.3s ease-in-out, padding 0.3s ease;
    opacity: 1;
}

.menu-content.collapsed {
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
    opacity: 0;
    border-top: none;
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
    .menu-header {
        padding: 12px;
    }

    .menu-icon {
        font-size: 1.2em;
        width: 32px;
        height: 32px;
        margin-right: 10px;
    }

    .menu-content {
        padding: 15px 12px;
    }
    
    .menu-header h4 {
        font-size: 1em;
    }
}

/* Mobile Swipe Navigation Indicator */
.swipe-indicator {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 12px 20px;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 500;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    white-space: nowrap;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.swipe-indicator.show {
    opacity: 1;
}

.swipe-indicator.swipe-left {
    animation: swipeLeftAnimation 1.5s ease;
}

.swipe-indicator.swipe-right {
    animation: swipeRightAnimation 1.5s ease;
}

@keyframes swipeLeftAnimation {
    0% {
        transform: translate(-50%, -50%) translateX(50px);
        opacity: 0;
    }
    20% {
        opacity: 1;
        transform: translate(-50%, -50%) translateX(0);
    }
    80% {
        opacity: 1;
        transform: translate(-50%, -50%) translateX(0);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -50%) translateX(-50px);
    }
}

@keyframes swipeRightAnimation {
    0% {
        transform: translate(-50%, -50%) translateX(-50px);
        opacity: 0;
    }
    20% {
        opacity: 1;
        transform: translate(-50%, -50%) translateX(0);
    }
    80% {
        opacity: 1;
        transform: translate(-50%, -50%) translateX(0);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -50%) translateX(50px);
    }
}

/* Voice Recording Button */
.voice-btn {
    background: var(--accent-color) !important;
    color: white !important;
    border-radius: 50% !important;
    width: 40px !important;
    height: 40px !important;
    font-size: 18px !important;
    transition: all 0.3s ease !important;
}

.voice-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(251, 73, 52, 0.3);
}

.voice-btn.recording {
    background: #ff4444 !important;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 68, 68, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(255, 68, 68, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(255, 68, 68, 0);
    }
}

.swipe-indicator.voice-message {
    background: rgba(251, 73, 52, 0.9);
}

/* Enhanced touch targets for mobile */
@media (max-width: 768px) {
    .sidebar-toggle-btn-header,
    .manual-save-btn,
    .menu-toggle-btn {
        min-height: 44px;
        min-width: 44px;
        touch-action: manipulation;
    }
    
    .main-content {
        touch-action: pan-y;
        overflow-x: hidden;
    }
    
    /* Improve button spacing for touch */
    .content-header button {
        margin: 0 4px;
    }
    
    .voice-btn {
        min-height: 44px !important;
        min-width: 44px !important;
    }
    
    /* Touch-optimized image gallery */
    .gallery-item {
        cursor: pointer;
        transition: transform 0.2s ease;
        border-radius: 8px;
        overflow: hidden;
    }
    
    .gallery-item:active {
        transform: scale(0.95);
    }
    
    #fullscreen-image-src {
        user-select: none;
        -webkit-user-select: none;
        touch-action: none;
        cursor: grab;
        transition: transform 0.1s ease-out;
    }
    
    #fullscreen-image-src:active {
        cursor: grabbing;
    }
    
    .zoom-controls {
        position: fixed;
        bottom: 20px;
        right: 20px;
        display: flex;
        gap: 10px;
        z-index: 10001;
    }
    
    .zoom-controls button {
        background: rgba(0, 0, 0, 0.7);
        color: white;
        border: none;
        border-radius: 50%;
        width: 50px;
        height: 50px;
        font-size: 20px;
        cursor: pointer;
        transition: all 0.3s ease;
        backdrop-filter: blur(10px);
        touch-action: manipulation;
    }
    
    .zoom-controls button:hover {
        background: rgba(0, 0, 0, 0.9);
        transform: scale(1.1);
    }
    
    .zoom-controls button:active {
        transform: scale(0.95);
    }
    
    /* Mobile keyboard handling */
    body.keyboard-open .mobile-watermark {
        display: none;
    }
    
    body.keyboard-open .main-content {
        padding-bottom: 20px;
    }
    
    /* iOS safe area handling */
    @supports (padding: max(0px)) {
        .content-header,
        .sidebar {
            padding-top: max(env(safe-area-inset-top), 20px);
        }
        
        .main-content {
            padding-bottom: max(env(safe-area-inset-bottom), 20px);
        }
    }
    
    /* Improved touch feedback */
    button, .format-btn, .country-menu-btn {
        -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
    }
    
    /* Smooth scrolling for better mobile experience */
    * {
        scroll-behavior: smooth;
    }
}