/* Regions Page - Integrates with global design system */

/* Hero Section */
.regions-hero {
  position: relative;
  height: 400px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  color: white;
}

.regions-hero .hero-background {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(0, 87, 183, 0.9) 0%, rgba(0, 87, 183, 0.7) 50%, rgba(255, 215, 0, 0.1) 100%);
}

.regions-hero .hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: 
    radial-gradient(circle at 20% 50%, rgba(255, 215, 0, 0.05) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(255, 255, 255, 0.03) 0%, transparent 50%);
  opacity: 1;
}

.regions-hero .hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  width: 100%;
  padding: 2rem;
  max-width: 600px;
  animation: fadeInUp 0.8s ease;
}

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

.regions-hero .hero-tag {
  display: inline-block;
  margin-bottom: 1rem;
  padding: 0.5rem 1.2rem;
  background: rgba(255, 215, 0, 0.15);
  color: var(--accent);
  border-radius: 2.5rem;
  font-size: 0.875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  border: 1px solid rgba(255, 215, 0, 0.3);
}

.regions-hero h1 {
  font-size: clamp(2rem, 6vw, 3.5rem);
  font-weight: 800;
  margin: 1rem 0;
  line-height: 1.2;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.regions-hero p {
  font-size: 1.125rem;
  margin-top: 1rem;
  opacity: 0.95;
  line-height: 1.5;
  text-shadow: 0 1px 5px rgba(0, 0, 0, 0.1);
}

/* Content Section */
.regions-section {
  padding: 4rem 0;
  background: var(--bg);
}

.section-title {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 3rem;
  text-align: center;
  color: var(--text);
}

/* Main Grid */
.regions-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: start;
}

/* Map Section */
.map-wrapper {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
  overflow: hidden;
}

.ukraine-map {
  width: 100%;
  height: auto;
  display: block;
}

.map-legend {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  font-size: 0.875rem;
  color: var(--muted);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.legend-dot {
  display: inline-block;
  width: 12px;
  height: 12px;
  background: var(--accent);
  border-radius: 50%;
}

/* Info Panel */
.info-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 2rem;
  height: 100%;
  max-height: 600px;
  overflow-y: auto;
  transition: background 0.3s ease;
}

.panel-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 300px;
  text-align: center;
  color: var(--muted);
  font-size: 1.125rem;
}

.panel-content {
  animation: fadeIn 0.3s ease;
}

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

#regionName {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--primary);
}

.region-header {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 2px solid var(--border);
}

.region-flag {
  width: 80px;
  height: auto;
  border-radius: 4px;
  border: 1px solid var(--border);
  object-fit: cover;
}

.region-title h3 {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0 0 0.5rem 0;
  color: var(--primary);
}

.region-title {
  flex: 1;
}

.region-meta {
  font-size: 0.875rem;
  color: var(--muted);
  margin-bottom: 2rem;
  display: flex;
  gap: 1rem;
}

.members-container h4 {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--text);
}

