/* =========================================================
   TAJRIVO - COUNTRIES & OPERATORS
========================================================= */


/* =========================================================
   PAGE
========================================================= */

.countries-page {
  width: 100%;
  max-width: 1450px;
  margin: 0 auto;
  padding-bottom: 50px;
}


/* =========================================================
   PAGE HEADING
========================================================= */

.countries-page-heading {
  margin-bottom: 22px;

  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
}

.countries-page-heading h1 {
  margin: 5px 0 7px;

  color: #0f172a;

  font-size: clamp(28px, 3vw, 38px);
  line-height: 1.1;
  font-weight: 800;

  letter-spacing: -0.04em;
}

.countries-page-heading p {
  max-width: 660px;
  margin: 0;

  color: #64748b;

  font-size: 14px;
  line-height: 1.7;
}


/* =========================================================
   TOP UP BUTTON
========================================================= */

.countries-topup-button {
  min-height: 44px;

  padding: 0 16px;

  border-radius: 12px;

  background: var(--primary);
  color: #ffffff;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  font-size: 11px;
  font-weight: 800;
  text-decoration: none;

  box-shadow:
    0 8px 20px rgba(37, 99, 235, 0.18);

  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    background 0.2s ease;
}

.countries-topup-button:hover {
  transform: translateY(-1px);

  box-shadow:
    0 12px 26px rgba(37, 99, 235, 0.22);
}


/* =========================================================
   TOPBAR INFO
========================================================= */

.countries-topbar-info {
  min-height: 46px;

  padding: 6px 13px;

  border: 1px solid #e2e8f0;
  border-radius: 14px;

  background: #ffffff;

  display: flex;
  align-items: center;
  gap: 10px;

  box-shadow:
    0 4px 15px rgba(15, 23, 42, 0.035);
}

.countries-topbar-info-icon {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;

  border-radius: 10px;

  background: #eef5ff;

  display: flex;
  align-items: center;
  justify-content: center;

  font-size: 14px;
}

.countries-topbar-info > div:last-child {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.countries-topbar-info span {
  color: #94a3b8;

  font-size: 10px;
  font-weight: 700;
}

.countries-topbar-info strong {
  color: #0f172a;

  font-size: 12px;
  font-weight: 800;
}


/* =========================================================
   HERO
========================================================= */

.countries-hero {
  position: relative;
  overflow: hidden;

  padding: 30px;

  border-radius: 26px;

  display: grid;
  grid-template-columns:
    minmax(0, 1fr)
    300px;
  gap: 28px;

  align-items: center;

  color: #ffffff;

  background:
    radial-gradient(
      circle at top right,
      rgba(255, 255, 255, 0.16),
      transparent 34%
    ),
    radial-gradient(
      circle at bottom left,
      rgba(255, 255, 255, 0.08),
      transparent 28%
    ),
    linear-gradient(
      135deg,
      #0c5fd5,
      #1677ff 58%,
      #4da3ff
    );

  box-shadow:
    0 24px 48px rgba(22, 119, 255, 0.18);
}


/* =========================================================
   HERO CONTENT
========================================================= */

.countries-hero-content {
  position: relative;
  z-index: 2;
}

.countries-hero-badge {
  min-height: 30px;

  padding: 0 11px;

  border-radius: 999px;

  background:
    rgba(255, 255, 255, 0.15);

  display: inline-flex;
  align-items: center;

  font-size: 10px;
  font-weight: 800;
}

.countries-hero-content h2 {
  max-width: 620px;

  margin: 17px 0 0;

  font-size: clamp(29px, 4vw, 38px);
  line-height: 1.08;
  font-weight: 800;

  letter-spacing: -0.04em;
}

.countries-hero-content p {
  max-width: 560px;

  margin: 13px 0 0;

  color:
    rgba(255, 255, 255, 0.8);

  font-size: 13px;
  line-height: 1.7;
}


/* =========================================================
   HERO STAT
========================================================= */

.countries-hero-stat {
  position: relative;
  z-index: 2;

  min-height: 160px;

  padding: 22px;

  border: 1px solid
    rgba(255, 255, 255, 0.18);
  border-radius: 20px;

  background:
    rgba(255, 255, 255, 0.12);

  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);

  display: flex;
  flex-direction: column;
  justify-content: center;
}

