/* Custom Properties - Make sure these are defined in your main CSS file or here */
/* If not defined globally, uncomment and place them here: */
:root {
    --clr-bg: #f8f4ed;
    --clr-dark: #001b2E;
    --clr-accent: #f8e462;
    --dark-purple: rgba(0, 27, 46, 0.7);
    --light-green: #faeb85;
}

/* General styles for glass-panel (can be moved to your main CSS if already defined) */
.glass-panel {
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 24px; /* Making it a bit more rounded */
    box-shadow: 0 8px 32px 0 rgba(0, 27, 46, 0.05);
}

/* Location Dropdown Styles */
.location-dropdown-container {
    position: relative;
    display: inline-block;
    font-family: 'Vazirmatn', Tahoma, sans-serif;
}

.location-dropdown-trigger {
    background-color: var(--clr-accent);
    color: var(--clr-dark);
    padding: 10px 15px;
    border: none;
    border-radius: 8px; /* Slightly more rounded corners */
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: bold;
    transition: background-color 0.3s ease, transform 0.2s ease;
    font-size: 0.9em;
}

.location-dropdown-trigger:hover {
    background-color: var(--light-green);
    transform: translateY(-1px); /* Subtle lift effect */
}

.location-dropdown-trigger svg {
    fill: var(--clr-dark);
    width: 18px; /* Slightly larger icon */
    height: 18px;
}

.location-dropdown-menu {
    display: none;
    position: absolute;
    max-height: 300px;
    direction: rtl;
    top: 110%; /* Position it slightly below the button */
    right: 0;
    background-color: var(--clr-bg); /* Default background if glass-panel is not used */
    border: 1px solid rgba(255, 255, 255, 0.6); /* Border consistent with glass */
    border-radius: 12px; /* Rounded corners for the menu itself */
    box-shadow: 0 8px 32px 0 rgba(0, 27, 46, 0.1); /* Adjusted shadow */
    min-width: 280px;
    z-index: 1001; /* Higher z-index */
    padding: 20px;
    box-sizing: border-box;
    overflow: auto; /* Ensure children respect border-radius */
}

/* Applying glass-panel styles explicitly if not globally */
.location-dropdown-menu.glass-panel {
     background: rgba(255, 255, 255, 0.4);
     backdrop-filter: blur(16px);
     -webkit-backdrop-filter: blur(16px);
     border: 1px solid rgba(255, 255, 255, 0.6);
     border-radius: 12px; /* Menu specific radius */
     box-shadow: 0 8px 32px 0 rgba(0, 27, 46, 0.05);
}


.location-dropdown-container.active .location-dropdown-menu {
    display: block;
}

.location-search-input {
    width: 100%;
    padding: 12px 15px;
    margin-bottom: 15px;
    border: 1px solid rgba(255, 255, 255, 0.7); /* Lighter border for input */
    border-radius: 8px;
    box-sizing: border-box;
    font-family: 'Vazirmatn', Tahoma, sans-serif;
    color: var(--clr-dark);
    background-color: rgba(255, 255, 255, 0.6); /* Slightly transparent input background */
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}
.location-search-input:focus {
    outline: none;
    border-color: var(--clr-accent);
    box-shadow: 0 0 0 2px rgba(248, 228, 98, 0.5); /* Accent color focus ring */
}

.location-list-wrapper {
    max-height: 250px; /* Increased height */
    overflow-y: auto;
    padding-right: 5px;
    /* Custom scrollbar styling */
    scrollbar-width: thin;
    scrollbar-color: var(--clr-accent) rgba(255, 255, 255, 0.3);
}
.location-list-wrapper::-webkit-scrollbar {
    width: 8px;
}
.location-list-wrapper::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 10px;
}
.location-list-wrapper::-webkit-scrollbar-thumb {
    background-color: var(--clr-accent);
    border-radius: 10px;
    border: 2px solid transparent;
    background-clip: content-box;
}

.province-list,
.city-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.province-list li,
.city-list li {
    padding: 12px 15px;
    cursor: pointer;
    border-radius: 8px; /* Consistent rounding */
    margin-bottom: 8px; /* More spacing between items */
    transition: background-color 0.2s ease, color 0.2s ease, transform 0.1s ease;
    font-size: 0.95em;
    background-color: transparent; /* Default transparent */
}

.province-list li:hover,
.city-list li:hover {
    background-color: var(--clr-accent);
    color: var(--clr-dark);
    transform: translateX(3px); /* Slight move on hover */
}

.province-list li.selected,
.city-list li.selected {
    background-color: var(--clr-dark);
    color: var(--clr-bg);
    font-weight: bold;
    transform: none; /* Reset transform for selected */
}

.province-list li.selected:hover,
.city-list li.selected:hover {
    background-color: var(--clr-dark); /* Keep dark background for selected */
}

/* Style for when cities are shown */
.location-dropdown-menu.showing-cities .province-list {
    display: none; /* Hide provinces when cities are shown */
}
.location-dropdown-menu.showing-cities .city-list {
    display: block; /* Show cities */
}
