/* Apply main theme background */
body {
  background-color: var(--mdc-theme-background, #f4f4f4);
  margin: 0;
  padding: 0;
}

/* Main info panel layout */
#info-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 24px;
    box-sizing: border-box;
}

/* Container for the DIGIPIN text and its copy button */
#digipin-container {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    margin-bottom: 16px; /* Added space below the DIGIPIN */
}

/* The main DIGIPIN text */
#viewer-digipin {
    margin: 0;
    color: var(--mdc-theme-primary, #0057b3);
    margin-right: 8px;
    text-align: center;
    line-height: 1.2; /* Improves vertical centering of text */
}

/*
 * NEW: Styles for the single-line Latitude and Longitude display
 */
#coordinates-container {
    display: flex;
    width: 100%;
    border-top: 1px solid rgba(0,0,0,0.12);
    border-bottom: 1px solid rgba(0,0,0,0.12);
    margin-bottom: 16px; /* Space below the container */
}

.coordinate-item {
    width: 50%;
    text-align: center;
    padding: 16px 8px;
    box-sizing: border-box;
}

.coordinate-item:first-child {
    border-right: 1px solid rgba(0,0,0,0.12); /* Visual separator */
}

.coordinate-item .mdc-list-item__primary-text {
    font-size: 1rem;
    color: #000;
    display: block; /* Ensure it takes its own line */
}

.coordinate-item .mdc-list-item__secondary-text {
    font-size: 0.875rem;
    color: rgba(0,0,0,0.6);
}

/* A reusable class for adding vertical space */
.panel-section {
    width: 100%;
    margin-top: 16px; /* Consistent top margin for each section */
}

/* MODIFIED: Helper class to center the content of a panel section */
.panel-section--centered {
    text-align: center;
}

/* The sub-header for the "Share & Download" section */
.section-header {
    margin: 0;
    margin-bottom: 16px;
    width: 100%;
    text-align: center;
    color: rgba(0,0,0,0.6);
    border-top: 1px solid rgba(0,0,0,0.12); /* A standard MDC divider color */
    padding-top: 24px;
}

/* MODIFIED: Centering the "Open in Maps" button container */
#info-panel .mdc-menu-surface--anchor {
    margin: 0 auto; /* Center the button */
    display: block;
    width: fit-content; /* Shrink to fit button width */
}

/* Container for the QR code preview */
#qr-preview-container {
    padding: 8px;
    background: white;
    border: 1px solid #eee;
    margin-bottom: 16px;
    display: inline-flex; /* Use inline-flex to shrink-wrap the container */
}

/* Container for download controls */
#qr-download-section {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    gap: 16px; /* Adds space between the select dropdown and the button */
}

#qr-size-select {
    flex-grow: 1; /* Allows the select to take up available horizontal space */
}

/* Map viewer styling */
#map-viewer {
  flex-grow: 1;
  height: 100%;
  width: 100%;
  min-height: 80vh;
  border-radius: 4px;
  overflow: hidden; /* Ensures map tiles respect the border-radius */
}

/* Responsive adjustments for smaller screens */
@media (max-width: 599px) {
  #map-viewer {
    height: 550px;
  }
  #info-panel {
    padding: 16px;
  }
  #viewer-digipin {
    font-size: 1.75rem; /* Make font slightly smaller on mobile */
  }

  /* On mobile, stack the QR download controls vertically for better usability */
  #qr-download-section {
    flex-direction: column;
    align-items: stretch; /* Make controls take full width */
  }
}