/* CountrySelection.css - Premium Global Markets Redesign */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

.cs-dashboard {
  font-family: 'Inter', sans-serif;
  color: #0B1F3A;
  width: 100%;
  min-height: 100vh;
  background-color: #f8fafc;
  position: relative;
  overflow: hidden;
  animation: pageFadeIn 0.8s ease-out;
}

@keyframes pageFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* =========================================
   1. HERO SECTION & BACKGROUND
========================================= */
.cs-hero {
  position: relative;
  width: 100%;
  padding: 80px 20px 100px 20px;
  background-image: url('../../images/global_markets_bg.avif');
  background-size: cover;
  background-position: center 20%;
  background-attachment: fixed;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  border-bottom: 1px solid rgba(23, 105, 224, 0.1);
}

/* Very subtle overlay to ensure text remains crisp while letting map show */
.cs-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(248,250,252,0.1) 0%, rgba(248,250,252,0.8) 100%);
  z-index: 1;
}

.cs-hero-content {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 900px;
}

.cs-hero-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
  margin-bottom: 15px;
}

.cs-hero-icon {
  color: #1769E0;
}

.cs-hero-header h1 {
  font-size: 3rem;
  font-weight: 800;
  color: #0B1F3A;
  margin: 0;
  letter-spacing: -1px;
}

.cs-hero-subtitle {
  font-size: 1.25rem;
  font-weight: 500;
  color: #475569;
  margin: 0 0 40px 0;
}

/* =========================================
   3. SEARCH BAR
========================================= */
.cs-search-container {
  display: flex;
  justify-content: center;
  width: 100%;
}

.cs-search-wrapper {
  position: relative;
  width: 100%;
  max-width: 600px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px);
  border-radius: 50px;
  display: flex;
  align-items: center;
  padding: 8px 24px;
  box-shadow: 0 10px 25px rgba(11, 31, 58, 0.05);
  border: 1px solid rgba(23, 105, 224, 0.15);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.cs-search-wrapper:focus-within {
  transform: translateY(-2px);
  box-shadow: 0 15px 35px rgba(23, 105, 224, 0.15);
  border-color: #1769E0;
  background: #ffffff;
}

.cs-search-icon {
  color: #64748b;
  flex-shrink: 0;
  transition: color 0.3s ease;
}

.cs-search-wrapper:focus-within .cs-search-icon {
  color: #1769E0;
}

.cs-search-input {
  width: 100%;
  border: none;
  background: transparent;
  padding: 12px 15px;
  font-size: 1.1rem;
  color: #0B1F3A;
  font-family: 'Inter', sans-serif;
  outline: none;
}

.cs-search-input::placeholder {
  color: #94a3b8;
}

/* =========================================
   CONTENT WRAPPER
========================================= */
.cs-content-wrapper {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 30px 80px 30px;
  position: relative;
  z-index: 5;
  margin-top: -30px; /* Pulls content up over the hero slightly */
}

/* =========================================
   9. CATEGORY / FILTER BAR
========================================= */
.cs-filters {
  display: flex;
  justify-content: center;
  margin-bottom: 40px;
}

.cs-filter-scroll {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 5px;
  scrollbar-width: none; /* Firefox */
}
.cs-filter-scroll::-webkit-scrollbar {
  display: none; /* Chrome/Safari */
}

.cs-filter-pill {
  background: #ffffff;
  color: #64748b;
  border: 1px solid #e2e8f0;
  padding: 10px 20px;
  border-radius: 50px;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
  box-shadow: 0 2px 5px rgba(0,0,0,0.02);
}

.cs-filter-pill:hover {
  background: #f8fafc;
  color: #0B1F3A;
  border-color: #cbd5e1;
}

.cs-filter-pill.active {
  background: #0B1F3A;
  color: #ffffff;
  border-color: #0B1F3A;
  box-shadow: 0 4px 15px rgba(11, 31, 58, 0.2);
}

/* =========================================
   10. COUNTRY COUNT
========================================= */
.cs-grid-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 30px;
}

.cs-section-title {
  font-size: 1rem;
  font-weight: 700;
  color: #1769E0;
  letter-spacing: 2px;
  margin: 0 0 5px 0;
}

.cs-country-count {
  font-size: 1.1rem;
  color: #64748b;
  font-weight: 500;
}

/* =========================================
   8. LAYOUT & 6. COUNTRY CARD DESIGN
========================================= */
.cs-country-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 25px;
  animation: gridStagger 0.6s ease-out;
}

@keyframes gridStagger {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.cs-country-tile {
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(226, 232, 240, 0.8);
  border-radius: 16px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 15px rgba(11, 31, 58, 0.03);
  position: relative;
  overflow: hidden;
}

.cs-country-tile::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent 0%, rgba(23, 105, 224, 0.03) 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.cs-country-tile:hover {
  transform: translateY(-6px);
  box-shadow: 0 15px 35px rgba(11, 31, 58, 0.08);
  border-color: rgba(23, 105, 224, 0.3);
  background: rgba(255, 255, 255, 1);
}

.cs-country-tile:hover::before {
  opacity: 1;
}

/* =========================================
   5. FLAG DESIGN & TILE HEADER
========================================= */
.cs-tile-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 20px;
  position: relative;
  z-index: 2;
}

.cs-flag-circle {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid #ffffff;
  box-shadow: 0 4px 10px rgba(0,0,0,0.08);
  transition: transform 0.3s ease;
}

.cs-flag-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cs-country-tile:hover .cs-flag-circle {
  transform: scale(1.1);
}

.cs-country-code {
  font-size: 0.85rem;
  font-weight: 700;
  color: #94a3b8;
  background: #f1f5f9;
  padding: 4px 8px;
  border-radius: 6px;
}

/* =========================================
   7. COUNTRY INFORMATION
========================================= */
.cs-tile-body {
  position: relative;
  z-index: 2;
  margin-top: auto;
}

.cs-country-name {
  font-size: 1.2rem;
  font-weight: 700;
  color: #0B1F3A;
  margin: 0 0 12px 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cs-explore-link {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  color: #1769E0;
}

.cs-explore-arrow {
  transition: transform 0.3s ease;
}

.cs-country-tile:hover .cs-explore-arrow {
  transform: translateX(4px);
}

/* =========================================
   EMPTY STATE
========================================= */
.cs-no-results {
  text-align: center;
  padding: 60px 20px;
  color: #64748b;
  font-size: 1.1rem;
}

/* =========================================
   16. RESPONSIVENESS
========================================= */
@media (min-width: 1400px) {
  .cs-country-grid {
    grid-template-columns: repeat(6, 1fr);
  }
}

@media (max-width: 1200px) {
  .cs-country-grid {
    grid-template-columns: repeat(5, 1fr);
  }
}

@media (max-width: 992px) {
  .cs-country-grid {
    grid-template-columns: repeat(4, 1fr);
  }
  .cs-hero-header h1 {
    font-size: 2.5rem;
  }
}

@media (max-width: 768px) {
  .cs-hero {
    padding: 60px 20px 80px 20px;
  }
  .cs-country-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
  }
  .cs-filters {
    justify-content: flex-start;
  }
  .cs-filter-scroll {
    padding-bottom: 10px;
  }
}

@media (max-width: 576px) {
  .cs-country-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
  }
  .cs-hero-header h1 {
    font-size: 2rem;
  }
  .cs-hero-subtitle {
    font-size: 1rem;
  }
  .cs-content-wrapper {
    padding: 0 15px 40px 15px;
  }
}

@media (max-width: 400px) {
  .cs-country-grid {
    grid-template-columns: 1fr;
  }
}
