/* ===================================
   CONTAINER & CENTERING
   =================================== */

.container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  background-image: url("../assets/images/maps/mainbkg.jpg");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  position: relative;
}

.container::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    135deg,
    rgba(26, 26, 46, 0.6) 0%,
    rgba(22, 33, 62, 0.6) 50%,
    rgba(15, 52, 96, 0.6) 100%
  );
  backdrop-filter: blur(8px);
  z-index: 1;
}

/* ===================================
   MODAL LAYOUT
   =================================== */

/* Modal Layout */
.modal {
  position: relative;
  z-index: 2;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-radius: var(--border-radius-xs);
  box-shadow: var(--shadow-heavy);
  width: 100%;
  max-width: 1400px;
  max-height: 90vh;
  overflow: hidden;
  animation: modalSlideIn 0.3s ease-out;
}

/* Keyframes moved to animations.css */

.modal-header {
  background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
  color: white;
  padding: 20px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-title {
  font-size: 1.5rem;
  font-weight: 600;
  margin: 0;
}

/* Modal Body with Sidebar and Main Content */
.modal-body {
  display: flex;
  height: calc(90vh - 80px);
  overflow: hidden;
  /* Ensure no edge bleeding */
  position: relative;
}

/* Sidebar Layout */
.sidebar {
  width: 280px;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border-color);
  overflow-y: auto;
  flex-shrink: 0;
}

/* Main Content Area */
.main-content {
  flex: 1;
  padding: 30px;
  overflow-y: auto;
  background: var(--bg-primary);
  /* Ensure proper overflow handling */
  overflow-x: hidden;
}

.content-header {
  margin-bottom: 30px;
}

.content-header h3 {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.content-header p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin: 0;
}

/* Maps Grid */
.maps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--space-4);
  padding: var(--space-4);
  margin-bottom: var(--space-8); /* Add bottom margin to see all cards */
  align-items: stretch; /* Ensure all cards have equal height */
  /* Hide scrollbar */
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE and Edge */
}

/* Hide scrollbar for Webkit browsers */
.maps-grid::-webkit-scrollbar {
  display: none;
}

/* Responsive Grid */
@media (max-width: 1200px) {
  .maps-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  }
}

@media (max-width: 768px) {
  .maps-grid {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  }

  .main-content {
    padding: 20px;
  }
}

@media (max-width: 480px) {
  .maps-grid {
    grid-template-columns: 1fr;
  }
}

/* Action Buttons Layout */
.action-buttons {
  display: flex;
  gap: 12px;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border-color);
}

/* Feature Grid Layout */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

/* Settings Form Layout */
.settings-form {
  margin-top: 20px;
}

/* Responsive Layout */
@media (max-width: 768px) {
  .modal {
    max-width: 95vw;
    max-height: 95vh;
  }

  .modal-body {
    flex-direction: column;
    height: calc(95vh - 80px);
  }

  .sidebar {
    width: 100%;
    max-height: 200px;
    border-right: none;
    border-bottom: 1px solid var(--border-color);
  }

  .map-preview {
    height: 120px;
  }

  .map-image {
    font-size: 2rem;
  }
}

@media (max-width: 480px) {
  .modal-header {
    padding: 16px 20px;
  }

  .modal-title {
    font-size: 1.25rem;
  }

  .main-content {
    padding: 15px;
  }

  .maps-grid {
    gap: 15px;
  }
}
