/**
 * Custom Currency Selector Styles
 * Provides better UX for currency selection dropdown
 * Version 2.1 - Added mobile side panel support
 */

/* Container */
.wmc-custom-selector {
    position: relative;
    font-family: 'Savoy', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.wmc-custom-dropdown {
    position: relative;
    width: 100%;
    max-width: 320px;
}

/* Current Selection Display */
.wmc-custom-current {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 3px 10px;
    /* background: #fff; */
    /* border: 1px solid #ddd; */
    /* border-radius: 8px; */
    cursor: pointer;
    transition: all 0.3s ease;
    user-select: none;
    border: none;
    background: transparent;
}

.wmc-custom-current:hover {
    /* border-color: #999; */
    /* box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); */
    border: none;
    box-shadow: none;
}

.wmc-custom-current:focus {
    outline: none;
    /* border-color: #0073aa; */
    /* box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.1); */
    border: none;
    box-shadow: none;
}
.whb-general-header .wmc-custom-current {
    color:white;

}
@media (min-width: 1025px) {
    .home .whb-header .whb-main-header .wmc-custom-current, .home .whb-main-header .wmc-custom-current{
        background: none;
        color: white;
    }
    .home .whb-header.hover .whb-main-header .wmc-custom-current, .home .whb-sticked.whb-main-header .wmc-custom-current{
        background: #f5f5f4;
        color: #333;
    }
}


/* Flag Icon */
.wmc-custom-flag {
    display: none;
    flex-shrink: 0;
    width: 24px;
    height: 16px;
    /* display: flex; */
    align-items: center;
    justify-content: center;
}

.wmc-custom-flag .vi-flag-64 {
    transform: scale(0.4);
    display: block;
}

/* Text Content */
.wmc-custom-text {
    flex: 1;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 4px;
    min-width: 0;
}

.wmc-custom-country {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.4;
}
.home  .wmc-custom-country {
    color: white;
}
.home header.hover .wmc-custom-country {
    color: #555656;
}

.wmc-mobile-panel-content .wmc-custom-country {
    color: #555656;
}

.wmc-custom-code {
    font-size: 12px;
    color: #666;
    white-space: nowrap;
    line-height: 1.4;
}

.home  .wmc-custom-code {
    color: white;
}
.home header.hover .wmc-custom-code {
    color: #555656;
}
.wmc-mobile-panel-content .wmc-custom-code {
    color: #555656;
}

/* Arrow Icon */
.wmc-custom-arrow {
    flex-shrink: 0;
    font-size: 10px;
    color: #999;
    transition: transform 0.3s ease;
}

.wmc-custom-dropdown.wmc-custom-open .wmc-custom-arrow {
    transform: rotate(180deg);
}

/* Remove border/shadow when dropdown is open */
.wmc-custom-dropdown.wmc-custom-open .wmc-custom-current {
    border: none;
    box-shadow: none;
}

/* Dropdown Options Container */
.wmc-custom-options {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    animation: wmcSlideDown 0.2s ease;
}

@keyframes wmcSlideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Custom Scrollbar */
.wmc-custom-options::-webkit-scrollbar {
    width: 8px;
}

.wmc-custom-options::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.wmc-custom-options::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 4px;
}

.wmc-custom-options::-webkit-scrollbar-thumb:hover {
    background: #999;
}

/* Individual Option */
.wmc-custom-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    border-bottom: 1px solid #f5f5f5;
}

.wmc-custom-option:last-child {
    border-bottom: none;
}

.wmc-custom-option:hover {
    background-color: #f8f9fa;
}

.wmc-custom-option.wmc-custom-selected {
    background-color: #e8f4f8;
}

.wmc-custom-option.wmc-custom-selected:hover {
    background-color: #d4ebf5;
}

/* Check Mark for Selected Item */
.wmc-custom-check {
    flex-shrink: 0;
    color: #0073aa;
    font-size: 16px;
    font-weight: bold;
    margin-left: auto;
}

/* Hidden Native Select */
.wmc-custom-hidden {
    position: absolute;
    opacity: 0;
    pointer-events: none;
    width: 0;
    height: 0;
}

/* Loading State */
.wmc-custom-dropdown.wmc-currency-loading .wmc-custom-current {
    opacity: 0.6;
    pointer-events: none;
}

.wmc-custom-dropdown.wmc-currency-loading .wmc-custom-current::after {
    content: '';
    position: absolute;
    right: 16px;
    width: 16px;
    height: 16px;
    border: 2px solid #ddd;
    border-top-color: #0073aa;
    border-radius: 50%;
    animation: wmcSpin 0.6s linear infinite;
}

@keyframes wmcSpin {
    to {
        transform: rotate(360deg);
    }
}

/* ============================================
   MOBILE SIDE PANEL STYLES
   ============================================ */

/* Mobile Panel Container (Similar to mobile-nav) */
.wmc-mobile-panel {
    position: fixed !important;
    top: 0;
    bottom: 0;
    width: 320px;
    max-width: 90%;
    background: #fff;
    z-index: 1050;
    overflow-y: auto;
    transition: transform 0.4s cubic-bezier(0.645, 0.045, 0.355, 1);
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.15);
    visibility: hidden;
}

