@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&family=Montserrat:wght@700;800&display=swap');

:root {
  /* Ultra Vibrant Gen-Z Palette */
  --primary: #8a2be2; /* Electric purple */
  --secondary: #00f5d4; /* Cyan */
  --accent: #ff006e; /* Hot pink */
  --dark-bg: #0f0e17; /* Deep space */
  --dark-glass: rgba(15, 14, 23, 0.6);
  --light-glass: rgba(255, 255, 255, 0.15);
  --text-light: #ffffff;
  --text-medium: #c7cad9;
  --text-dark: #0f0e17;
  --border-light: rgba(255, 255, 255, 0.2);
  --border-accent: rgba(138, 43, 226, 0.4);
  --shadow-color: rgba(0, 0, 0, 0.4);
  --success: #00ff9d;
  --warning: #ffbe0b;
  --error: #ff3864;
  
  /* Glow effects */
  --glow-primary: 0 0 15px rgba(138, 43, 226, 0.6);
  --glow-secondary: 0 0 15px rgba(0, 245, 212, 0.6);
  --glow-accent: 0 0 15px rgba(255, 0, 110, 0.6);

  /* Typography */
  --font-heading: 'Montserrat', sans-serif;
  --font-body: 'Poppins', sans-serif;
  --font-mono: 'SF Mono', 'Roboto Mono', monospace;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: 1.875rem;
  --text-4xl: 2.25rem;
  --text-5xl: 3rem;
  --leading-normal: 1.5;
  --leading-relaxed: 1.625;
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: 400;
  background: 
    radial-gradient(circle at 20% 30%, var(--primary) 0%, transparent 30%),
    radial-gradient(circle at 80% 70%, var(--accent) 0%, transparent 30%),
    linear-gradient(135deg, var(--dark-bg), #1a1a2e);
  color: var(--text-light);
  margin: 0;
  padding: 0;
  min-height: 100vh;
  min-width: 320px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  overflow-x: hidden;
  box-sizing: border-box;
  line-height: var(--leading-relaxed);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

.container {
  background: var(--dark-glass);
  backdrop-filter: blur(25px) saturate(200%);
  -webkit-backdrop-filter: blur(25px) saturate(200%);
  border-radius: 24px;
  border: 1px solid var(--border-light);
  box-shadow: 
    0 8px 32px var(--shadow-color),
    var(--glow-primary);
  padding: 1.5rem;
  width: 100%;
  max-width: 1100px;
  margin: 1rem;
  transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  border-image: linear-gradient(45deg, var(--primary), var(--accent)) 1;
}

@media (min-width: 480px) {
  .container {
    padding: 2rem;
    margin: 1.5rem;
    gap: 2rem;
  }
}

@media (min-width: 768px) {
  .container {
    padding: 2.5rem;
    margin: 2rem auto;
    gap: 2.5rem;
  }
}

.container::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(138, 43, 226, 0.1) 0%,
    rgba(0, 245, 212, 0.1) 50%,
    rgba(255, 0, 110, 0.1) 100%
  );
  z-index: -1;
  pointer-events: none;
  border-radius: inherit;
}

@media (min-width: 768px) {
  .container {
    grid-template-columns: 280px 1fr;
    padding: 2.5rem;
  }
}

.input-section {
  position: sticky;
  top: 2rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
  padding: 2.5rem;
  background: linear-gradient(
    135deg,
    rgba(138, 43, 226, 0.15),
    rgba(0, 245, 212, 0.1)
  );
  backdrop-filter: blur(20px);
  border-radius: 20px;
  border: 1px solid var(--border-accent);
  height: min-content;
  width: 100%;
  box-sizing: border-box;
  transition: all 0.4s ease;
  box-shadow: 
    0 4px 20px rgba(0, 0, 0, 0.2),
    var(--glow-secondary);
}

.input-section:hover {
  transform: translateY(-5px);
  box-shadow: 
    0 8px 30px rgba(0, 0, 0, 0.3),
    var(--glow-primary),
    var(--glow-accent);
}

.input-section:hover {
  box-shadow: 0 8px 25px rgba(0,0,0,0.2);
  border-color: var(--border-accent);
}

