/**
 * DataFirefly Country Switcher - Front CSS
 *
 * @author    DataFirefly
 * @copyright DataFirefly
 * @license   Commercial
 */

/* Container */
.dfcs-country-switcher {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    position: relative;
    font-family: inherit;
}

/* Flags list style */
.dfcs-flags-list {
    display: flex;
    align-items: center;
    gap: 8px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.dfcs-flag-item {
    display: inline-flex;
    align-items: center;
}

.dfcs-flag-item a {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    text-decoration: none;
    color: inherit;
    opacity: 0.7;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.dfcs-flag-item a:hover,
.dfcs-flag-item.dfcs-current a {
    opacity: 1;
}

.dfcs-flag-item a:hover {
    transform: scale(1.1);
}

.dfcs-flag-item.dfcs-current a {
    cursor: default;
}

/* Flag image */
.dfcs-flag {
    display: inline-block;
    border-radius: 2px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
    object-fit: cover;
}

/* Country name */
.dfcs-country-name {
    font-size: 12px;
    white-space: nowrap;
}

/* Dropdown style */
.dfcs-dropdown {
    position: relative;
    display: inline-block;
}

.dfcs-dropdown-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: transparent;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    color: inherit;
    transition: border-color 0.2s ease, background-color 0.2s ease;
}

.dfcs-dropdown-toggle:hover {
    border-color: #999;
    background-color: rgba(0, 0, 0, 0.02);
}

.dfcs-arrow {
    font-size: 10px;
    margin-left: 4px;
    transition: transform 0.2s ease;
}

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

.dfcs-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 1000;
    display: none;
    min-width: 180px;
    max-height: 300px;
    overflow-y: auto;
    margin: 4px 0 0;
    padding: 8px 0;
    list-style: none;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.dfcs-dropdown.open .dfcs-dropdown-menu {
    display: block;
}

.dfcs-dropdown-item a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    text-decoration: none;
    color: #333;
    transition: background-color 0.15s ease;
}

.dfcs-dropdown-item a:hover {
    background-color: #f5f5f5;
}

.dfcs-dropdown-item.dfcs-current a {
    background-color: #e8f4fc;
    font-weight: 600;
}

.dfcs-dropdown-item .dfcs-country-name {
    font-size: 14px;
}

/* Combined style */
.dfcs-style-both .dfcs-dropdown {
    display: none;
}

.dfcs-style-both .dfcs-flags-list {
    display: flex;
}

/* Responsive */
@media (max-width: 768px) {
    .dfcs-style-both .dfcs-dropdown {
        display: inline-block;
    }
    
    .dfcs-style-both .dfcs-flags-list {
        display: none;
    }
    
    .dfcs-flags-list {
        flex-wrap: wrap;
    }
    
    .dfcs-dropdown-menu {
        right: 0;
        left: auto;
    }
}

/* Dark theme support */
@media (prefers-color-scheme: dark) {
    .dfcs-dropdown-toggle {
        border-color: #555;
    }
    
    .dfcs-dropdown-toggle:hover {
        border-color: #777;
        background-color: rgba(255, 255, 255, 0.05);
    }
    
    .dfcs-dropdown-menu {
        background: #2a2a2a;
        border-color: #444;
    }
    
    .dfcs-dropdown-item a {
        color: #eee;
    }
    
    .dfcs-dropdown-item a:hover {
        background-color: #3a3a3a;
    }
    
    .dfcs-dropdown-item.dfcs-current a {
        background-color: #1a3a4a;
    }
}
