@import url("mobile-optimization.css");

/* Alabama State Site Styles */
body {
  font-family: Arial, sans-serif;
  margin: 0;
  padding: 1.5rem;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
  background: #f9f9f9;
}

header, footer {
  text-align: center;
  margin-bottom: 2rem;
}

header h1 {
  font-size: 1.4rem;
  margin-bottom: 0.5rem;
}

nav {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1rem;
}

nav a {
  text-decoration: none;
  color: #0074cc;
  font-size: 0.95rem;
}

input[type="text"] {
  font-size: 1rem;
  padding: 0.75rem;
  width: 100%;
  box-sizing: border-box;
  margin-bottom: 1rem;
  border: 1px solid #ccc;
  border-radius: 5px;
}

button {
  width: 100%;
  padding: 0.75rem;
  font-size: 1rem;
  background-color: #0074cc;
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
}

button:hover {
  background-color: #005fa3;
}

footer p {
  font-size: 0.8rem;
  color: #666;
}

.map-container {
  position: relative;
  width: 100%;
  height: 450px;
  margin: 2rem 0;
  background: #fff;
  border: 2px solid #1976d2;
  border-radius: 8px;
  overflow: hidden;
}

#map {
  width: 100%;
  height: 60vh;
  border-radius: 8px;
  margin-bottom: 2rem;
  z-index: 1;
}

/* District tooltips */
.district-tooltip {
  background: white;
  border: none;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  padding: 0;
  border-radius: 8px;
  font-size: 14px;
  max-width: 300px;
}

.tooltip-content {
  line-height: 1.4;
  padding: 15px;
}

.tooltip-content h3 {
  margin: 0 0 8px 0;
  font-size: 16px;
  color: #333;
}

.tooltip-content p {
  margin: 0 0 12px 0;
  color: #666;
}

.tooltip-ctas {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cta-button {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 6px;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: background-color 0.2s;
}

.cta-button.call {
  background-color: #34c759;
  color: white;
}

.cta-button.email {
  background-color: #007aff;
  color: white;
}

/* Mobile district details panel */
.district-details-panel {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: white;
  border-radius: 16px 16px 0 0;
  box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
  z-index: 1000;
  transform: translateY(100%);
  transition: transform 0.3s ease-out;
  max-height: 80vh;
  overflow-y: auto;
}

.district-details-panel.active {
  transform: translateY(0);
}

.district-details-content {
  padding: 20px;
}

.close-panel {
  position: absolute;
  top: 10px;
  right: 10px;
  background: none;
  border: none;
  font-size: 24px;
  color: #666;
  cursor: pointer;
  padding: 5px;
}

.rep-info {
  display: flex;
  align-items: center;
  margin-bottom: 20px;
}

.rep-photo {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  margin-right: 15px;
  object-fit: cover;
}

.rep-text h3 {
  margin: 0 0 5px 0;
  font-size: 18px;
}

.rep-text p {
  margin: 0;
  color: #666;
}

.staff-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.staff-member {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid #eee;
}

.staff-contacts {
  display: flex;
  gap: 10px;
}

.staff-contact {
  text-decoration: none;
  font-size: 18px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .tooltip-content {
    padding: 10px;
  }
  
  .cta-button {
    padding: 6px 10px;
    font-size: 13px;
  }
  
  .district-details-panel {
    max-height: 90vh;
  }
}

/* Print styles */
@media print {
  .district-details-panel,
  .cta-button,
  .close-panel {
    display: none;
  }
}

footer p {
  font-size: 0.8rem;
  color: #666;
}

.map-container {
  position: relative;
  width: 100%;
  height: 450px;
  margin: 2rem 0;
  background: #fff;
  border: 2px solid #1976d2;
  border-radius: 8px;
  overflow: hidden;
}

#map {
  width: 100%;
  height: 100%;
}

#tooltip {
  position: absolute;
  opacity: 0;
  transition: opacity 0.2s;
  background: white;
  border: 1px solid #ccc;
  border-radius: 4px;
  padding: 0.8rem;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.15);
  font-size: 0.9rem;
  color: #333;
  max-width: 250px;
  z-index: 10;
  pointer-events: none;
}

#tooltip.active {
  opacity: 1;
  pointer-events: auto;
  cursor: default;
  border: 1px solid #0074cc;
}

.contact-buttons {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.contact-btn, .survey-btn {
  padding: 8px 12px;
  font-size: 0.85rem;
  cursor: pointer;
  border: none;
  border-radius: 4px;
  width: auto;
  transition: all 0.2s ease;
  position: relative;
  display: inline-block;
  text-align: center;
  font-weight: 500;
  flex: 1;
}

.contact-btn {
  background-color: #28a745;
  color: white;
}

.survey-btn {
  background-color: #0074cc;
  color: white;
}

.contact-btn:hover, .contact-btn:focus {
  background-color: #218838;
  transform: translateY(-1px);
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.survey-btn:hover, .survey-btn:focus {
  background-color: #005fa3;
  transform: translateY(-1px);
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.contact-btn:active, .survey-btn:active {
  transform: translateY(0);
  box-shadow: 0 1px 2px rgba(0,0,0,0.2);
  opacity: 0.9;
}

.district {
  stroke: #fff;
  stroke-width: 0.5px;
  transition: fill 0.3s;
}

.district:hover {
  stroke: #000;
  stroke-width: 1.5px;
  cursor: pointer;
}

.selected-district {
  stroke: #000;
  stroke-width: 2.5px;
  opacity: 1;
}

.district-label {
  pointer-events: none;
  font-size: 12px;
  font-weight: bold;
  text-shadow: 1px 1px 1px #fff;
}

.district {
  cursor: pointer;
}

.selected-district {
  stroke: #000;
  stroke-width: 2px;
}

#map-legend {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background: rgba(255, 255, 255, 0.9);
  padding: 6px 8px;
  border-radius: 4px;
  border: 1px solid #ddd;
  font-size: 0.8rem;
}

.legend-item {
  display: flex;
  align-items: center;
  margin-bottom: 4px;
}

.legend-color {
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-right: 5px;
  border: 1px solid #fff;
}

.legend-label {
  line-height: 12px;
}

.tooltip-header {
  font-weight: bold;
  margin-bottom: 6px;
  border-bottom: 1px solid #eee;
  padding-bottom: 4px;
}

.tooltip-content {
  padding: 15px;
}