/* --- Global Setup & Variables --- */
:root {
  --background-darker: #0b1220;
  --background-dark: #0f1724;
  --background-panel: #152338;
  --text-primary: #e6eef6;
  --text-secondary: #9aa6b2;
  --accent-primary: #46b3ff;
  --accent-secondary: #2bd0a6;
  --border-color: rgba(255, 255, 255, 0.1);
  --shadow-color: rgba(0, 0, 0, 0.3);
  --interactive-glow: rgba(70, 179, 255, 0.3);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  height: 100vh;
  display: flex;
  background-color: var(--background-dark);
  color: var(--text-primary);
  overflow: hidden;
}

.logo {
  width: 300px;
  height: auto;
  margin: 0 auto 15px auto;
  display: block;
}

/* --- Layout Panels --- */
.panel {
  height: 100%; display: flex; flex-direction: column;
  justify-content: center; align-items: center; padding: 30px;
  transition: all 0.3s ease-in-out;
}
#left-panel, #right-panel {
  flex: 1; min-width: 350px; max-width: 400px;
  background-color: var(--background-darker);
}
#left-panel { border-right: 1px solid var(--border-color); }
#right-panel { border-left: 1px solid var(--border-color); }
#center-panel {
  flex: 2.5; background: var(--background-dark);
}
.content-wrapper {
  width: 85%; max-width: 320px; height: 100%;
  display: flex; flex-direction: column; justify-content: center;
}
#map {
  width: 100%; height: 95vh; border-radius: 20px;
  box-shadow: 0 0 30px var(--shadow-color); border: 1px solid var(--border-color);
}

/* --- UI Elements --- */
h2 {
  color: var(--accent-primary); margin-top: 0; margin-bottom: 20px;
  font-weight: 600; text-align: center;
}
label {
  display: block; margin-top: 15px; color: var(--text-secondary);
  font-size: 14px; font-weight: 500;
}
input[type="date"], input[type="text"], select {
  width: 100%; padding: 10px; margin-top: 8px; border-radius: 6px;
  border: 1px solid transparent; background: rgba(255, 255, 255, 0.07);
  color: var(--text-primary); font-size: 14px; transition: all 0.2s ease-in-out;
}
select option { background: var(--background-darker); }
input:focus, select:focus {
  outline: none; border-color: var(--accent-primary); box-shadow: 0 0 0 3px var(--interactive-glow);
}
button {
  margin-top: 25px; padding: 12px 14px; border-radius: 8px;
  background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
  color: #0b1220; font-weight: bold; font-size: 15px;
  border: none; cursor: pointer; width: 100%; transition: all 0.2s ease-in-out;
}
button:hover {
  transform: translateY(-2px); box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2); filter: brightness(1.1);
}

/* --- Results List & Scrollbar Hiding --- */
#results-list {
  list-style: none; padding: 0; margin: 0;
  width: 100%; height: calc(100% - 70px);
  overflow-y: auto; scrollbar-width: none;
}
#results-list::-webkit-scrollbar { display: none; }

@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

.result-item {
  padding: 15px; border-radius: 8px; margin-bottom: 10px; cursor: pointer;
  background: rgba(255, 255, 255, 0.05); border: 1px solid transparent;
  transition: all 0.2s ease-in-out; animation: fadeIn 0.5s ease-out forwards;
  display: flex;
  align-items: center;
}
.result-item:hover {
  background: rgba(70, 179, 255, 0.1); border-color: var(--accent-primary); transform: scale(1.02);
}

.weather-icon {
  width: 40px; height: 40px; margin-right: 15px; flex-shrink: 0;
}

/* --- FIX for horizontal scrolling --- */
.result-content { 
  flex-grow: 1;
  min-width: 0; /* Allows this flex item to shrink and wrap its content */
}

.result-header {
  display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 12px;
}
.place-name { font-weight: 600; font-size: 1.1em; color: var(--text-primary); word-break: break-word; } /* Allows long names to wrap */
.place-distance { font-size: 0.9em; color: var(--text-secondary); white-space: nowrap; margin-left: 10px; }
.weather-stats {
  display: flex; justify-content: space-around; background: rgba(0,0,0,0.2);
  padding: 10px; border-radius: 6px; text-align: center;
}
.stat-item {
  font-weight: 500; font-size: 1.1em; color: var(--text-primary);
}
.stat-item span {
  display: block; font-size: 0.75em; color: var(--text-secondary); font-weight: 400;
}

/* --- NEW: Styling for the date display --- */
.event-date {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--border-color);
  font-size: 0.9em;
  color: var(--text-secondary);
  text-align: center;
  font-weight: 500;
}

.date-range { display: flex; gap: 8px; width: 100%; }

/* --- Mobile Responsiveness --- */
@media (max-width: 900px) {
  body { flex-direction: column; overflow: auto; }
  .panel { width: 100%; min-width: unset; max-width: unset; height: auto; }
  #left-panel, #right-panel { border: none; padding-bottom: 50px; }
  #center-panel { height: 60vh; order: -1; }
  #map { width: 100%; height: 100%; border-radius: 0; border: none; }
  #results-list { height: auto; max-height: 50vh; }
}