.input-wrapper {
  width: 100%;
  position: relative; /* Needed for suggestions */
}

#cityInput {
  width: 100%;
  box-sizing: border-box;
  padding: 14px 18px; /* Adjusted padding */
  font-size: 1rem;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--border-light);
  border-radius: 10px;
  color: var(--text-light);
  transition: all 0.3s ease;
  outline: none;
}

.results-section {
  display: flex;
  flex-direction: column;
  gap: 2rem; /* Increased gap */
}

.result-section {
  margin-top: 0; /* Keep this */
}

/* Remove container hover transform */
/* .container:hover {
  transform: translateY(-5px);
  box-shadow: 0 25px 60px rgba(0,0,0,0.4);
} */

/* Subtle background animation */
.container::before {
  content: '';
  position: absolute;
  top: -10%; right: -10%; /* Position top right */
  width: 300px; /* Smaller size */
  height: 300px;
  background: radial-gradient(circle, rgba(138, 43, 226, 0.15) 0%, transparent 70%); /* Use primary color */
  animation: pulse 15s ease-in-out infinite alternate;
  z-index: -1;
  opacity: 0.7;
}
.container::after { /* Add another one */
  content: '';
  position: absolute;
  bottom: -10%; left: -10%; /* Position bottom left */
  width: 250px;
  height: 250px;
  background: radial-gradient(circle, rgba(0, 240, 240, 0.1) 0%, transparent 70%); /* Use accent color */
  animation: pulse 18s ease-in-out infinite alternate-reverse;
  z-index: -1;
  opacity: 0.6;
}

@keyframes pulse {
  0% { transform: scale(0.8); opacity: 0.5; }
  100% { transform: scale(1.2); opacity: 0.8; }
}

h1 {
  font-family: var(--font-heading);
  background: linear-gradient(90deg, var(--secondary), var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin: 0 0 1rem;
  font-size: var(--text-4xl);
  text-shadow: 0 2px 10px rgba(0,0,0,0.2);
  letter-spacing: -0.025em;
  text-align: center;
  font-weight: 800;
  line-height: 1.1;
  -webkit-text-fill-color: var(--text-light); /* Ensure text is visible */
}
@media (min-width: 768px) {
  h1 {
    font-size: var(--text-5xl);
  }
}

p { /* Style the intro paragraph */
  color: var(--text-light);
  text-align: center;
  margin: 0 0 1.5rem;
  font-size: var(--text-lg);
  line-height: 1.5;
  font-weight: 400;
  text-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

#weatherData,
#tipsData {
  padding: 0.5rem;
  line-height: var(--leading-relaxed);
}

#weatherData p,
#tipsData p {
  margin-bottom: 1rem;
  color: var(--text-medium); /* Use medium color for less emphasis */
  font-size: var(--text-base);
  font-style: italic; /* Italicize placeholder/default text */
  opacity: 0.8; /* Slightly fade placeholder */
}

/* Override placeholder style when actual data is loaded */
#weatherData.has-data p,
#tipsData.has-data p,
#tipsData.has-data li { /* Target list items too */
  color: var(--text-light); /* Restore bright color for actual data */
  font-style: normal; /* Remove italics */
  opacity: 1; /* Full opacity */
}

#weatherData strong,
#tipsData strong {
  color: var(--text-light);
  font-weight: 600;
}

#cityInput:focus {
    background: rgba(255, 255, 255, 0.15);
    border-color: var(--accent);
    box-shadow: 0 0 15px rgba(0, 240, 240, 0.3); /* Cyan glow */
}

#cityInput::placeholder {
    color: var(--text-medium);
    opacity: 0.8;
}

.button-group {
    display: flex;
    gap: 1rem; /* Increased gap */
    width: 100%;
}

.primary-btn {
    flex: 1;
    padding: 16px 24px;
    background: linear-gradient(
      45deg,
      var(--primary),
      var(--accent)
    );
    color: white;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 700;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 
      0 4px 15px rgba(138, 43, 226, 0.4),
      var(--glow-primary);
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.primary-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    45deg,
    var(--accent),
    var(--secondary)
  );
  z-index: -1;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.primary-btn:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 
      0 8px 25px rgba(138, 43, 226, 0.6),
      var(--glow-primary),
      var(--glow-accent);
}

