/**
 * Pactec Localization Plugin Styles
 * Version: 1.1.1
 */

/* Region Selector Container */
.pactec-region-selector {
    display: inline-flex;
    align-items: center;
    gap: 20px;
    padding: 10px;
    background: transparent;
    border: none;
    box-shadow: none;
}

/* Individual Region Buttons */
.pactec-region-button {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    background: transparent;
    border: none;
    padding: 8px;
    opacity: 0.5;
    filter: grayscale(100%);
}

.pactec-region-button:hover {
    opacity: 0.8;
    filter: grayscale(50%);
    transform: scale(1.05);
}

.pactec-region-button.active {
    opacity: 1;
    filter: grayscale(0%);
}

/* Flag Icons */
.flag-icon {
    width: auto;
    height: auto;
    max-width: 50px;
    max-height: 50px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    transition: all 0.3s ease;
    margin-bottom: 4px;
}

/* Region Labels */
.region-label {
    font-size: 15px;
    font-weight: 600;
    color: white;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    font-family: 'Roboto', sans-serif;
    font-weight: 900;
}

.pactec-region-button.active .region-label {
    color: white;
}

/* Responsive Design */
@media (max-width: 768px) {
    .pactec-region-selector {
        gap: 15px;
        padding: 8px;
    }
    
    .pactec-region-button {
        padding: 6px;
    }
    
    .flag-icon {
        max-width: 40px;
        max-height: 40px;
    }
    
    .region-label {
        font-size: 11px;
    }
}

@media (max-width: 480px) {
    .pactec-region-selector {
        gap: 12px;
        padding: 6px;
    }
    
    .pactec-region-button {
        padding: 4px;
    }
    
    .flag-icon {
        max-width: 35px;
        max-height: 35px;
    }
    
    .region-label {
        font-size: 10px;
    }
}

/* Content Visibility Classes */
/* These classes are just selectors for JavaScript - no display rules */
.display-us,
.display-uk,
.display-int {
    /* No default display rules - let JavaScript control via show/hide classes */
}

/* Initial state before JavaScript takes over */
/* Show US content by default */
.display-us {
    display: block;
}

.display-us.pactec-hide {
    display: none !important;
}

/* Hide UK and International content by default */
.display-uk,
.display-int {
    display: none;
}

.display-uk.pactec-show,
.display-int.pactec-show {
    display: block !important;
}

/* JavaScript-controlled visibility classes */
.pactec-hide {
    display: none !important;
}

.pactec-show {
    display: block !important;
}

/* Loading State */
.pactec-region-selector.loading {
    opacity: 0.6;
    pointer-events: none;
}

.pactec-region-selector.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 16px;
    margin: -8px 0 0 -8px;
    border: 2px solid #007cba;
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: pactec-spin 0.8s linear infinite;
}

@keyframes pactec-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Tooltip styles for accessibility */
.pactec-region-button::before {
    content: attr(title);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    pointer-events: none;
    z-index: 1000;
    margin-bottom: 5px;
}

.pactec-region-button::after {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 4px solid transparent;
    border-top-color: rgba(0, 0, 0, 0.8);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    pointer-events: none;
    z-index: 1000;
    margin-bottom: 1px;
}

/* .pactec-region-button:hover::before,
.pactec-region-button:hover::after {
    opacity: 1;
    visibility: visible;
} */

.flag-icon:not([src]) {
    background: #f0f0f0;
    position: relative;
}

.flag-icon:not([src])::after {
    content: '?';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 14px;
    color: #999;
}
