/* ===== VARIABLES & RESET ===== */
:root {
  --bg: #0b0d12;
  --bg2: #0f1622;
  --card: rgba(255, 255, 255, 0.98);
  --text: #0b0d12;
  --text-light: #64748b;
  --brand: #ff6b35;
  --brand2: #2563eb;
  --brand-gradient: linear-gradient(135deg, #ff6b35, #ffa62e);
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
  --shadow-lg: 0 30px 80px rgba(0, 0, 0, 0.2);
  --radius: 20px;
  --radius-sm: 12px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.dark-mode {
  --bg: #0f172a;
  --bg2: #1e293b;
  --card: rgba(30, 41, 59, 0.95);
  --text: #f1f5f9;
  --text-light: #94a3b8;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Montserrat", sans-serif;
  background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
  color: var(--text);
  min-height: 100vh;
  transition: var(--transition);
}

body.dark-mode {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
}

.container {
  width: min(1400px, 95vw);
  margin: 0 auto;
  padding: 0 20px;
}

/* ===== PREMIUM BADGE ===== */
.premium-badge {
  position: fixed;
  top: 20px;
  right: 20px;
  background: var(--brand-gradient);
  color: white;
  padding: 8px 16px;
  border-radius: 30px;
  font-size: 0.8rem;
  font-weight: 600;
  z-index: 1000;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 8px;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

/* ===== HEADER PREMIUM ===== */
.header {
  background: linear-gradient(135deg, var(--bg2), var(--bg));
  color: white;
  padding: 18px 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo i {
  font-size: 2rem;
  background: var(--brand-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: rotate 20s linear infinite;
}

@keyframes rotate {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.logo h1 {
  margin: 0;
  font-family: "Playfair Display", serif;
  font-weight: 700;
  font-size: 1.8rem;
  letter-spacing: -0.5px;
}

.logo h1 span {
  background: var(--brand-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.premium-tag {
  background: var(--brand-gradient);
  color: white;
  font-size: 0.6rem;
  padding: 2px 8px;
  border-radius: 12px;
  margin-left: 6px;
  vertical-align: super;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 24px;
}

.header-info {
  display: flex;
  align-items: center;
  gap: 20px;
}

.connection-status {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(16, 185, 129, 0.2);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.85rem;
}

.connection-status i {
  color: var(--success);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-premium,
.fav-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 12px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.1);
  color: white;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  backdrop-filter: blur(10px);
}

.btn-premium:hover,
.fav-toggle:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.3);
}

.fav-toggle.active {
  background: rgba(255, 107, 53, 0.2);
  border-color: var(--brand);
  box-shadow: 0 0 20px rgba(255, 107, 53, 0.3);
}

.badge {
  background: var(--brand);
  color: white;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 0.8rem;
  font-weight: 600;
}

/* ===== NAVBAR ===== */
.navbar {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  padding: 12px 0;
}

.dark-mode .navbar {
  background: rgba(30, 41, 59, 0.9);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.nav-links {
  display: flex;
  gap: 32px;
}

.nav-link {
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  position: relative;
  transition: var(--transition);
}

.nav-link:hover {
  color: var(--brand);
}

.nav-link.active {
  color: var(--brand);
}

.nav-link.active::after {
  content: "";
  position: absolute;
  bottom: -12px;
  left: 0;
  width: 100%;
  height: 3px;
  background: var(--brand-gradient);
  border-radius: 3px;
}

/* ===== HERO SECTION ===== */
.hero-section {
  padding: 60px 0 40px;
  background: linear-gradient(
    135deg,
    rgba(255, 107, 53, 0.1) 0%,
    rgba(37, 99, 235, 0.1) 100%
  );
  border-radius: 0 0 40px 40px;
  margin-bottom: 40px;
}

.dark-mode .hero-section {
  background: linear-gradient(
    135deg,
    rgba(255, 107, 53, 0.05) 0%,
    rgba(37, 99, 235, 0.05) 100%
  );
}

.hero-content h2 {
  font-size: 3rem;
  margin-bottom: 16px;
  background: var(--brand-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-content p {
  font-size: 1.2rem;
  color: var(--text-light);
  max-width: 600px;
  margin-bottom: 40px;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-top: 40px;
}

.stat-box {
  background: white;
  padding: 24px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 20px;
  transition: var(--transition);
}

.dark-mode .stat-box {
  background: var(--card);
}

.stat-box:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}

.stat-box i {
  font-size: 2.5rem;
  background: var(--brand-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.stat-box h3 {
  font-size: 2rem;
  margin: 0;
  color: var(--brand);
}

.stat-box p {
  margin: 0;
  color: var(--text-light);
}

/* ===== DASHBOARD ===== */
.dashboard {
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: var(--radius);
  padding: 30px;
  margin-bottom: 40px;
  box-shadow: var(--shadow);
}

.dark-mode .dashboard {
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* ===== FILTERS ===== */
.filter-panel {
  margin-bottom: 30px;
}

.search-box {
  position: relative;
  margin-bottom: 20px;
}

.search-box i {
  position: absolute;
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-light);
}

.search-box input {
  width: 100%;
  padding: 18px 20px 18px 50px;
  border: 2px solid rgba(0, 0, 0, 0.1);
  border-radius: var(--radius);
  font-size: 1rem;
  background: white;
  transition: var(--transition);
}

.dark-mode .search-box input {
  background: var(--card);
  border-color: rgba(255, 255, 255, 0.1);
  color: var(--text);
}

.search-box input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.1);
}

.search-clear {
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-light);
  cursor: pointer;
  padding: 5px;
}

.search-tips {
  margin-top: 8px;
  font-size: 0.85rem;
  color: var(--text-light);
}

.control-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
  margin-bottom: 30px;
}

.control-group {
  background: white;
  padding: 20px;
  border-radius: var(--radius);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

.dark-mode .control-group {
  background: var(--card);
}

.control-group label {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 15px;
  font-weight: 600;
  color: var(--text);
}

.range-wrapper {
  margin-top: 20px;
}

.range-wrapper input[type="range"] {
  width: 100%;
  height: 8px;
  border-radius: 4px;
  background: linear-gradient(to right, var(--brand), var(--brand2));
  outline: none;
  -webkit-appearance: none;
}

.range-wrapper input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: white;
  border: 3px solid var(--brand);
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.range-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 10px;
  color: var(--text-light);
  font-size: 0.9rem;
}

.sort-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.btnSort {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border: 2px solid rgba(0, 0, 0, 0.1);
  background: white;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  font-weight: 500;
}

.dark-mode .btnSort {
  background: var(--card);
  border-color: rgba(255, 255, 255, 0.1);
}

.btnSort:hover {
  transform: translateY(-2px);
  border-color: var(--brand);
}

.btnSort.active {
  background: var(--brand-gradient);
  color: white;
  border-color: transparent;
  box-shadow: 0 4px 20px rgba(255, 107, 53, 0.3);
}

.filter-advanced {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.filter-select {
  flex: 1;
  min-width: 150px;
  padding: 10px 15px;
  border: 2px solid rgba(0, 0, 0, 0.1);
  border-radius: var(--radius-sm);
  background: white;
  font-family: inherit;
  transition: var(--transition);
}

.dark-mode .filter-select {
  background: var(--card);
  border-color: rgba(255, 255, 255, 0.1);
  color: var(--text);
}

.filter-select:focus {
  outline: none;
  border-color: var(--brand);
}

/* ===== STATS GRID ===== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin-top: 30px;
}

.stat-card {
  background: white;
  padding: 24px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 20px;
  transition: var(--transition);
}

.dark-mode .stat-card {
  background: var(--card);
}

.stat-card:hover {
  transform: translateY(-5px);
}

.stat-card.premium {
  background: var(--brand-gradient);
  color: white;
}

.stat-card.premium i {
  color: white;
}

.stat-card.premium h4,
.stat-card.premium p {
  color: white;
}

.stat-card i {
  font-size: 2.5rem;
  color: var(--brand);
}

.stat-card h4 {
  font-size: 0.9rem;
  color: var(--text-light);
  margin: 0 0 5px 0;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.stat-card p {
  font-size: 1.8rem;
  font-weight: 700;
  margin: 0;
  color: var(--text);
}

/* ===== RESULTS HEADER ===== */
.results-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 2px solid rgba(0, 0, 0, 0.1);
}

.dark-mode .results-header {
  border-bottom: 2px solid rgba(255, 255, 255, 0.1);
}

.results-header h3 {
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
}

.view-controls {
  display: flex;
  align-items: center;
  gap: 20px;
}

.view-toggle {
  display: flex;
  gap: 10px;
}

.view-btn {
  width: 44px;
  height: 44px;
  border: 2px solid rgba(0, 0, 0, 0.1);
  background: white;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}

.dark-mode .view-btn {
  background: var(--card);
  border-color: rgba(255, 255, 255, 0.1);
}

.view-btn:hover {
  border-color: var(--brand);
}

.view-btn.active {
  background: var(--brand-gradient);
  color: white;
  border-color: transparent;
}

.btn-refresh {
  padding: 10px 20px;
  background: var(--brand-gradient);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-refresh:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(255, 107, 53, 0.3);
}

.btn-refresh:active {
  transform: translateY(0);
}

/* ===== COUNTRIES CONTAINER ===== */
.countries-container {
  display: grid;
  gap: 24px;
  padding: 20px 0;
}

.countries-container.grid-view {
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
}

.countries-container.list-view {
  grid-template-columns: 1fr;
}

.countries-container.compact-view {
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
}

/* ===== COUNTRY CARD ===== */
.country-card {
  background: white;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: var(--transition);
  position: relative;
}

.dark-mode .country-card {
  background: var(--card);
}

.country-card:hover {
  transform: translateY(-10px);
  box-shadow: var(--shadow-lg);
}

.country-card.premium {
  border: 2px solid var(--brand);
}

.country-card.premium::before {
  content: "PREMIUM";
  position: absolute;
  top: 10px;
  left: 10px;
  background: var(--brand-gradient);
  color: white;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 0.7rem;
  font-weight: 600;
  z-index: 2;
}

.country-flag {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
}

.country-content {
  padding: 24px;
}

.country-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 15px;
}

.country-header h3 {
  font-size: 1.4rem;
  margin: 0;
  color: var(--text);
}

.country-code {
  background: rgba(0, 0, 0, 0.1);
  color: var(--text-light);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
}

.dark-mode .country-code {
  background: rgba(255, 255, 255, 0.1);
}

.country-meta {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 15px;
  margin-bottom: 20px;
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 10px;
}

.meta-item i {
  color: var(--brand);
  width: 20px;
}

.meta-item span:first-child {
  font-weight: 600;
  color: var(--text-light);
  font-size: 0.9rem;
}

.meta-item span:last-child {
  color: var(--text);
  font-weight: 500;
}

.country-stats {
  background: rgba(255, 107, 53, 0.1);
  border-radius: var(--radius-sm);
  padding: 20px;
  margin-bottom: 20px;
}

.dark-mode .country-stats {
  background: rgba(255, 107, 53, 0.05);
}

.stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.stat-row:last-child {
  margin-bottom: 0;
}

.stat-label {
  color: var(--text-light);
  font-size: 0.9rem;
}

.stat-value {
  font-weight: 700;
  color: var(--text);
}

.country-actions {
  display: flex;
  gap: 10px;
}

.action-btn {
  flex: 1;
  padding: 12px;
  border: none;
  border-radius: var(--radius-sm);
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.action-btn.primary {
  background: var(--brand-gradient);
  color: white;
}

.action-btn.secondary {
  background: rgba(0, 0, 0, 0.1);
  color: var(--text);
}

.dark-mode .action-btn.secondary {
  background: rgba(255, 255, 255, 0.1);
}

.action-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.fav-btn {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 44px;
  height: 44px;
  background: rgba(255, 255, 255, 0.9);
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  z-index: 2;
}

.fav-btn:hover {
  background: white;
  transform: scale(1.1);
}

.fav-btn.active {
  color: var(--brand);
  background: white;
}

.fav-btn.active i {
  animation: bounce 0.5s;
}

@keyframes bounce {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.3);
  }
}

/* ===== PAGINATION ===== */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 30px;
  margin-top: 40px;
  padding-top: 30px;
  border-top: 2px solid rgba(0, 0, 0, 0.1);
}

.dark-mode .pagination {
  border-top: 2px solid rgba(255, 255, 255, 0.1);
}

.pagination-btn {
  padding: 12px 24px;
  border: 2px solid rgba(0, 0, 0, 0.1);
  background: white;
  border-radius: var(--radius-sm);
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 8px;
}

.dark-mode .pagination-btn {
  background: var(--card);
  border-color: rgba(255, 255, 255, 0.1);
}

.pagination-btn:hover:not(:disabled) {
  border-color: var(--brand);
  transform: translateY(-2px);
}

.pagination-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.page-info {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
}

/* ===== FOOTER ===== */
.footer {
  background: linear-gradient(135deg, var(--bg2), var(--bg));
  color: white;
  padding: 60px 0 30px;
  margin-top: 80px;
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 40px;
  margin-bottom: 40px;
}

.footer-section h4 {
  font-size: 1.2rem;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.footer-section p {
  color: rgba(255, 255, 255, 0.8);
  line-height: 1.6;
}

.footer-section ul {
  list-style: none;
  padding: 0;
}

.footer-section ul li {
  margin-bottom: 10px;
  color: rgba(255, 255, 255, 0.8);
}

.footer-section ul li::before {
  content: "▸";
  color: var(--brand);
  margin-right: 10px;
}

.social-links {
  display: flex;
  gap: 15px;
  margin-top: 20px;
}

.social-links a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  color: white;
  transition: var(--transition);
}

.social-links a:hover {
  background: var(--brand);
  transform: translateY(-3px);
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 30px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-links {
  display: flex;
  gap: 30px;
  align-items: center;
}

.footer-links a {
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  transition: var(--transition);
}

.footer-links a:hover {
  color: var(--brand);
}

.upgrade-btn {
  background: var(--brand-gradient);
  color: white;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  text-decoration: none;
}

.upgrade-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(255, 107, 53, 0.3);
}

/* ===== LOADING OVERLAY ===== */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.loader {
  background: white;
  padding: 40px;
  border-radius: var(--radius);
  text-align: center;
  box-shadow: var(--shadow-lg);
  max-width: 400px;
  width: 90%;
}

.earth-spinner {
  font-size: 4rem;
  color: var(--brand);
  margin-bottom: 20px;
  animation: rotate 3s linear infinite;
}

.loader p {
  margin-bottom: 20px;
  color: var(--text-light);
}

.loader-progress {
  width: 100%;
  height: 6px;
  background: rgba(0, 0, 0, 0.1);
  border-radius: 3px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: var(--brand-gradient);
  width: 0%;
  transition: width 0.3s ease;
}

/* ===== DRAWER ===== */
.drawer-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(5px);
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
}

.drawer-overlay.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.country-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(600px, 90vw);
  background: white;
  z-index: 1001;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
}

