/* styles.css - Controls & Map Same Width + Mobile Friendly */

* {
    box-sizing: border-box;
}

body {
    font-family: 'Roboto', system-ui, sans-serif;
    background: linear-gradient(135deg, #f0f4f8, #e0e7ff);
    margin: 0;
    padding: 15px;
    color: #1e2937;
}

.container {
    max-width: 1450px;
    margin: 0 auto;
}

h1 {
    text-align: center;
    color: #1e3a8a;
    font-size: 2.2rem;
    margin-bottom: 20px;
    font-weight: 700;
}

/* Main Layout */
.main-layout {
    display: flex;
    gap: 25px;
    align-items: flex-start;
}

.left-section {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

/* Controls + Map - Same Width */
.controls, .map-wrapper {
    width: 100%;
    max-width: 100%;
}

.controls {
    background: white;
    padding: 18px 20px;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.controls label {
    font-weight: 700;
    color: #1e40af;
    font-size: 1.1rem;
    
    white-space: nowrap;
}

.controls select {
    padding: 12px 16px;
    font-size: 1.05rem;
    font-weight: 600;
    border: 2px solid #60a5fa;
    border-radius: 10px;
    background: white;
    color: #1e40af;
    cursor: pointer;
    flex: 1;
    min-width: 200px;
}

.map-wrapper {
    position: relative;
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    aspect-ratio: 900 / 1000;
    flex: 1;
}

/* Right Sidebar */
.sidebar {
    width: 400px;
    flex-shrink: 0;
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.12);
    padding: 24px;
    position: sticky;
    top: 20px;
}

/* Right Panel Styling */
.info-panel h2 {
    color: #1e40af;
    margin-top: 0;
    font-size: 1.6rem;
    font-weight: 700;
}

#selected-state-name {
    font-size: 1.45rem;
    font-weight: 700;
    color: #1e40af;
    margin-bottom: 18px;
}

.state-detail {
    display: grid;
    grid-template-columns: 145px 1fr;
    gap: 12px;
    padding: 16px 14px;
    margin-bottom: 8px;
    border-radius: 12px;
    font-size: 1.08rem;
    font-weight: 500;
    align-items: center;
}

.state-detail:hover {
    transform: translateX(6px);
}

/* Colorful Backgrounds */
.state-detail:nth-child(2)  { background: #fefce8; }
.state-detail:nth-child(3)  { background: #dbeafe; }
.state-detail:nth-child(4)  { background: #f3e8ff; }
.state-detail:nth-child(5)  { background: #ecfdf5; }
.state-detail:nth-child(6)  { background: #fefce8; }
.state-detail:nth-child(7)  { background: #f0f9ff; }
.state-detail:nth-child(8)  { background: #fef2f2; }
.state-detail:nth-child(9)  { background: #ecfdf5; }
.state-detail:nth-child(10) { background: #f0f9ff; }
.state-detail:nth-child(11) { background: #fefce8; }
.state-detail:nth-child(12)  { background:#dbeafe; }
.state-detail:nth-child(13)  { background: #f3e8ff; }
.state-detail:nth-child(14)  { background: #ecfdf5; }

.state-detail strong {
    font-weight: 700;
    color: #1e40af;
}

/* Clear Button */
.clear-btn {
    margin-top: 20px;
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #ef4444, #f87171);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
}

.clear-btn:hover {
    transform: translateY(-3px);
}

/* Map Interactions */
path, g[id^="IN"] {
    transition: all 0.4s ease;
    cursor: pointer;
}

path:hover, g[id^="IN"]:hover > path {
    filter: brightness(1.25) saturate(1.4);
    stroke: #f59e0b;
    stroke-width: 3px;
}

.selected-state {
    animation: pulse 1.6s infinite ease-in-out;
}

@keyframes pulse {
    0%, 100% { filter: brightness(1) saturate(1); }
    50% { filter: brightness(1.45) saturate(1.8); }
}

/* Tooltip */
.map-tooltip {
    position: absolute;
    background: rgba(15, 23, 42, 0.95);
    color: white;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    pointer-events: none;
    z-index: 1000;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

/* ==================== MOBILE RESPONSIVE ==================== */
@media (max-width: 1100px) {
    .main-layout {
        flex-direction: column;
    }
    .sidebar {
        width: 100%;
        position: static;
    }
}

@media (max-width: 768px) {
    h1 {
        font-size: 1.9rem;
    }
    
    .controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .controls select {
        min-width: auto;
    }
    
    .map-wrapper {
        aspect-ratio: 4 / 5;
        max-height: 70vh;
    }
    
    .state-detail {
        grid-template-columns: 1fr;
        font-size: 1rem;
        padding: 12px;
    }
 
}







/* Modal Background */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(0,0,0,0.85), rgba(30,64,175,0.6));
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Modal Box */
.modal-content {
  background: #ffffff;
  padding: 40px 50px;
  border-radius: 20px;
  max-width: 520px;
  width: 90%;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,0.4);
  font-family: 'Roboto', sans-serif;
  animation: modalPop 0.4s ease;
}

/* Animation */
@keyframes modalPop {
  from { transform: scale(0.6); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

/* Heading */
.modal-content h2 {
  color: #1e40af;
  margin-bottom: 15px;
  font-size: 30px;
  font-weight: 700;
}

/* Instruction Heading */
.instruction-title {
  text-align: left;
  font-size: 24px;
  font-weight: 700;
  color: #1e40af;
  margin-top: 20px;
  margin-bottom: 10px;
  border-left: 5px solid #10b981;
  padding-left: 12px;
  letter-spacing: 0.5px;
}

/* Instruction Title */
.modal-content p {
  font-size: 20px;
  font-weight: 700;
  color: #111827;
  margin-top: 10px;
}

/* Instruction List */
.modal-content ul {
  text-align: left;
  line-height: 2.2;
  margin: 25px 0;
  padding-left: 25px;
  font-size: 18px;   /* 🔥 Bigger instructions */
  color: #374151;
}

/* Highlight bold text */
.modal-content ul strong {
  color: #1e40af;
  font-weight: 600;
}

/* Button */
.start-btn {
  padding: 15px 50px;
  font-size: 18px;
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  margin-top: 20px;
  font-weight: 600;
  letter-spacing: 0.5px;
  transition: all 0.3s ease;
  box-shadow: 0 10px 25px rgba(16,185,129,0.4);
}

/* Button Hover */
.start-btn:hover {
  transform: translateY(-4px) scale(1.05);
  box-shadow: 0 15px 35px rgba(16,185,129,0.6);
}