/**
 * Countries Display Styles
 * Styles for countries crossed display components
 */

/* Countries Modal */
.countries-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s ease;
}

.countries-modal-content {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
    max-width: 600px;
    max-height: 80vh;
    width: 90%;
    overflow: hidden;
    animation: slideIn 0.3s ease;
}

.countries-modal-header {
    background: rgba(255, 255, 255, 0.1);
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.countries-modal-header h3 {
    margin: 0;
    color: white;
    font-size: 1.4rem;
    font-weight: 600;
}

.countries-modal-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.8rem;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.3s ease;
}

.countries-modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.countries-modal-body {
    padding: 20px;
    max-height: 60vh;
    overflow-y: auto;
    color: white;
}

/* Countries List */
.countries-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
}

.countries-header h4 {
    margin: 0;
    color: #FFD700;
    font-size: 1.2rem;
}

.confidence-badge {
    background: rgba(255, 255, 255, 0.2);
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 0.8rem;
    color: #B0E0E6;
    font-weight: 500;
}

.countries-list {
    max-height: 400px;
    overflow-y: auto;
}

.countries-empty {
    text-align: center;
    color: #888;
    font-style: italic;
    padding: 20px;
}

/* Risk Groups */
.risk-group {
    margin-bottom: 15px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.risk-group-header {
    padding: 10px 15px;
    font-weight: 600;
    font-size: 0.9rem;
    color: white;
    display: flex;
    align-items: center;
    gap: 8px;
}

.risk-critical .risk-group-header {
    background: linear-gradient(135deg, #9C27B0, #7B1FA2);
}

.risk-high .risk-group-header {
    background: linear-gradient(135deg, #F44336, #D32F2F);
}

.risk-medium .risk-group-header {
    background: linear-gradient(135deg, #FF9800, #F57C00);
}

.risk-low .risk-group-header {
    background: linear-gradient(135deg, #4CAF50, #388E3C);
}

.risk-unknown .risk-group-header {
    background: linear-gradient(135deg, #9E9E9E, #757575);
}

.risk-group-countries {
    background: rgba(255, 255, 255, 0.05);
    padding: 10px;
}

/* Country Items */
.country-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    margin-bottom: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    border-left: 4px solid #4CAF50;
    transition: all 0.3s ease;
}

.country-item:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateX(5px);
}

.country-item:last-child {
    margin-bottom: 0;
}

.country-flag {
    font-size: 1.2rem;
    min-width: 24px;
}

.country-name {
    flex: 1;
    font-weight: 500;
    color: white;
}

.country-code {
    background: rgba(255, 255, 255, 0.2);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    color: #B0E0E6;
    font-family: monospace;
    font-weight: 600;
}

/* Route Risk Summary (for table display) */
.route-risk-summary {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.route-risk-summary:hover {
    transform: scale(1.05);
    filter: brightness(1.2);
}

.risk-icon {
    font-size: 1.1rem;
}

.risk-level {
    font-size: 0.8rem;
    font-weight: 700;
}

.country-count {
    opacity: 0.7;
    font-size: 0.7rem;
    font-weight: normal;
}

.risk-unknown {
    color: #9E9E9E;
    font-style: italic;
}

/* Custom Scrollbar */
.countries-modal-body::-webkit-scrollbar,
.countries-list::-webkit-scrollbar {
    width: 8px;
}

.countries-modal-body::-webkit-scrollbar-track,
.countries-list::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.countries-modal-body::-webkit-scrollbar-thumb,
.countries-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
}

.countries-modal-body::-webkit-scrollbar-thumb:hover,
.countries-list::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Loading States */
.countries-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    color: #888;
}

.countries-loading::before {
    content: '';
    width: 20px;
    height: 20px;
    border: 2px solid #333;
    border-top: 2px solid #4CAF50;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 10px;
}

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

/* Responsive Design */
@media (max-width: 768px) {
    .countries-modal-content {
        width: 95%;
        max-height: 85vh;
    }

    .countries-header {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .country-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .route-risk-summary {
        font-size: 0.9rem;
    }
}