:root {
  --primary: #003366;
  --accent: #ffb400;
  --bg: #f5f7fa;
  --shadow: 0 4px 15px rgba(0,0,0,.08);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, Segoe UI, sans-serif;
  background: var(--bg);
  color: #2c3e50;
}

/* Unified Width Layout */
header, footer, .container {
  max-width: 700px;
  width: 100%;
  margin: 0 auto;
}

header {
  position: sticky;
  top: 0;
  background: var(--primary);
  color: #fff;
  text-align: center;
  padding-top: 0.5rem;
  z-index: 1000;
}

nav {
   width: 100%;
   background: #062a40;
   padding: 0;
   display: flex;
   justify-content: center;
   box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

nav a {
    color: #fff;
    text-decoration: none;
    padding: 15px 18px;
    font-weight: 600;
    font-size: 0.95rem;
    transition: 0.3s;
    white-space: nowrap;
}

nav a:hover { color: var(--accent); }
nav a:active { color: #000000; }
nav a.active { color: var(--accent); }

.page-wrapper {
  display: flex;
  justify-content: center;
  gap: 20px;
  padding: 0 10px;
}

.container { padding: 1.5rem 0; }

/* Content Cards */
.info-section, .search-card, .card, .box {
  background: #fff;
  padding: 1.5rem;
  border-radius: 12px;
  box-shadow: var(--shadow);
  margin-bottom: 1.5rem;
}

.info-section h1 { text-align: center; }

.info-section h2 {
 margin: 0 0 10px;
 color: var(--primary);
 border-bottom: 2px solid var(--accent);
 display: inline-block;
}

.info-section p { text-align: justify; }

.info-section ul {
 list-style: none;
 padding: 0; margin: 0;
}

.info-section li {
 margin: 8px 0;
 padding-left: 1.2rem;
 position: relative;
}

.info-section li::before {
 content: "•";
 color: var(--accent);
 position: absolute;
 left: 0;
 font-weight: bold;
}

/* Tabs & Inputs */
.search-card {
  background:#fff;
  border-radius:10px;
  box-shadow:var(--shadow);
  padding:1.5rem;
  border:1px solid var(--accent);
  border-top:5px solid var(--accent);
}

.search-tabs {
 display: flex;
 gap: 10px;
 margin-bottom: 1.5rem;
}

.tab {
  flex:1;
  padding:.7rem;
  border:1px solid #0b3c5d;
  background:#eaecef;
  cursor:pointer;
  font-weight:600;
  color:#000;
}

.tab.active {
 background: var(--primary);
 color: #fff;
}

.tab-content { display: none; }
.tab-content.active { display: block; }

input {
 width: 100%;
 padding: 12px;
 margin-bottom: 30px;
 border: 1px solid #ccc;
 border-radius: 6px;
}

button {
 width: 100%;
 padding: 12px;
 background: var(--primary);
 color: #fff;
 border: 1px solid var(--primary);
 border-radius: 6px;
 cursor: pointer;
 font-weight: bold;
}

button:hover {
 background: #eaecef;
 color: #000;
}

/* Result Cards */
.card {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-start;
    gap: 15px;
    background: #fff;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
    margin-bottom: 1.5rem;
}

.card-title {
 font-weight: bold;
 color: var(--primary);
 border-bottom: 1px solid #eee;
 padding-bottom: 8px;
 margin-bottom: 10px;
 text-transform: uppercase;
}

/* Group text info on the left */
.card-info {
    flex: 1;
    min-width: 250px;
}

.card-detail {
 font-size: 0.9rem;
 margin: 4px 0;
}

.card-actions {
 display: flex;
 gap: 10px;
 margin-top: 15px;
}

.card-footer {
 margin-top: 1rem;
 font-size: 0.8rem;
 color: #94a3b8;
 text-transform: uppercase;
}

.card-actions button {
    flex: 1; /* Makes them equal width */
    padding: 10px;
    font-size: 0.9rem;
    font-weight: bold;
    cursor: pointer;
    border-radius: 6px;
    border: none;
    transition: background 0.3s ease;
}

/* Primary style for Copy PIN */
.card-actions button:first-child {
    background: #f1f1f1;
    color: #333;
}

/* Primary style for View Map (Blue initially) */
.card-actions button:last-child {
    background: var(--primary);
    color: white;
}

.card-actions button:hover {
 background: var(--primary);
 color: #fff;
}

/* Modal */
.modal {
 display: none;
 position: fixed;
 inset: 0;
 background: rgba(0,0,0,0.8);
 z-index: 9999;
}

.modal-content {
 background: #fff;
 width: 95%;
 max-width: 600px;
 margin: 50px auto;
 padding: 20px;
 border-radius: 12px;
 position: relative;
}

#map {
    width: 100%;
    height: 400px;
    background-color: #f0f0f0;
}

.box h3 {
 color: var(--primary);
 border-bottom: 2px solid var(--accent);
 display: inline-block;
}

/* Ads */
.ad-box-300-600 {
 width: 300px;
 height: 600px;
 background: #eee;
 border: 1px solid #ccc;
 position: sticky;
 top: 100px;
 display: flex;
 align-items: center;
 justify-content: center;
}

.ad-inline {
 display: flex;
 justify-content: center;
 margin: 0 0 20px 0;
}

.ad-box-728-90 {
 width: 728px; 
 max-width: 100%;
 height: 90px;
 background: #eee;
 border: 1px solid #ccc;
 display: flex;
 align-items: center;
 justify-content: center;
}

/* Footer */
footer {
  max-width: 700px;
  width: 100%;
  margin: 0 auto;
  text-align: center;
  padding: 30px 0;
  border-top: 1px solid rgba(0, 0, 0, 0.05);
  background: transparent;
}

footer p {
  margin: 0 0 10px 0;
  color: #64748b;
  font-size: 0.85rem;
}

footer .footer-nav {
  display: flex;
  justify-content: center;
  gap: 20px;
  background: transparent; 
  box-shadow: none; 
  padding: 0;
  width: auto;  
}

footer .footer-nav a {
  color: var(--primary);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 5px 10px; 
  transition: color 0.3s ease;
}

footer .footer-nav a:hover {
  color: var(--accent);
}


/* Mobile Adjustments */
@media (max-width: 768px) {
  h1 { font-size: 20px; }
  h2 { font-size: 18px; }
  .container { padding: 10px; }
  
  nav {
    justify-content: space-around;
    flex-wrap: nowrap; 
    overflow-x: auto; 
  }

  nav a {
    padding: 12px 8px;
    font-size: 0.8rem;
  }
}

/* Toast Notification Styling */
.toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  background: #002244;
  color: #ffffff;
  padding: 12px 24px;
  border-radius: 8px;
  border-bottom: 4px solid var(--accent);
  font-weight: 600;
  font-size: 0.9rem;
  box-shadow: 0 10px 20px rgba(0,0,0,0.2);
  z-index: 10001;
  pointer-events: none;
  animation: slideUpFade 0.3s ease-out forwards;
}

