/**
 * Country Cards Shortcode Styles - Template Matching Design
 */

.rd-country-cards-wrapper {
  margin: 20px 0;
}

.rd-country-cards-title {
  text-align: center;
  font-size: 1.75rem;
  font-weight: 700;
  color: #1a365d;
  margin: 0 0 12px 0;
}

.rd-country-cards-subtitle {
  text-align: center;
  font-size: 1rem;
  color: #4a5568;
  max-width: 700px;
  margin: 0 auto 24px auto;
  line-height: 1.6;
}

/* Alphabet bar - original style with white buttons */
.rd-country-alphabet-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px;
  margin-bottom: 20px;
  padding: 0 10px;
}

.rd-country-alphabet-btn {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 6px;
  background: #fff;
  color: #2d3748;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.rd-country-alphabet-btn:hover {
  background: #62c8fb;
  color: #fff;
  transform: scale(1.1);
}

.rd-country-alphabet-btn.rd-country-alphabet-active {
  background: #62c8fb;
  color: #fff;
}

/* Carousel layout - Swiper */
.rd-country-cards-carousel {
  position: relative;
  padding: 0 50px;
}

.rd-country-cards-swiper {
  overflow: hidden;
}

.rd-country-cards-swiper .swiper-slide {
  width: auto !important;
  height: auto;
}

/* Swiper navigation buttons */
.rd-country-cards-carousel .swiper-button-prev,
.rd-country-cards-carousel .swiper-button-next {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid #e0e0e0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: all 0.2s ease;
}

.rd-country-cards-carousel .swiper-button-prev::after,
.rd-country-cards-carousel .swiper-button-next::after {
  font-size: 18px;
  font-weight: bold;
  color: #62c8fb;
}

.rd-country-cards-carousel .swiper-button-prev:hover,
.rd-country-cards-carousel .swiper-button-next:hover {
  border-color: #62c8fb;
  background: #62c8fb;
}

.rd-country-cards-carousel .swiper-button-prev:hover::after,
.rd-country-cards-carousel .swiper-button-next:hover::after {
  color: #fff;
}

.rd-country-cards-carousel .swiper-button-prev {
  left: 0;
}

.rd-country-cards-carousel .swiper-button-next {
  right: 0;
}

.rd-country-cards-carousel .swiper-button-disabled {
  opacity: 0.3;
}

/* Grid layout */
.rd-country-cards-grid-inner {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  padding: 10px 5px;
}

/* Country card - 300px width */
.rd-country-card {
  flex: 0 0 300px;
  min-width: 300px;
  max-width: 300px;
  background: #e7f8ff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  flex-direction: column;
}

.rd-country-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

/* Blue border top */
.rd-country-card-border-top {
  height: 10px;
  background: #62c8fb;
}

/* Image with name overlay */
.rd-country-card-image {
  position: relative;
  height: 160px;
  overflow: hidden;
  background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
}

.rd-country-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.rd-country-card:hover .rd-country-card-image img {
  transform: scale(1.08);
}

.rd-country-card-name-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.25);
  text-align: center;
  padding: 10px;
}

.rd-country-card-flag {
  font-size: 2.5rem;
  line-height: 1;
  margin-bottom: 8px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.rd-country-card-name {
  font-size: 1.5rem;
  font-weight: 700;
  color: #fff;
  margin: 0;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
}

/* Actions bar - two-tone background */
.rd-country-card-actions {
  display: flex;
  margin: 0;
  border: none;
}

.rd-country-card-link {
  flex: 1 1 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 16px;
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  transition: opacity 0.15s ease;
  white-space: nowrap;
  color: #fff;
}

.rd-country-card-link:hover {
  opacity: 0.85;
  color: #fff;
}

.rd-country-card-link svg {
  flex-shrink: 0;
}

.rd-country-card-link-guide {
  background: #62c8fb;
}

.rd-country-card-link-articles {
  background: #81d9ff;
}

/* Description content */
.rd-country-card-content {
  padding: 20px;
  flex: 1;
  min-height: 150px;
}

.rd-country-card-description {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
  font-size: 1rem;
  font-weight: 400;
  font-style: normal;
  color: #333;
  line-height: 1.6;
  margin: 0;
}

/* Blue border bottom */
.rd-country-card-border-bottom {
  height: 10px;
  background: #62c8fb;
  margin-top: auto;
}

/* Responsive */
@media (max-width: 768px) {
  .rd-country-cards-wrapper {
    padding: 20px 12px;
    border-radius: 12px;
  }

  .rd-country-alphabet-bar {
    gap: 4px;
    margin-bottom: 16px;
  }

  .rd-country-alphabet-btn {
    width: 28px;
    height: 28px;
    font-size: 0.75rem;
  }

  .rd-country-cards-carousel {
    padding: 0;
  }

  .rd-country-cards-carousel .swiper-button-prev,
  .rd-country-cards-carousel .swiper-button-next {
    display: none;
  }

  .rd-country-card {
    flex: 0 0 280px;
    min-width: 280px;
    max-width: 280px;
    scroll-snap-align: start;
  }

  .rd-country-card-image {
    height: 140px;
  }

  .rd-country-card-content {
    min-height: 120px;
  }

  .rd-country-cards-title {
    font-size: 1.4rem;
  }

  .rd-country-cards-subtitle {
    font-size: 0.9rem;
  }

  .rd-country-card-link {
    font-size: 0.85rem;
  }

  .rd-country-card-link svg {
    width: 14px;
    height: 14px;
  }
}

@media (max-width: 480px) {
  .rd-country-card {
    flex: 0 0 260px;
    min-width: 260px;
    max-width: 260px;
  }

  .rd-country-card-image {
    height: 130px;
  }

  .rd-country-card-content {
    padding: 12px;
    min-height: 100px;
  }

  .rd-country-card-name {
    font-size: 1.2rem;
  }

  .rd-country-card-flag {
    font-size: 2rem;
  }

  .rd-country-card-description {
    font-size: 0.85rem;
  }

  .rd-country-alphabet-btn {
    width: 26px;
    height: 26px;
    font-size: 0.7rem;
  }

  .rd-country-card-actions {
    padding: 10px 12px;
  }
}