.dark-mode .country-drawer {
  background: var(--card);
}

.country-drawer.active {
  transform: translateX(0);
}

.drawer-header {
  padding: 24px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.dark-mode .drawer-header {
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.drawer-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-light);
  padding: 5px;
}

.drawer-close:hover {
  color: var(--brand);
}

.drawer-content {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
}

/* ===== MODAL ===== */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(5px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
}

.modal.active {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  background: white;
  border-radius: var(--radius);
  width: min(500px, 90vw);
  max-height: 90vh;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.dark-mode .modal-content {
  background: var(--card);
}

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

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-light);
  padding: 5px;
}

.modal-body {
  padding: 24px;
}

.export-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.export-option {
  padding: 30px 20px;
  border: 2px solid rgba(0, 0, 0, 0.1);
  border-radius: var(--radius);
  background: white;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.dark-mode .export-option {
  background: var(--card);
  border-color: rgba(255, 255, 255, 0.1);
}

.export-option:hover {
  border-color: var(--brand);
  transform: translateY(-5px);
}

.export-option i {
  font-size: 2rem;
  color: var(--brand);
}

.export-option span {
  font-weight: 600;
  color: var(--text);
}

.export-preview {
  background: rgba(0, 0, 0, 0.05);
  border-radius: var(--radius);
  padding: 20px;
  max-height: 300px;
  overflow-y: auto;
}

.dark-mode .export-preview {
  background: rgba(255, 255, 255, 0.05);
}

/* ===== TOAST ===== */
.toastify {
  border-radius: var(--radius);
  font-family: inherit;
  box-shadow: var(--shadow-lg);
  padding: 16px 24px;
}

.toastify.success {
  background: var(--success);
}

.toastify.error {
  background: var(--danger);
}

.toastify.warning {
  background: var(--warning);
}

.toastify.info {
  background: var(--brand);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1200px) {
  .hero-content h2 {
    font-size: 2.5rem;
  }

  .countries-container.grid-view {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  }
}

@media (max-width: 768px) {
  .header-inner {
    flex-direction: column;
    gap: 15px;
  }

  .header-right {
    width: 100%;
    justify-content: space-between;
  }

  .nav-links {
    overflow-x: auto;
    padding-bottom: 10px;
  }

  .control-grid {
    grid-template-columns: 1fr;
  }

  .countries-container.grid-view {
    grid-template-columns: 1fr;
  }

  .footer-bottom {
    flex-direction: column;
    gap: 20px;
    text-align: center;
  }

  .footer-links {
    flex-direction: column;
    gap: 15px;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 15px;
  }

  .dashboard {
    padding: 20px;
  }

  .hero-content h2 {
    font-size: 2rem;
  }

  .hero-stats {
    grid-template-columns: 1fr;
  }

  .country-meta {
    grid-template-columns: 1fr;
  }
}