@keyframes slideUpFade {
  from { opacity: 0; bottom: 10px; }
  to { opacity: 1; bottom: 30px; }
}

/* --- State List Specific Styles --- */
.state-grid {
  display: grid;
  grid-template-columns: 1fr; /* Forced Single Column */
  gap: 12px;
  margin-top: 20px;
}

.state-card {
  background: #fff;
  padding: 25px 10px;
  text-align: center;
  border-radius: 12px;
  text-decoration: none;
  color: var(--primary);
  font-weight: 600;
  font-size: 1rem;
  box-shadow: var(--shadow);
  transition: all 0.3s ease;
  border: 1px solid #eef2f6;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  min-height: 80px;
}

.state-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: 0 8px 20px rgba(0, 51, 102, 0.1);
  color: var(--primary);
}

.state-card::before {
  content: attr(data-zone);
  position: absolute;
  top: 6px;
  right: -20px;
  background: var(--accent);
  color: #000;
  font-size: 9px;
  padding: 2px 20px;
  transform: rotate(45deg);
  font-weight: 800;
  text-transform: uppercase;
}

.state-card::after {
  content: "Circle: " attr(data-circle);
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  background: var(--primary);
  color: #fff;
  font-size: 12px;
  padding: 4px 0;
  transform: translateY(100%);
  transition: transform 0.2s ease;
}

.state-card:hover::after {
  transform: translateY(0);
}

/* --- By State and District List Specific Styles --- */
/* --- State List Specific Styles --- */

.state-grid {
  display: grid;
  grid-template-columns: 1fr; /* Forced Single Column */
  gap: 12px;
  margin-top: 20px;
}

.state-card-list {
  background: #fff;
  padding: 25px 10px;
  text-align: center;
  border-radius: 12px;
  text-decoration: none;
  color: var(--primary);
  font-weight: 600;
  font-size: 1rem;
  box-shadow: var(--shadow);
  transition: all 0.3s ease;
  border: 1px solid #eef2f6;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  min-height: 80px;
}

.state-card-list:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: 0 8px 20px rgba(0, 51, 102, 0.1);
  color: var(--primary);
}


/* DIGIPIN Container on the right */

/* Clean up DIGIPIN container without the button */
.digipin-container {
    flex: 0 0 260px;
    background: #f0f7ff;
    padding: 15px;
    border-radius: 10px;
    border: 1px solid #d0e7ff;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.digipin-label {
    font-size: 0.7rem;
    color: #0056b3;
    font-weight: bold;
    margin-bottom: 5px;
}

.digipin-value {
    display: block;
    text-align: center;
    font-family: 'Courier New', monospace;
    font-size: 1.1rem;
    font-weight: bold;
    color: #2c3e50;
    padding: 5px 0;
}

/* Coordinates placement styling */
.coords-display {
    font-size: 0.75rem;
    color: #666;
    text-align: center;
    margin: 8px 0;
    background: #ffffff;
    padding: 6px;
    border-radius: 4px;
    border: 1px dashed #ccc;
}

.coords-display b { color: #002147; }

/* Action buttons at the bottom */
.card-actions {
    width: 100%;
    display: flex;
    gap: 10px;
    margin-top: 15px;
    border-top: 1px solid #eee;
    padding-top: 15px;
}

.copy-small-btn {
    width: 100%;
    padding: 5px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 0.8rem;
    cursor: pointer;
}

/* Ensure buttons stay at the bottom/left */
.card-actions {
    width: 100%;
    margin-top: 15px;
}

.coords-display {
    font-size: 0.75rem;
    color: #666;
    text-align: center;
    margin: 8px 0;
    font-family: sans-serif;
    background: #ffffff;
    padding: 4px;
    border-radius: 4px;
}

.coords-display b {
    color: #002147; /* Match your primary theme color */
}
