.input-group {
    margin-bottom: 1.8rem;
}

label {
    display: block;
    margin-bottom: 0.8rem;
    font-weight: 600;
    font-family: 'Poppins', sans-serif;
    color: var(--text-color);
}

label i {
    margin-right: 8px;
    color: var(--accent-color);
}

select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    font-size: 1rem;
    background-color: white;
    font-family: 'Quicksand', sans-serif;
    font-weight: 500;
    transition: all 0.3s ease;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23FF5D73'%3E%3Cpath d='M7 10l5 5 5-5H7z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 15px center;
    background-size: 20px;
}

select:hover, select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(255, 93, 115, 0.2);
    outline: none;
}

/* Checkbox container */
.checkbox-container {
    max-height: 300px;
    overflow-y: auto;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    padding: 15px;
    background-color: white;
    transition: all 0.3s ease;
}

.checkbox-container:hover {
    border-color: var(--secondary-color);
}

/* Search box (shared styles) */
.search-box,
#inline-country-search {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    font-family: 'Quicksand', sans-serif;
    font-size: 1rem;
    transition: all 0.3s ease;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%2331B5FF'%3E%3Cpath d='M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 15px center;
    background-size: 20px;
    padding-right: 45px;
    background-color: white;
}

.search-box { /* Specific style for general search boxes in visa list */
    margin-bottom: 15px;
}

.search-box:hover, .search-box:focus,
#inline-country-search:hover, #inline-country-search:focus {
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(49, 181, 255, 0.2);
    outline: none;
}

/* Checkbox items */
.checkbox-item {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    padding: 8px 12px;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.checkbox-item:hover {
    background-color: rgba(49, 181, 255, 0.1);
}

.checkbox-item input[type="checkbox"] {
    margin-right: 10px;
    cursor: pointer;
    width: 18px;
    height: 18px;
    accent-color: var(--secondary-color);
}

.checkbox-item label {
    margin-bottom: 0;
    font-weight: 500;
    cursor: pointer;
}

/* Passport selection notice */
.select-passport-notice {
    text-align: center;
    color: var(--text-light);
    padding: 15px;
    font-style: italic;
}

.disabled-container {
    opacity: 0.6;
    pointer-events: none;
}

/* Results header */
.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.8rem;
}

.results-header h2 {
    margin-bottom: 0;
    color: var(--secondary-color);
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.results-header h2 i {
    margin-right: 10px;
    animation: float 3s ease-in-out infinite;
    color: var(--accent-color);
}

/* Disclaimer tooltip styling */
.disclaimer-tooltip {
    position: relative;
    cursor: help;
}

.disclaimer-tooltip i {
    color: var(--text-light);
    font-size: 0.8em;
    margin-right: 0;
    animation: none;
}

.disclaimer-tooltip .tooltip-text {
    visibility: hidden;
    width: 250px;
    background-color: rgba(45, 55, 72, 0.95);
    color: white;
    text-align: center;
    border-radius: 6px;
    padding: 10px;
    position: absolute;
    z-index: 100;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 0.8rem;
    font-weight: normal;
    font-family: 'Quicksand', sans-serif;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    pointer-events: none;
    line-height: 1.5;
}

.disclaimer-tooltip .tooltip-text::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: rgba(45, 55, 72, 0.95) transparent transparent transparent;
}

.disclaimer-tooltip:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}

/* View toggle */
.view-toggle {
    display: flex;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    overflow: hidden;
}

.view-btn {
    padding: 10px;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    position: relative;
}

.view-btn i {
    transition: transform 0.3s ease;
}

.view-btn:hover i {
    transform: scale(1.15);
}