/* Left side positioning */
.wmc-mobile-panel.wd-left {
    left: 0;
    transform: translateX(-100%);
}

/* Opened state */
.wmc-mobile-panel.wd-opened {
    transform: translateX(0) !important;
    visibility: visible !important;
}

/* Panel Header */
.wmc-mobile-panel .wd-heading {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 15px 20px;
    border-bottom: 1px solid #e0e0e0;
    background: #f8f9fa;
}

/* Close Button */
.wmc-mobile-panel .close-side-widget {
    cursor: pointer;
    font-size: 14px;
    color: #333;
    transition: color 0.3s ease;
}

.wmc-mobile-panel .close-side-widget:hover {
    color: #000;
}

.wmc-mobile-panel .close-side-widget a {
    color: inherit;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 5px;
}

.wmc-mobile-panel .close-side-widget a::before {
    content: "✕";
    font-size: 18px;
    font-weight: 300;
}

/* Panel Content */
.wmc-mobile-panel-content {
    padding: 20px;
}

/* Panel Title */
.wmc-mobile-panel-title {
    margin-bottom: 20px;
}

.wmc-mobile-panel-title h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

/* Mobile Options List */
.wmc-mobile-options {
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* Mobile Option Item */
.wmc-mobile-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px 12px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    border-bottom: 1px solid #f0f0f0;
}

.wmc-mobile-option:last-child {
    border-bottom: none;
}

.wmc-mobile-option:hover {
    background-color: #f8f9fa;
}

.wmc-mobile-option.wmc-mobile-selected {
    background-color: #e8f4f8;
}

.wmc-mobile-option.wmc-mobile-selected:hover {
    background-color: #d4ebf5;
}

/* Mobile Option Text */
.wmc-mobile-option .wmc-custom-country {
    font-size: 15px;
    font-weight: 600;
}

.wmc-mobile-option .wmc-custom-code {
    font-size: 13px;
}

/* Overlay Background (Similar to wd-close-side) */
.wmc-mobile-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1049;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.wmc-mobile-overlay.wmc-overlay-visible {
    opacity: 1;
    visibility: visible;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

/* Desktop: Show dropdown, hide mobile panel trigger */
@media (min-width: 769px) {
    .wmc-mobile-panel {
        display: none !important;
    }

    .wmc-mobile-overlay {
        display: none !important;
    }


}

/* Mobile: Hide dropdown, show mobile panel */
@media (max-width: 768px) {
    .wmc-custom-dropdown {
        max-width: 100%;
    }

    .wmc-custom-current,
    .wmc-custom-option {
        padding: 10px 12px;
    }

    .wmc-custom-country {
        font-size: 13px;
    }

    .wmc-custom-code {
        font-size: 11px;
    }

    /* Hide desktop dropdown on mobile */
    .wmc-custom-options.wmc-desktop-only {
        display: none !important;
    }

    /* Mobile panel is shown via JavaScript */
    .wmc-mobile-panel {
        display: block;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .wmc-custom-current,
    .wmc-custom-options {
        background: #2d2d2d;
        border-color: #444;
    }

    .wmc-custom-current:hover {
        border-color: #666;
    }

    .wmc-custom-country {
        color: #e0e0e0;
    }

    .wmc-custom-code {
        color: #aaa;
    }

    .wmc-custom-option:hover {
        background-color: #3a3a3a;
    }

    .wmc-custom-option.wmc-custom-selected {
        background-color: #1e3a4a;
    }

    .wmc-custom-option.wmc-custom-selected:hover {
        background-color: #2a4a5a;
    }

    .wmc-custom-options::-webkit-scrollbar-track {
        background: #1a1a1a;
    }

    .wmc-custom-options::-webkit-scrollbar-thumb {
        background: #555;
    }

    .wmc-custom-options::-webkit-scrollbar-thumb:hover {
        background: #777;
    }

    /* Mobile panel dark mode */
    .wmc-mobile-panel {
        background: #2d2d2d;
    }

    .wmc-mobile-panel .wd-heading {
        background: #1a1a1a;
        border-color: #444;
    }

    .wmc-mobile-panel .close-side-widget {
        color: #e0e0e0;
    }

    .wmc-mobile-panel-title h3 {
        color: #e0e0e0;
    }

    .wmc-mobile-option {
        border-color: #444;
    }

    .wmc-mobile-option:hover {
        background-color: #3a3a3a;
    }

    .wmc-mobile-option.wmc-mobile-selected {
        background-color: #1e3a4a;
    }
}

/* Accessibility */
.wmc-custom-current:focus-visible {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

.wmc-custom-option:focus {
    outline: none;
    background-color: #f0f0f0;
}

/* RTL Support */
[dir="rtl"] .wmc-custom-text {
    text-align: right;
}

[dir="rtl"] .wmc-custom-check {
    margin-left: 0;
    margin-right: auto;
}

[dir="rtl"] .wmc-mobile-panel.wd-left {
    left: auto;
    right: 0;
    transform: translateX(100%);
}

[dir="rtl"] .wmc-mobile-panel.wd-left.wd-opened {
    transform: translateX(0);
}
