/* ============================================
   ADMIN COUNTRIES - CSS FLAG ICONS
   ============================================ */

/* Countries Tab Styles */
.countries-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.country-stat-card {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border: 1px solid var(--border);
}

.country-stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
}

.country-stat-icon.total { background: linear-gradient(135deg, #6366f1, #8b5cf6); color: white; }
.country-stat-icon.active { background: linear-gradient(135deg, #10b981, #34d399); color: white; }
.country-stat-icon.inactive { background: linear-gradient(135deg, #ef4444, #f87171); color: white; }

.country-stat-info h3 {
    font-size: 1.3rem;
    font-weight: 700;
    margin: 0;
}

.country-stat-info p {
    font-size: 0.7rem;
    margin: 0;
    color: var(--text-muted);
}

/* Filters Bar */
.countries-filters-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: var(--bg-card);
    border-radius: 16px;
    border: 1px solid var(--border);
}

.filter-group {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.filter-select {
    padding: 0.5rem 1rem;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 0.85rem;
    cursor: pointer;
}

.search-box {
    display: flex;
    align-items: center;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 40px;
    padding: 0.4rem 1rem;
    gap: 0.5rem;
    min-width: 250px;
}

.search-box input {
    border: none;
    background: transparent;
    outline: none;
    width: 100%;
}

.view-toggle {
    display: flex;
    gap: 0.5rem;
}

.view-toggle-btn {
    padding: 0.5rem 1rem;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--bg-primary);
    color: var(--text-secondary);
    cursor: pointer;
}

.view-toggle-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.btn-outline {
    padding: 0.5rem 1rem;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--primary);
    cursor: pointer;
}

.btn-outline:hover {
    background: var(--primary);
    color: white;
}

.btn-primary {
    padding: 0.5rem 1rem;
    border-radius: 10px;
    background: var(--primary);
    border: none;
    color: white;
    cursor: pointer;
}

/* Cards Grid */
.countries-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
}

.country-card {
    background: var(--bg-card);
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid var(--border);
    transition: all 0.3s ease;
    position: relative;
    padding-top: 0.5rem;
}

.country-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.1);
}

.country-select {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 10;
}

.country-select input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.country-card-header {
    padding: 1.25rem;
    padding-left: 2rem;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border);
}

.country-card-info {
    flex: 1;
}

.country-name-with-flag {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 10px;
}

.country-flag-icon .flag-icon {
    font-size: 3rem;
}

.country-name {
    font-size: 1.1rem;
    font-weight: 700;
}

.country-code {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-family: monospace;
}

.country-details {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.25rem;
    flex-wrap: wrap;
}

.detail-badge {
    font-size: 0.65rem;
    background: rgba(99, 102, 241, 0.1);
    padding: 0.15rem 0.4rem;
    border-radius: 12px;
    color: var(--primary);
}

.country-stats {
    margin-top: 0.5rem;
}

.stat-badge {
    font-size: 0.65rem;
    background: rgba(16, 185, 129, 0.1);
    padding: 0.2rem 0.5rem;
    border-radius: 20px;
    color: #10b981;
}

.badge-active {
    background: rgba(16, 185, 129, 0.15) !important;
    color: #059669 !important;
}

.badge-inactive {
    background: rgba(239, 68, 68, 0.15) !important;
    color: #dc2626 !important;
}

.country-card-actions {
    padding: 0.75rem;
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
    border-top: 1px solid var(--border);
}

.country-action-btn {
    padding: 0.35rem 0.7rem;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-size: 0.7rem;
    transition: all 0.2s;
}

.country-action-btn.view { background: rgba(99, 102, 241, 0.1); color: #6366f1; }
.country-action-btn.view:hover { background: #6366f1; color: white; }
.country-action-btn.edit { background: rgba(59, 130, 246, 0.1); color: #3b82f6; }
.country-action-btn.edit:hover { background: #3b82f6; color: white; }
.country-action-btn.toggle { background: rgba(245, 158, 11, 0.1); color: #f59e0b; }
.country-action-btn.toggle:hover { background: #f59e0b; color: white; }
.country-action-btn.delete { background: rgba(239, 68, 68, 0.1); color: #ef4444; }
.country-action-btn.delete:hover { background: #ef4444; color: white; }

/* List View */
.countries-list-view {
    overflow-x: auto;
}

.countries-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 800px;
}

.countries-table th,
.countries-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.countries-table th {
    background: var(--bg-primary);
    font-weight: 600;
}

.flag-column {
    text-align: center;
    width: 60px;
}

.flag-column .flag-icon {
    font-size: 2rem;
}

.country-name-cell .country-name {
    font-weight: 500;
}

.code-badge {
    background: var(--bg-secondary);
    padding: 0.2rem 0.4rem;
    border-radius: 6px;
    font-size: 0.7rem;
    font-family: monospace;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.25rem 0.75rem;
    border-radius: 30px;
    font-size: 0.7rem;
    font-weight: 600;
}

.status-active {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
}

.status-inactive {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.country-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* Preview Box */
.preview-box {
    background: var(--bg-secondary);
    padding: 0.75rem;
    border-radius: 10px;
    margin-top: 1rem;
    text-align: center;
}

.preview-box .flag-icon {
    font-size: 1.2rem;
    margin-right: 8px;
}

.phone-preview {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-left: 0.5rem;
}

/* Country View Modal */
.country-view-modal .country-view-header {
    text-align: center;
    padding: 2rem;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: white;
    border-radius: 16px 16px 0 0;
    position: relative;
}

.country-view-header .btn-close {
    position: absolute;
    top: 15px;
    right: 15px;
    filter: brightness(0) invert(1);
}

.country-view-name {
    margin: 0.5rem 0 0;
    font-size: 1.5rem;
}

.country-view-code {
    font-size: 0.8rem;
    opacity: 0.9;
}

.country-view-details {
    padding: 1.5rem;
}

.country-view-detail-item {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
}

.country-view-detail-label {
    font-weight: 500;
    color: var(--text-muted);
}

.country-view-detail-value {
    color: var(--text-primary);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem;
    background: white;
    border-radius: 20px;
    border: 1px solid var(--gray-200);
}

.empty-state i {
    font-size: 3rem;
    color: var(--gray-300);
    margin-bottom: 1rem;
    display: block;
}

/* Alerts */
.alert {
    padding: 0.75rem 1rem;
    border-radius: 10px;
    margin-bottom: 1rem;
}

.alert-success {
    background: rgba(16, 185, 129, 0.15);
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.alert-danger {
    background: rgba(239, 68, 68, 0.15);
    color: #991b1b;
    border: 1px solid #fecaca;
}

.text-center { text-align: center; }
.py-5 { padding: 3rem 0; }
.mt-2 { margin-top: 0.5rem; }

/* Responsive */
@media (max-width: 1200px) {
    .countries-stats-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 768px) {
    .countries-stats-grid { grid-template-columns: repeat(2, 1fr); }
    .countries-filters-bar { flex-direction: column; align-items: stretch; }
    .search-box { width: 100%; }
    .countries-cards-grid { grid-template-columns: 1fr; }
    .selection-toolbar { flex-direction: column; align-items: stretch; }
    .selection-buttons { justify-content: center; }
    .bulk-actions-buttons { justify-content: center; }
}

@media (max-width: 480px) {
    .countries-stats-grid { grid-template-columns: 1fr; }
}