.view-btn.active {
    background: linear-gradient(135deg, var(--secondary-color), #2C9CFF);
    color: white;
}

/* Tooltip effect for view-btn and search-tab-btn */
.view-btn:hover::after,
.search-tab-btn:hover::after {
    content: attr(title);
    position: absolute;
    bottom: -30px;
    left: 50%;
    transform: translateX(-50%);
    padding: 5px 10px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border-radius: 4px;
    font-size: 0.75rem;
    white-space: nowrap;
    pointer-events: none;
    font-family: 'Quicksand', sans-serif;
    z-index: 10;
}

/* Result tabs */
.results-tabs {
    display: flex;
    margin-bottom: 1.8rem;
    border-bottom: 2px solid var(--border-color);
    align-items: center;
}

/* Category header styles (Tab buttons) */
.tab-btn {
    background: none;
    border: none;
    padding: 12px 20px;
    font-size: 1rem;
    cursor: pointer;
    opacity: 0.7;
    position: relative;
    transition: all 0.3s ease;
    font-family: 'Poppins', sans-serif;
    font-weight: 500;
    border-bottom: 3px solid transparent;
}

.tab-btn:hover {
    opacity: 0.9;
}

.tab-btn[data-type="all"] {
    color: var(--text-color);
    border-color: var(--text-light);
}

.tab-btn[data-type="visa-free"] {
    color: var(--success-color);
    border-color: var(--success-color);
}

.tab-btn[data-type="visa-on-arrival"] {
    color: var(--accent-color);
    border-color: var(--accent-color);
}

.tab-btn[data-type="e-visa"] {
    color: var(--secondary-color);
    border-color: var(--secondary-color);
}

.tab-btn.active {
    opacity: 1;
    font-weight: 600;
    border-bottom: 3px solid currentColor;
}

.tab-btn.active::after { /* This seems to duplicate the border-bottom: 3px solid currentColor; consider removing if redundant */
    content: '';
    position: absolute;
    bottom: -2px; /* Adjust if border is 3px */
    left: 0;
    width: 100%;
    height: 3px;
    background-color: var(--secondary-color); /* This color might conflict with currentColor border */
    animation: fadeIn 0.3s ease;
}


/* Search button in tabs */
#search-countries-btn { /* ID selector for the search button itself */
    position: relative; /* Kept from previous refactor */
}
#search-countries-btn:hover i { 
    color: var(--secondary-color);
}

.search-tab-btn { /* Class selector for general styling of search button in tabs */
    background: none;
    border: none;
    padding: 12px 15px;
    margin-left: auto;
    font-size: 1rem;
    cursor: pointer;
    opacity: 0.7;
    transition: all 0.3s ease;
    color: var(--secondary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 2;
}

.search-tab-btn i {
    font-size: 1.1rem;
    pointer-events: none;
}

/* Passport search container styling */
.passport-search-container {
    position: relative;
    margin-bottom: 15px; /* This was on .search-box, ensure it's intended here or on #passport-search */
}

#passport-search { /* ID for the passport search input, inherits from .search-box */
    margin-bottom: 0; /* Overrides margin from .search-box if not desired */
}


.passport-results {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    max-height: 250px;
    overflow-y: auto;
    background-color: white;
    border: 2px solid var(--border-color);
    border-top: none;
    border-radius: 0 0 10px 10px;
    box-shadow: var(--shadow-soft);
    z-index: 100;
}

.passport-country-item {
    padding: 12px 15px;
    cursor: pointer;
    transition: all 0.2s ease;
    border-bottom: 1px solid var(--border-color);
    font-family: 'Quicksand', sans-serif;
}

.passport-country-item:last-child {
    border-bottom: none;
}

.passport-country-item:hover {
    background-color: rgba(49, 181, 255, 0.1);
}

.no-results {
    padding: 12px 15px;
    color: var(--text-light);
    text-align: center;
    font-style: italic;
}

/* Country count display */
.country-count-display {
    font-size: 0.95rem;
    color: var(--text-light);
    margin-bottom: 1.5rem;
    text-align: left;
    padding-left: 5px;
    font-weight: 500;
}

/* View container */
.view-container {
    position: relative;
    min-height: 400px;
}

.view-content {
    display: none;
    opacity: 0;
}

.view-content.active {
    display: block;
    animation: fadeIn 0.5s ease forwards;
}

/* Country grid */
.country-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 15px;
    animation: fadeIn 0.5s ease;
}

/* Country card types */
.country-card {
    background-color: #f8f9fa;
    border-radius: 12px;
    padding: 20px 15px;
    text-align: center;
    border: 2px solid var(--border-color);
    transition: all 0.3s ease;
    font-weight: 500;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-soft);
}

.country-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.country-card:hover {
    transform: translateY(-7px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.08);
}

.country-card:hover::before {
    opacity: 1;
}

.country-card span {
    font-family: 'Poppins', sans-serif;
    font-weight: 500;
}

/* Country card tooltip */
.country-tooltip {
    display: none;
    position: absolute;
    bottom: 120%;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(45, 55, 72, 0.95);
    color: white;
    padding: 12px;
    border-radius: 8px;
    font-size: 0.8rem;
    width: 220px;
    z-index: 100;
    font-family: 'Quicksand', sans-serif;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    pointer-events: none;
    line-height: 1.5;
    text-align: left;
}

.country-tooltip::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -8px;
    border-width: 8px;
    border-style: solid;
    border-color: rgba(45, 55, 72, 0.95) transparent transparent transparent;
}

.country-tooltip p {
    margin: 5px 0;
    white-space: normal;
}

.country-tooltip .tooltip-label {
    font-weight: 600;
    color: var(--accent-color);
}

