/**
 * Styles for taxonomy region icons
 *
 * @package sky-connect
 */

/* Country flag styles */
.country-flag {
    display: inline-block;
    vertical-align: middle;
    margin-right: 5px;
    border: 1px solid #ddd;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.flag-small {
    max-width: 24px;
    max-height: 16px;
}

.flag-large {
    max-width: 48px;
    max-height: 32px;
}

/* Icon preview in taxonomy form */
.icon-preview {
    padding: 10px;
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-align: center;
}

.icon-preview img {
    max-width: 50px;
    max-height: 30px;
    border: 1px solid #ddd;
}

/* Media uploader buttons */
.media-uploader {
    margin-top: 10px;
}

.upload-icon-button,
.remove-icon-button {
    margin-right: 10px;
}

/* Icon column in taxonomy list */
.column-icon {
    width: 80px;
}

.column-icon img {
    max-width: 30px;
    max-height: 20px;
    border: 1px solid #ddd;
}

/* Country list with flags */
.country-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.country-list li {
    display: flex;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
}

.country-list li:last-child {
    border-bottom: none;
}

.country-list .country-flag {
    margin-right: 10px;
}

.country-list .country-name {
    font-weight: 500;
}

/* Region sections */
.region-section {
    margin-bottom: 30px;
}

.region-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 15px;
    color: #333;
    border-bottom: 2px solid #0073aa;
    padding-bottom: 5px;
}

/* Tab navigation */
.tab-nav {
    display: flex;
    list-style: none;
    padding: 0;
    margin: 0 0 20px 0;
    border-bottom: 2px solid #e0e0e0;
}

.tab-item {
    margin-bottom: -2px;
}

.tab-item a {
    display: block;
    padding: 10px 20px;
    text-decoration: none;
    color: #666;
    border: 2px solid transparent;
    border-bottom: none;
    border-radius: 4px 4px 0 0;
    transition: all 0.3s ease;
}

.tab-item a:hover,
.tab-item.active a {
    color: #0073aa;
    border-color: #e0e0e0;
    background: #f9f9f9;
}

.tab-item.active a {
    border-bottom: 2px solid #fff;
    background: #fff;
}

/* Tab content */
.tab-content {
    background: #fff;
    padding: 20px;
    border: 2px solid #e0e0e0;
    border-top: none;
    border-radius: 0 0 4px 4px;
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
}

/* Countries grid */
.countries-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
}

.country-item {
    display: flex;
    align-items: center;
    padding: 10px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    background: #f9f9f9;
    transition: all 0.3s ease;
}

.country-item:hover {
    background: #f0f0f0;
    border-color: #0073aa;
}

.country-item .country-flag {
    margin-right: 10px;
}

.country-item .country-name {
    font-weight: 500;
}

/* Countries by region columns */
.countries-by-region {
    column-count: 3;
    column-gap: 30px;
}

.region-section {
    break-inside: avoid;
    margin-bottom: 30px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .country-list li {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .country-list .country-flag {
        margin-bottom: 5px;
        margin-right: 0;
    }
    
    .tab-nav {
        flex-wrap: wrap;
    }
    
    .tab-item {
        width: 100%;
    }
    
    .countries-grid {
        grid-template-columns: 1fr;
    }
    
    .countries-by-region {
        column-count: 1;
    }
}

@media (max-width: 480px) {
    .countries-grid {
        grid-template-columns: 1fr;
    }
    
    .tab-item a {
        padding: 8px 12px;
        font-size: 14px;
    }
    
    .tab-content {
        padding: 15px;
    }
}