/**
 * Country Popup Styles
 * Clean, minimal design matching search popup - click outside to close
 */

/* Popup Container */
.bf-country-popup {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 15vh;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.2s ease, visibility 0s 0.2s;
}

.bf-country-popup.is-open {
    visibility: visible;
    opacity: 1;
    transition: opacity 0.2s ease, visibility 0s;
}

/* Overlay - click to close */
.bf-country-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    cursor: pointer;
}

/* Modal Container */
.bf-country-modal {
    position: relative;
    width: 90%;
    max-width: 700px;
    background: #1a1a1a;
    border-radius: 12px;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.1), 0 0 40px rgba(126, 217, 87, 0.3), 0 20px 60px rgba(0, 0, 0, 0.5);
    overflow: hidden;
}

/* Header */
.bf-country-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.bf-country-icon {
    flex-shrink: 0;
    color: var(--bf-color-primary, #7ed957);
}

.bf-country-title {
    font-size: 16px;
    font-weight: 600;
    color: #fff;
}

/* Country Grid */
.bf-country-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    padding: 12px;
    max-height: 60vh;
    overflow-y: auto;
}

/* Country Item */
.bf-country-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 8px;
    text-decoration: none;
    color: #fff;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.bf-country-item:hover,
.bf-country-item:focus {
    background: rgba(126, 217, 87, 0.1);
    border-color: rgba(126, 217, 87, 0.3);
    transform: translateY(-2px);
    outline: none;
}

/* Flag */
.bf-country-flag {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    border-radius: 50%;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.bf-country-flag svg {
    width: 100%;
    height: 100%;
    display: block;
}

/* Country Info */
.bf-country-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.bf-country-name {
    font-size: 14px;
    font-weight: 600;
    color: #fff;
}

.bf-country-domain {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
}

/* Tablet - 3 columns */
@media (min-width: 600px) {
    .bf-country-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Desktop - 4 columns */
@media (min-width: 800px) {
    .bf-country-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .bf-country-item {
        flex-direction: column;
        text-align: center;
        padding: 16px 12px;
    }

    .bf-country-flag {
        width: 48px;
        height: 48px;
    }

    .bf-country-info {
        align-items: center;
    }
}

/* Mobile */
@media (max-width: 640px) {
    .bf-country-popup {
        padding-top: 10vh;
    }

    .bf-country-modal {
        width: 95%;
        max-width: none;
        margin: 0 10px;
    }

    .bf-country-header {
        padding: 14px 16px;
        gap: 10px;
    }

    .bf-country-grid {
        grid-template-columns: 1fr;
        gap: 6px;
        padding: 10px;
        max-height: 70vh;
    }

    .bf-country-item {
        padding: 10px 12px;
    }

    .bf-country-flag {
        width: 36px;
        height: 36px;
    }

    .bf-country-name {
        font-size: 13px;
    }

    .bf-country-domain {
        font-size: 11px;
    }
}