.country-card:hover .country-tooltip {
    display: block;
    animation: fadeIn 0.3s ease-in-out;
}

/* Color coded cards */
.visa-free-card {
    background-color: rgba(72, 187, 120, 0.1);
    border-color: var(--success-color);
}
.visa-free-card::before { background: var(--success-color); opacity: 1; }
.visa-free-card:hover { box-shadow: 0 10px 20px rgba(72, 187, 120, 0.15); }

.visa-on-arrival-card {
    background-color: rgba(255, 179, 71, 0.1);
    border-color: var(--accent-color);
}
.visa-on-arrival-card::before { background: var(--accent-color); opacity: 1; }
.visa-on-arrival-card:hover { box-shadow: 0 10px 20px rgba(255, 179, 71, 0.15); }

.e-visa-card {
    background-color: rgba(49, 181, 255, 0.1);
    border-color: var(--secondary-color);
}
.e-visa-card::before { background: var(--secondary-color); opacity: 1; }
.e-visa-card:hover { box-shadow: 0 10px 20px rgba(49, 181, 255, 0.15); }

/* Country card with flag background */
.country-card.with-flag-bg {
    position: relative;
    overflow: hidden;
    z-index: 1;
}
.country-card.with-flag-bg::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-image: var(--flag-url, none);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0.08;
    z-index: -1;
    pointer-events: none;
    border-radius: 6px;
    filter: saturate(0.8);
}
.country-card.with-flag-bg:hover::after { opacity: 0.18; }
.country-card.with-flag-bg span {
    position: relative;
    z-index: 1;
    text-shadow: 0 0 3px rgba(255, 255, 255, 0.7);
}

/* Empty state */
.empty-state {
    text-align: center;
    color: var(--text-light);
    padding: 3rem 0;
    font-family: 'Quicksand', sans-serif;
    font-size: 1.1rem;
    animation: pulse 2s infinite ease-in-out;
}

/* Map styling */
#world-map {
    height: 400px;
    background-color: #f8f9fa;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: var(--shadow-soft);
    transition: all 0.3s ease;
}
#world-map:hover { box-shadow: var(--shadow-medium); }

.jqvmap-label {
    padding: 10px 12px;
    border-radius: 8px;
    background: #2D3748;
    color: white;
    font-family: 'Quicksand', sans-serif;
    font-size: 12px;
    border: none;
}

/* Map legend */
.map-legend {
    display: flex;
    justify-content: center;
    margin-top: 20px;
    flex-wrap: wrap;
}
.legend-item {
    display: flex;
    align-items: center;
    margin: 0 12px 12px 0;
    font-family: 'Quicksand', sans-serif;
    font-weight: 500;
}
.color-box {
    width: 18px;
    height: 18px;
    margin-right: 8px;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}
.color-box.visa-free { background-color: var(--success-color); }
.color-box.visa-on-arrival { background-color: var(--accent-color); }
.color-box.e-visa { background-color: var(--secondary-color); }
.color-box.no-access { background-color: #CBD5E0; }


/* Update the highlight styles for search results */
.country-highlight {
    background-color: inherit !important;
    transform: none;
    border-color: var(--border-color) !important;
    box-shadow: var(--shadow-soft);
    z-index: 10;
}
.country-highlight span { position: relative; }
.country-highlight .match {
    text-decoration: underline;
    text-decoration-color: #FFC107;
    text-decoration-thickness: 2px;
    font-weight: 600;
}

/* For map highlighting, keep the original style */
.map-highlight {
    filter: brightness(1.3);
    stroke-width: 1.5;
    stroke: #FFC107;
}

/* Inline search container */
.inline-search-container {
    display: none; /* Hidden by default */
    width: 100%;
    position: relative;
    animation: fadeIn 0.3s ease;
}
.inline-search-container.active { display: flex; }

#inline-country-search { /* Specific layout for inline search input */
    flex: 1;
    /* Common appearance styles are inherited from .search-box */
}

#close-inline-search-btn {
    position: absolute;
    right: 40px; /* This might need adjustment if padding-right on input is 45px */
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 5px;
    border-radius: 50%;
    transition: background-color 0.2s ease;
    z-index: 2;
}
#close-inline-search-btn:hover {
    background-color: rgba(0, 0, 0, 0.05);
    color: var(--text-color);
}

/* Make tab buttons and search button hidden when search is active */
.results-tabs.search-active .tab-btn,
.results-tabs.search-active .search-tab-btn { /* .search-tab-btn is the class for #search-countries-btn */
    display: none !important;
}
.results-tabs.search-active {
    border-bottom: none;
    margin-bottom: 1.2rem; /* Adjusted from 1.8rem when tabs are hidden */
}
