/**
 * Amazon Country Selector Modal Styles
 */

/* Modal Overlay */
#amazon-country-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  z-index: 999999;
  justify-content: center;
  align-items: center;
  padding: 20px;
  animation: fadeIn 0.3s ease-in-out;
}

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

/* Modal Container */
.country-modal-container {
  background-color: #ffffff;
  border-radius: 12px;
  max-width: 600px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  position: relative;
  animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
  from {
    transform: translateY(-50px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Modal Header */
.country-modal-header {
  padding: 30px 30px 20px;
  text-align: center;
  border-bottom: 2px solid #f0f0f0;
  position: relative;
}

.country-modal-header h2 {
  margin: 0 0 10px 0;
  font-size: 28px;
  color: #333;
  font-weight: 700;
}

.country-modal-header p {
  margin: 0;
  font-size: 16px;
  color: #666;
  line-height: 1.5;
}

/* Close Button */
.modal-close {
  position: absolute;
  top: 15px;
  right: 15px;
  background: none;
  border: none;
  font-size: 32px;
  color: #999;
  cursor: pointer;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s ease;
}

.modal-close:hover {
  background-color: #f0f0f0;
  color: #333;
  transform: rotate(90deg);
}

/* Modal Body */
.country-modal-body {
  padding: 30px;
}

/* Country Grid */
.country-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 15px;
  margin-top: 20px;
}

/* Country Button */
.country-select-btn {
  background-color: #f8f9fa;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  padding: 15px 10px;
  font-size: 14px;
  font-weight: 600;
  color: #333;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.country-select-btn:hover {
  background-color: #d16d22;
  border-color: #d16d22;
  color: #ffffff;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(209, 109, 34, 0.3);
}

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

/* Country Flag */
.country-flag {
  font-size: 32px;
  line-height: 1;
}

/* Country Name */
.country-name {
  font-size: 13px;
  line-height: 1.2;
}

/* Country Indicator in Header */
#country-indicator {
  position: fixed;
  top: 80px;
  right: 20px;
  background-color: #d16d22;
  color: #ffffff;
  padding: 10px 20px;
  border-radius: 25px;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  z-index: 9999;
  display: none;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
}

#country-indicator:hover {
  background-color: #512a0d;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

#country-indicator.visible {
  display: flex;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
  .country-modal-container {
    max-width: 100%;
    margin: 0;
    border-radius: 12px 12px 0 0;
    max-height: 80vh;
  }

  .country-modal-header {
    padding: 20px 20px 15px;
  }

  .country-modal-header h2 {
    font-size: 24px;
  }

  .country-modal-header p {
    font-size: 14px;
  }

  .country-modal-body {
    padding: 20px;
  }

  .country-grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
  }

  .country-select-btn {
    padding: 12px 8px;
    font-size: 12px;
  }

  .country-flag {
    font-size: 28px;
  }

  .country-name {
    font-size: 11px;
  }

  #country-indicator {
    top: 60px;
    right: 10px;
    padding: 8px 15px;
    font-size: 12px;
  }
}

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

  #amazon-country-modal {
    padding: 0;
    align-items: flex-end;
  }

  .country-modal-container {
    border-radius: 20px 20px 0 0;
  }
}

/* Scrollbar Styling */
.country-modal-container::-webkit-scrollbar {
  width: 8px;
}

.country-modal-container::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 10px;
}

.country-modal-container::-webkit-scrollbar-thumb {
  background: #d16d22;
  border-radius: 10px;
}

.country-modal-container::-webkit-scrollbar-thumb:hover {
  background: #512a0d;
}

/* Loading State */
.country-select-btn.loading {
  opacity: 0.6;
  pointer-events: none;
}

/* Success State */
.country-select-btn.selected {
  background-color: #4caf50;
  border-color: #4caf50;
  color: #ffffff;
}

.country-select-btn.selected::after {
  content: "✓";
  position: absolute;
  top: 5px;
  right: 5px;
  font-size: 18px;
}