.countries-hero-stat span {
  color:
    rgba(255, 255, 255, 0.7);

  font-size: 9px;
  font-weight: 800;

  letter-spacing: 0.1em;
}

.countries-hero-stat strong {
  margin-top: 10px;

  font-size: 40px;
  line-height: 1;
  font-weight: 900;

  letter-spacing: -0.04em;
}

.countries-hero-stat small {
  margin-top: 7px;

  color:
    rgba(255, 255, 255, 0.72);

  font-size: 10px;
}


/* =========================================================
   STATS
========================================================= */

.countries-stats {
  margin-top: 18px;

  display: grid;
  grid-template-columns:
    repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.country-stat-card {
  min-height: 105px;

  padding: 18px;

  border: 1px solid #e8edf5;
  border-radius: 19px;

  background: #ffffff;

  display: flex;
  align-items: center;
  gap: 14px;

  box-shadow:
    0 7px 22px rgba(15, 23, 42, 0.045);

  transition:
    transform 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.country-stat-card:hover {
  transform: translateY(-2px);

  border-color: #dbe4f0;

  box-shadow:
    0 12px 30px rgba(15, 23, 42, 0.07);
}

.country-stat-icon {
  width: 46px;
  height: 46px;
  flex: 0 0 46px;

  border-radius: 14px;

  background: #eef5ff;

  display: flex;
  align-items: center;
  justify-content: center;

  font-size: 19px;
}

.country-stat-card:nth-child(2)
.country-stat-icon {
  background: #effcf6;
}

.country-stat-card:nth-child(3)
.country-stat-icon {
  background: #fff8e8;
}

.country-stat-card > div:last-child {
  min-width: 0;

  display: flex;
  flex-direction: column;
  gap: 5px;
}

.country-stat-card span {
  color: #64748b;

  font-size: 11px;
  font-weight: 700;
}

.country-stat-card strong {
  color: #0f172a;

  font-size: 20px;
  line-height: 1;
  font-weight: 800;
}


/* =========================================================
   MAIN CARD
========================================================= */

.countries-card {
  margin-top: 18px;

  overflow: hidden;

  border: 1px solid #e8edf5;
  border-radius: 22px;

  background: #ffffff;

  box-shadow:
    0 10px 34px rgba(15, 23, 42, 0.05);
}


/* =========================================================
   CARD HEADER
========================================================= */

.countries-card-header {
  min-height: 82px;

  padding: 20px 22px;

  border-bottom: 1px solid #eef2f7;

  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.countries-card-header h2 {
  margin: 5px 0 0;

  color: #0f172a;

  font-size: 20px;
  font-weight: 800;
}

.countries-card-header p {
  margin: 6px 0 0;

  color: #64748b;

  font-size: 10px;
  line-height: 1.6;
}


/* =========================================================
   REFRESH
========================================================= */

.countries-refresh-button {
  min-height: 40px;

  padding: 0 13px;

  border: 1px solid #e8edf5;
  border-radius: 11px;

  background: #f8fafc;
  color: #475569;

  font-family: inherit;
  font-size: 11px;
  font-weight: 700;

  cursor: pointer;

  transition:
    background 0.2s ease,
    color 0.2s ease,
    border-color 0.2s ease;
}

.countries-refresh-button:hover:not(:disabled) {
  border-color: #d7e3f3;

  background: #eef5ff;
  color: var(--primary);
}

.countries-refresh-button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}


/* =========================================================
   TOOLBAR
========================================================= */

.countries-toolbar {
  padding: 16px 22px;

  border-bottom: 1px solid #eef2f7;

  background: #fbfcfe;

  display: grid;
  grid-template-columns:
    minmax(0, 1fr)
    190px;
  gap: 10px;
}


/* =========================================================
   SEARCH
========================================================= */

.countries-search {
  min-height: 44px;

  padding: 0 13px;

  border: 1px solid #e2e8f0;
  border-radius: 12px;

  background: #ffffff;

  display: flex;
  align-items: center;
  gap: 9px;

  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.countries-search:focus-within {
  border-color: var(--primary);

  box-shadow:
    0 0 0 3px rgba(37, 99, 235, 0.08);
}

.countries-search > span {
  flex-shrink: 0;

  color: #94a3b8;

  font-size: 14px;
}

.countries-search input {
  width: 100%;
  min-width: 0;

  padding: 0;

  border: 0;
  outline: 0;

  background: transparent;
  color: #0f172a;

  font-family: inherit;
  font-size: 12px;
}

.countries-search input::placeholder {
  color: #94a3b8;
}


/* =========================================================
   SELECT
========================================================= */

.countries-select {
  width: 100%;
  min-height: 44px;

  padding: 0 35px 0 12px;

  border: 1px solid #e2e8f0;
  border-radius: 12px;
  outline: none;

  background: #ffffff;
  color: #334155;

  font-family: inherit;
  font-size: 11px;
  font-weight: 700;

  cursor: pointer;

  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.countries-select:focus {
  border-color: var(--primary);

  box-shadow:
    0 0 0 3px rgba(37, 99, 235, 0.08);
}


/* =========================================================
   STATES
========================================================= */

.countries-state {
  min-height: 300px;

  padding: 45px 20px;

  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;

  text-align: center;
}

.countries-state[hidden] {
  display: none !important;
}

.countries-state-icon {
  width: 58px;
  height: 58px;

  margin-bottom: 14px;

  border-radius: 18px;

  background: #eef5ff;
  color: var(--primary);

  display: flex;
  align-items: center;
  justify-content: center;

  font-size: 22px;
  font-weight: 800;
}

.countries-state strong {
  color: #0f172a;

  font-size: 14px;
  font-weight: 800;
}

.countries-state > span {
  max-width: 390px;

  margin-top: 6px;

  color: #64748b;

  font-size: 11px;
  line-height: 1.6;
}


/* =========================================================
   LOADER
========================================================= */

.countries-loader {
  width: 35px;
  height: 35px;

  margin-bottom: 14px;

  border: 3px solid #e5e7eb;
  border-top-color: var(--primary);
  border-radius: 50%;

  animation:
    countries-spin 0.8s linear infinite;
}

@keyframes countries-spin {

  to {
    transform: rotate(360deg);
  }

}


/* =========================================================
   RETRY
========================================================= */

.countries-retry-button {
  min-height: 40px;

  margin-top: 15px;
  padding: 0 15px;

  border: 0;
  border-radius: 11px;

  background: var(--primary);
  color: #ffffff;

  font-family: inherit;
  font-size: 11px;
  font-weight: 800;

  cursor: pointer;
}


/* =========================================================
   GRID
========================================================= */

.countries-grid {
  padding: 18px;

  display: grid;
  grid-template-columns:
    repeat(3, minmax(0, 1fr));
  gap: 13px;
}

.countries-grid[hidden] {
  display: none !important;
}


/* =========================================================
   COUNTRY CARD
========================================================= */

.country-card {
  min-width: 0;

  padding: 16px;

  border: 1px solid #e8edf5;
  border-radius: 17px;

  background: #ffffff;

  cursor: pointer;

  box-shadow:
    0 4px 15px rgba(15, 23, 42, 0.035);

  transition:
    transform 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.country-card:hover {
  transform: translateY(-2px);

  border-color: #d7e2ef;

  box-shadow:
    0 10px 25px rgba(15, 23, 42, 0.065);
}


/* =========================================================
   COUNTRY TOP
========================================================= */

.country-card-top {
  display: flex;
  align-items: center;
  gap: 11px;
}

.country-flag {
  width: 46px;
  height: 46px;
  flex: 0 0 46px;

  border-radius: 14px;

  background: #f8fafc;

  display: flex;
  align-items: center;
  justify-content: center;

  font-size: 24px;
}

.country-card-info {
  min-width: 0;
  flex: 1;
}

.country-card-info strong {
  display: block;

  overflow: hidden;

  color: #0f172a;

  font-size: 12px;
  font-weight: 800;

  white-space: nowrap;
  text-overflow: ellipsis;
}

.country-card-info span {
  display: block;

  margin-top: 4px;

  color: #64748b;

  font-size: 10px;
}


/* =========================================================
   COUNTRY META
========================================================= */

.country-card-meta {
  margin-top: 14px;

  padding: 11px 12px;

  border-radius: 13px;

  background: #f8fafc;

  display: flex;
  flex-direction: column;
  gap: 7px;
}

.country-card-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.country-card-meta-row span {
  color: #94a3b8;

  font-size: 9px;
  font-weight: 700;
}

.country-card-meta-row strong {
  max-width: 60%;

  overflow: hidden;

  color: #475569;

  text-align: right;

  font-size: 10px;
  font-weight: 800;

  white-space: nowrap;
  text-overflow: ellipsis;
}


/* =========================================================
   COUNTRY FOOTER
========================================================= */

.country-card-footer {
  margin-top: 14px;

  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.country-operators-count {
  min-height: 28px;

  padding: 0 9px;

  border-radius: 999px;

  background: #eef5ff;
  color: var(--primary);

  display: inline-flex;
  align-items: center;

  font-size: 9px;
  font-weight: 800;
}

.country-view-button {
  min-height: 34px;

  padding: 0 11px;

  border: 1px solid #e2e8f0;
  border-radius: 10px;

  background: #ffffff;
  color: var(--primary);

  font-size: 9px;
  font-weight: 800;
}


/* =========================================================
   MODAL
========================================================= */

.country-modal {
  position: fixed;
  inset: 0;

  z-index: 2000;

  padding: 20px;

  display: flex;
  align-items: center;
  justify-content: center;
}

.country-modal[hidden] {
  display: none !important;
}

.country-modal-backdrop {
  position: absolute;
  inset: 0;

  background:
    rgba(15, 23, 42, 0.5);

  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.country-modal-card {
  position: relative;
  z-index: 2;

  width: 100%;
  max-width: 620px;
  max-height: calc(100vh - 40px);

  overflow-y: auto;

  padding: 22px;

  border-radius: 22px;

  background: #ffffff;

  box-shadow:
    0 30px 80px rgba(15, 23, 42, 0.22);

  animation:
    country-modal-in 0.22s ease;
}

@keyframes country-modal-in {

  from {
    opacity: 0;

    transform:
      translateY(10px)
      scale(0.98);
  }

  to {
    opacity: 1;

    transform:
      translateY(0)
      scale(1);
  }

}


/* =========================================================
   MODAL HEADER
========================================================= */

.country-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.country-modal-title-wrap {
  min-width: 0;

  display: flex;
  align-items: center;
  gap: 12px;
}

.country-modal-flag {
  width: 52px;
  height: 52px;
  flex: 0 0 52px;

  border-radius: 15px;

  background: #f8fafc;

  display: flex;
  align-items: center;
  justify-content: center;

  font-size: 27px;
}

.country-modal-header h2 {
  margin: 5px 0 0;

  color: #0f172a;

  font-size: 20px;
  font-weight: 800;
}

.country-modal-close {
  width: 36px;
  height: 36px;
  flex: 0 0 36px;

  padding: 0;

  border: 1px solid #e2e8f0;
  border-radius: 11px;

  background: #ffffff;
  color: #64748b;

  display: flex;
  align-items: center;
  justify-content: center;

  font-size: 21px;

  cursor: pointer;
}


/* =========================================================
   MODAL COUNTRY INFO
========================================================= */

.country-modal-info {
  margin-top: 18px;

  display: grid;
  grid-template-columns:
    repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.country-modal-info > div {
  padding: 13px;

  border: 1px solid #e8edf5;
  border-radius: 14px;

  background: #f8fafc;
}

.country-modal-info span {
  display: block;

  color: #94a3b8;

  font-size: 9px;
  font-weight: 700;
}

.country-modal-info strong {
  display: block;

  margin-top: 5px;

  color: #0f172a;

  font-size: 11px;
  font-weight: 800;
}


/* =========================================================
   OPERATORS HEADER
========================================================= */

.country-modal-operators-header {
  margin-top: 20px;

  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
}

.country-modal-operators-header h3 {
  margin: 5px 0 0;

  color: #0f172a;

  font-size: 16px;
  font-weight: 800;
}

.country-modal-operators-header > span {
  color: #94a3b8;

  font-size: 9px;
  font-weight: 700;
}


/* =========================================================
   OPERATORS LIST
========================================================= */

.country-operators-list {
  margin-top: 13px;

  display: grid;
  grid-template-columns:
    repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.operator-item {
  min-width: 0;

  padding: 12px;

  border: 1px solid #e8edf5;
  border-radius: 14px;

  background: #f8fafc;

  display: flex;
  align-items: center;
  gap: 10px;
}

.operator-icon {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;

  border-radius: 11px;

  background: #ffffff;

  display: flex;
  align-items: center;
  justify-content: center;

  font-size: 15px;
}

.operator-info {
  min-width: 0;
}

.operator-info strong {
  display: block;

  overflow: hidden;

  color: #0f172a;

  font-size: 10px;
  font-weight: 800;

  white-space: nowrap;
  text-overflow: ellipsis;
}

.operator-info span {
  display: block;

  margin-top: 3px;

  color: #94a3b8;

  font-size: 9px;
}


/* =========================================================
   OPERATORS EMPTY
========================================================= */

.country-operators-empty {
  margin-top: 13px;

  min-height: 150px;

  padding: 20px;

  border: 1px dashed #dbe3ee;
  border-radius: 14px;

  background: #f8fafc;

  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;

  text-align: center;
}

.country-operators-empty[hidden] {
  display: none !important;
}

.country-operators-empty > span {
  margin-bottom: 7px;

  font-size: 24px;
}

.country-operators-empty strong {
  color: #0f172a;

  font-size: 11px;
}

.country-operators-empty small {
  max-width: 360px;

  margin-top: 5px;

  color: #64748b;

  font-size: 9px;
  line-height: 1.6;
}


/* =========================================================
   MODAL TOP UP BUTTON
========================================================= */

.country-modal-topup-button {
  width: 100%;
  min-height: 45px;

  margin-top: 18px;

  border: 0;
  border-radius: 12px;

  background: var(--primary);
  color: #ffffff;

  font-family: inherit;
  font-size: 11px;
  font-weight: 800;

  cursor: pointer;

  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

.country-modal-topup-button:hover {
  transform: translateY(-1px);

  box-shadow:
    0 9px 22px rgba(37, 99, 235, 0.2);
}


/* =========================================================
   BODY LOCK
========================================================= */

body.country-modal-open {
  overflow: hidden;
}


/* =========================================================
   TABLET
========================================================= */

@media (max-width: 1050px) {

  .countries-hero {
    grid-template-columns: 1fr;
  }

  .countries-grid {
    grid-template-columns:
      repeat(2, minmax(0, 1fr));
  }

}


/* =========================================================
   MOBILE
========================================================= */

@media (max-width: 700px) {

  .countries-page {
    padding-bottom: 30px;
  }


  .countries-page-heading {
    align-items: flex-start;
  }

  .countries-page-heading h1 {
    font-size: 27px;
  }

  .countries-page-heading p {
    font-size: 12px;
  }


  .countries-topbar-info {
    display: none;
  }


  .countries-topup-button {
    flex-shrink: 0;

    min-width: 44px;
    width: 44px;

    padding: 0;

    overflow: hidden;

    font-size: 0;
  }

  .countries-topup-button::before {
    content: "📱";

    font-size: 16px;
  }


  .countries-hero {
    padding: 21px;

    border-radius: 21px;
  }

  .countries-hero-content h2 {
    font-size: 29px;
  }

  .countries-hero-stat strong {
    font-size: 34px;
  }


  .countries-stats {
    grid-template-columns:
      repeat(2, minmax(0, 1fr));
  }


  .countries-card {
    border-radius: 18px;
  }


  .countries-card-header {
    padding: 16px;
  }


  .countries-toolbar {
    padding: 12px;

    grid-template-columns: 1fr;
  }


  .countries-grid {
    padding: 12px;

    grid-template-columns: 1fr;
  }


  .country-modal-info {
    grid-template-columns: 1fr;
  }


  .country-operators-list {
    grid-template-columns: 1fr;
  }

}


/* =========================================================
   SMALL MOBILE
========================================================= */

@media (max-width: 480px) {

  .countries-stats {
    grid-template-columns: 1fr;
  }


  .country-modal {
    padding: 0;

    align-items: flex-end;
  }


  .country-modal-card {
    width: 100%;
    max-width: none;
    max-height: 92dvh;

    padding: 18px;

    border-radius:
      22px 22px 0 0;
  }

}


/* =========================================================
   HIDDEN
========================================================= */

[hidden] {
  display: none !important;
}