.primary-btn:hover::before {
  opacity: 1;
}

.primary-btn:active {
    transform: translateY(1px) scale(0.98);
}

.primary-btn:hover {
    transform: translateY(-3px) scale(1.02); /* More noticeable hover */
    box-shadow: 0 8px 25px rgba(138, 43, 226, 0.4);
    filter: brightness(1.1);
}

/* Remove secondary button styles if not used */
/* .secondary-btn { ... } */
/* .secondary-btn:hover { ... } */
/* .secondary-btn:hover .btn-icon { ... } */

.btn-icon {
    font-size: 1.3em; /* Slightly larger icon */
    transition: transform 0.3s ease;
}

.primary-btn:hover .btn-icon {
    transform: scale(1.15) rotate(8deg); /* More rotation */
}

.result-section {
  margin-top: 0; /* Keep this */
  padding: 2rem; /* Increased padding */
  background: var(--light-glass); /* Consistent glass */
  backdrop-filter: blur(20px) saturate(150%);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
  border-radius: 16px; /* Match input section */
  border: 1px solid var(--border-light);
  text-align: left;
  transition: all 0.5s cubic-bezier(0.25, 0.8, 0.25, 1); /* Smoother transition */
  transform: translateY(30px); /* Start further down */
  opacity: 0;
  animation: fadeInUp 0.6s forwards; /* Slower animation */
  box-shadow: 0 8px 20px rgba(0,0,0,0.15); /* Subtle shadow */
}

@keyframes fadeInUp {
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.result-section:nth-child(1) {
    animation-delay: 0.3s; /* Stagger animation */
}

.result-section:nth-child(2) {
    animation-delay: 0.5s;
}

.result-section h2 {
    margin-top: 0;
    color: var(--text-light);
    border-bottom: 2px solid var(--accent);
    padding-bottom: 0.5rem;
    margin-bottom: 1.5rem;
    font-size: var(--text-2xl);
    font-weight: 700;
    letter-spacing: -0.025em;
    font-family: var(--font-heading);
    line-height: 1.3;
}

#weatherData p, 
#tipsData p, 
#weatherData div, 
#tipsData div {
    margin: 0 0 1.25rem;
    line-height: var(--leading-relaxed);
    font-size: var(--text-lg);
    color: var(--text-medium);
    font-weight: 400;
}

#weatherData strong, 
#tipsData strong {
    color: var(--text-light);
    font-weight: 600;
    letter-spacing: 0.01em;
}

.tips-data h3, 
.tips-data h4 {
    color: var(--text-light);
    margin: 1.5rem 0 0.75rem;
    font-weight: 600;
    font-size: var(--text-xl);
}

.tips-data ul,
.tips-data ol {
    padding-left: 1.5rem;
    margin: 0.75rem 0;
}

.tips-data li {
    margin-bottom: 0.5rem;
    position: relative;
}

#weatherData strong, #tipsData strong { /* Style bold text */
    color: var(--text-light);
    font-weight: 600;
}

.loader {
    border: 4px solid rgba(255, 255, 255, 0.2); /* Lighter border */
    border-top: 4px solid var(--accent); /* Accent spinner */
    border-radius: 50%;
    width: 35px; /* Slightly smaller */
    height: 35px;
    animation: spin 0.8s linear infinite; /* Faster spin */
    margin: 30px auto; /* More margin */
}

.mini-loader {
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-top: 2px solid var(--accent);
    border-radius: 50%;
    width: 18px; /* Slightly smaller */
    height: 18px;
    animation: spin 0.8s linear infinite;
    margin: 0 auto;
}

