/* ==========================================================================
   1. VARIABLES & BASE RESETS
   ========================================================================== */
:root {
  /* Colors from Style Guide */
  --clr-gray-950: hsl(0, 0%, 17%);
  --clr-gray-400: hsl(0, 0%, 58%);
  --clr-white: hsl(0, 0%, 100%);

  /* Fonts */
  --ff-sans: "Rubik", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--ff-sans);
  font-size: 1.8rem; /* Per style guide */
  color: var(--clr-gray-950);
  background-color: #f0f0f0;
  min-height: 100vh;
}

/* ==========================================================================
   2. MOBILE LAYOUT STRUCTURE
   ========================================================================== */
.container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  position: relative;
}

/* ==========================================================================
   3. HEADER (Top Section with Purple Background Pattern)
   ========================================================================== */
header {
  background-image: url("../images/pattern-bg-mobile.png");
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center;
  /* Massive bottom padding acts as a landing zone for our floating card */
  padding: 1.5rem 1.5rem 8.5rem 1.5rem;
  text-align: center;
  color: var(--clr-white);
  z-index: 2;
}

header h1 {
  font-size: 1.6rem;
  font-weight: 500;
  margin-bottom: 1.5rem;
}

/* Mobile Search Input Row */
form {
  display: flex;
  width: 100%;
  max-width: 550px;
  margin: 0 auto;
}

form input {
  flex: 1;
  padding: 1rem 1.25rem;
  border: none;
  border-radius: 15px 0 0 15px;
  font-family: var(--ff-sans);
  font-size: 18px;
  color: var(--clr-gray-950);
  outline: none;
}

form input::placeholder {
  color: var(--clr-gray-400);
  font-size: 0.9rem;
}

form button {
  background-color: #000000;
  border: none;
  border-radius: 0 15px 15px 0;
  padding: 0 1.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s ease;
}

form button:hover {
  background-color: var(--clr-gray-950);
}

.error-message {
  color: hsl(0, 100%, 65%);
  font-size: 0.85rem;
  margin-top: 0.5rem;
  min-height: 1.2rem; /* prevents layout shift */
  /* hidden by default */
  visibility: hidden;
  margin-bottom: 2.5rem; /* Extra space to ensure the floating card doesn't overlap the input on mobile */
}

.error-message.visible {
  visibility: visible;
}

/* ==========================================================================
   4. MAIN content & FLOATING WHITE INFO CARD
   ========================================================================== */
main {
  flex: 1;
  position: relative;
  display: flex;
  flex-direction: column;
}

/* The white card housing the tracker results */
.info {
  background-color: var(--clr-white);
  padding: 1.5rem;
  border-radius: 15px;
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
  width: calc(100% - 3rem); /* Margin space on left/right edges */
  margin: 0 auto;

  /* Positions the card precisely over the header-to-map divide line */
  position: absolute;
  top: 0;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 10;

  /* Stacks content vertically on mobile */
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  text-align: center;
}

/* Typography styles for the card properties */
.info-item .label {
  font-size: 0.65rem;
  color: var(--clr-gray-400);
  letter-spacing: 1.5px;
  margin-bottom: 0.25rem;
}

.info-item p {
  font-size: 1.25rem;
  font-weight: 500;
  word-wrap: break-word;
}

/* ==========================================================================
   5. MAP CONTAINER (Bottom Section)
   ========================================================================== */
.map-container {
  flex: 1;
  width: 100%;
  min-height: 400px;
  background-color: #e5e3df; /* Map mockup placeholder fallback color */
  z-index: 1;
}