.members {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.member-card {
  padding: 1rem;
  border-left: 3px solid var(--accent);
  background: var(--bg);
  border-radius: 4px;
  transition: all 0.3s ease;
}

.member-card:hover {
  background: var(--surface);
  border-left-color: var(--primary);
}

.member-card {
  cursor: pointer;
}

.member-name {
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.25rem;
}

.member-position {
  font-size: 0.875rem;
  color: var(--primary);
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.member-contacts {
  font-size: 0.8rem;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.member-contacts a {
  color: var(--primary);
  text-decoration: none;
  transition: opacity 0.3s ease;
}

.member-contacts a:hover {
  opacity: 0.7;
  text-decoration: underline;
}

/* Member Modal */
.member-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.member-modal.active {
  display: flex;
}

.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  animation: fadeIn 0.3s ease;
}

.modal-card {
  position: relative;
  background: var(--surface);
  border-radius: 12px;
  border: 1px solid var(--border);
  max-width: 500px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  animation: slideIn 0.3s ease;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

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

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: transparent;
  border: none;
  font-size: 2rem;
  color: var(--text);
  cursor: pointer;
  z-index: 10;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.3s ease;
}

.modal-close:hover {
  background: var(--bg);
  color: var(--primary);
}

.modal-body {
  padding: 2rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  align-items: flex-start;
}

.modal-image {
  flex: 0 0 auto;
  width: 150px;
}

.modal-image img {
  width: 150px;
  height: 150px;
  border-radius: 8px;
  object-fit: cover;
  border: 2px solid var(--border);
  display: block;
}

.modal-info {
  flex: 1 1 0;
  min-width: 0;
}

.modal-name {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0 0 0.75rem 0;
  color: var(--primary);
}

.modal-position {
  font-size: 1rem;
  color: var(--accent);
  font-weight: 600;
  margin: 0 0 1rem 0;
}

.modal-details {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.detail-item {
  font-size: 0.9rem;
  color: var(--text);
}

.detail-item strong {
  color: var(--primary);
  font-weight: 600;
}

.modal-bio {
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.5;
  margin: 0;
}

.member-name {
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.25rem;
}

.member-position {
  font-size: 0.875rem;
  color: var(--primary);
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.member-contacts {
  font-size: 0.8rem;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.member-contacts a {
  color: var(--primary);
  text-decoration: none;
  transition: opacity 0.3s ease;
}

.member-contacts a:hover {
  opacity: 0.7;
  text-decoration: underline;
}

/* Responsive - Tablet & Mobile */
@media (max-width: 1120px) {
  .regions-grid {
    grid-template-columns: 1fr;
    gap: 3rem;
  }

  .info-panel {
    max-height: none;
  }

  .section-title {
    font-size: 1.75rem;
    margin-bottom: 2rem;
  }
}

@media (max-width: 880px) {
  .regions-hero {
    padding: 4rem 0;
  }

  .regions-hero h1 {
    font-size: 2.5rem;
  }

  .regions-hero p {
    font-size: 1rem;
  }

  .regions-section {
    padding: 3rem 0;
  }
}

@media (max-width: 760px) {
  .regions-hero {
    padding: 3rem 0;
  }

  .regions-hero h1 {
    font-size: 1.875rem;
  }

  .regions-hero .hero-tag {
    font-size: 0.8rem;
    margin-bottom: 0.75rem;
  }

  .regions-grid {
    gap: 2rem;
  }

  .map-wrapper {
    padding: 0.75rem;
  }

  .info-panel {
    padding: 1.5rem;
  }

  .section-title {
    font-size: 1.5rem;
  }

  #regionName {
    font-size: 1.5rem;
  }

  .member-card {
    padding: 0.75rem;
  }
}

@media (max-width: 520px) {
  .regions-hero {
    padding: 2rem 0;
  }

  .regions-hero h1 {
    font-size: 1.5rem;
  }

  .regions-hero p {
    font-size: 0.95rem;
  }

  .regions-section {
    padding: 2rem 0;
  }

  .section-title {
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
  }

  .ukraine-map {
    width: 100%;
    height: auto;
  }

  #regionName {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
  }

  .region-meta {
    flex-direction: column;
    gap: 0.5rem;
    font-size: 0.8rem;
  }

  .members-container h4 {
    font-size: 1rem;
    margin-bottom: 0.75rem;
  }

  .member-card {
    padding: 0.75rem;
    font-size: 0.9rem;
  }

  .member-name {
    font-size: 0.95rem;
  }

  .member-position {
    font-size: 0.8rem;
  }

  .member-contacts {
    font-size: 0.75rem;
  }
}

/* Dark Theme Support */
body.dark-theme .regions-hero {
  background: linear-gradient(135deg, var(--primary), var(--surface));
}

body.dark-theme .info-panel {
  background: var(--surface);
  border-color: var(--border);
}

body.dark-theme .member-card {
  background: var(--bg);
}

body.dark-theme .member-card:hover {
  background: rgba(255, 215, 0, 0.05);
}

/* Scrollbar Styling */
.info-panel::-webkit-scrollbar {
  width: 6px;
}

.info-panel::-webkit-scrollbar-track {
  background: var(--bg);
}

.info-panel::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

.info-panel::-webkit-scrollbar-thumb:hover {
  background: var(--muted);
}