.location-error {
    color: var(--secondary); /* Use secondary for errors */
    margin-top: 10px;
    text-align: center;
    font-size: 0.9rem;
    font-weight: 500;
    animation: fadeIn 0.3s ease;
    background-color: rgba(255, 105, 180, 0.1); /* Faint pink background */
    padding: 8px;
    border-radius: 6px;
    border: 1px solid rgba(255, 105, 180, 0.3);
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* --- Suggestions Box --- */
.suggestions-container {
  position: absolute;
  width: 100%;
  background: rgba(40, 40, 60, 0.95); /* Darker, less transparent */
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--border-light);
  border-top: none; /* Remove top border */
  border-radius: 0 0 10px 10px; /* Match input bottom corners */
  max-height: 200px;
  overflow-y: auto;
  z-index: 100;
  box-shadow: 0 10px 20px rgba(0,0,0,0.2);
}

.suggestion-item {
  padding: 12px 18px;
  cursor: pointer;
  color: var(--text-medium);
  transition: background-color 0.2s ease, color 0.2s ease;
  font-size: 0.95rem;
}

.suggestion-item:hover,
.suggestion-item.active { /* Add active state for keyboard nav */
  background-color: rgba(0, 240, 240, 0.15); /* Accent highlight */
  color: var(--text-light);
}

/* --- Scrollbar --- */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
}
::-webkit-scrollbar-thumb {
  background: linear-gradient(var(--primary), var(--secondary));
  border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(var(--secondary), var(--primary));
}


/* Responsive adjustments */
@media (max-width: 900px) { /* Adjust breakpoint */
    .container {
        grid-template-columns: 1fr; /* Stack columns */
        gap: 2rem; /* Adjust gap for stacked layout */
        padding: 2rem;
        max-width: 600px; /* Max width for single column */
    }

    .input-section {
        position: static; /* Remove sticky */
        width: 100%;
        margin-bottom: 0; /* Remove bottom margin if stacked */
    }

    h1 {
        font-size: 2.2rem;
    }
}

@media (max-width: 768px) {
    /* Keep stacking from previous breakpoint */
    .container {
        padding: 1.5rem; /* Reduce padding */
    }

    h1 {
        font-size: 2rem;
    }

    .input-section, .result-section {
        padding: 1.5rem; /* Reduce padding */
        border-radius: 12px;
    }

    #cityInput {
        padding: 12px 16px;
    }

    .primary-btn {
        padding: 12px 18px;
        font-size: 0.95rem;
    }

    .result-section h2 {
        font-size: 1.3rem;
    }

    #weatherData p, #tipsData p, #weatherData div, #tipsData div {
        font-size: 0.95rem;
    }
}



@media (max-width: 480px) {
    body {
        padding: 1rem 0.5rem; /* Further reduce body padding */
    }
    .container {
        padding: 1rem;
        border-radius: 16px; /* Adjust radius */
    }

    h1 {
        font-size: 1.8rem;
    }

    .input-section, .result-section {
        padding: 1rem;
        border-radius: 10px;
    }

    #cityInput {
        padding: 10px 14px;
        font-size: 0.9rem;
    }

    .primary-btn {
        padding: 10px 16px;
        font-size: 0.9rem;
        gap: 8px;
    }
    .btn-icon {
        font-size: 1.1em;
    }

    .result-section h2 {
        font-size: 1.2rem;
        padding-bottom: 8px;
        margin-bottom: 1rem;
    }

    #weatherData p, #tipsData p, #weatherData div, #tipsData div {
        font-size: 0.9rem;
        margin-bottom: 0.8rem;
    }

    .suggestions-container {
        max-height: 150px; /* Reduce max height */
    }
    .suggestion-item {
        padding: 10px 14px;
        font-size: 0.9rem;
    }
}

/* Remove small height media query if layout stacks */
/* @media (max-height: 600px) { ... } */


/* --- Footer Styles --- */
.app-footer {
  width: 100%;
  max-width: 1100px; /* Match container max-width */
  margin: 2rem auto 1rem; /* Keep margin */
  padding: 1rem 0;
  text-align: center;
  flex-shrink: 0; /* Prevent footer from shrinking */
  font-size: 0.85rem;
  color: var(--text-medium);
  opacity: 0.7;
  border-top: 1px solid var(--border-light); /* Subtle separator */
}

.app-footer p {
    margin: 0;
    text-align: center; /* Ensure footer text is centered */
}
