:root {
  --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --secondary-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  --bg-dark: #0f0c29;
  --bg-medium: #1a1537;
  --bg-light: #302b63;
  --text-primary: #ffffff;
  --text-secondary: #b8b5c9;
  --card-bg: rgba(255, 255, 255, 0.05);
  --card-border: rgba(255, 255, 255, 0.1);
  --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.3);
  --shadow-xl: 0 30px 90px rgba(0, 0, 0, 0.5);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, #0f0c29 0%, #302b63 50%, #24243e 100%);
  background-attachment: fixed;
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
}

/* Animación de fondo */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at 20% 50%, rgba(102, 126, 234, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(245, 87, 108, 0.1) 0%, transparent 50%);
  pointer-events: none;
  animation: backgroundPulse 15s ease-in-out infinite;
  z-index: 0;
}

@keyframes backgroundPulse {

  0%,
  100% {
    opacity: 0.5;
  }

  50% {
    opacity: 1;
  }
}

/* Container principal */
.main-container {
  position: relative;
  z-index: 1;
  padding: 2rem 0;
}

/* Header */
.app-header {
  text-align: center;
  margin-bottom: 3rem;
  animation: fadeInDown 0.8s ease-out;
}

.app-title {
  font-size: 3.5rem;
  font-weight: 800;
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 0.5rem;
  text-shadow: 0 4px 20px rgba(102, 126, 234, 0.3);
}

.app-subtitle {
  font-size: 1.2rem;
  color: var(--text-secondary);
  font-weight: 300;
}

/* Search Section */
.search-section {
  background: var(--card-bg);
  backdrop-filter: blur(10px);
  border: 1px solid var(--card-border);
  border-radius: 20px;
  padding: 2rem;
  margin-bottom: 3rem;
  box-shadow: var(--shadow-lg);
  animation: fadeInUp 0.8s ease-out 0.2s backwards;
}

.search-input-wrapper {
  position: relative;
}

.search-input {
  width: 100%;
  padding: 1rem 1.5rem 1rem 3.5rem;
  background: rgba(255, 255, 255, 0.08);
  border: 2px solid transparent;
  border-radius: 50px;
  color: var(--text-primary);
  font-size: 1.1rem;
  transition: all 0.3s ease;
}

.search-input:focus {
  outline: none;
  border-color: #667eea;
  background: rgba(255, 255, 255, 0.12);
  box-shadow: 0 0 30px rgba(102, 126, 234, 0.3);
}

.search-input::placeholder {
  color: var(--text-secondary);
}

.search-icon {
  position: absolute;
  left: 1.2rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.3rem;
  color: var(--text-secondary);
  pointer-events: none;
}

.search-btn {
  margin-top: 1rem;
  width: 100%;
  padding: 1rem 2rem;
  background: var(--primary-gradient);
  border: none;
  border-radius: 50px;
  color: white;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
}

.search-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 15px 40px rgba(102, 126, 234, 0.5);
}

.search-btn:active {
  transform: translateY(0);
}

/* API Key Section */
.api-key-section {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--card-border);
}

.btn-sm {
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-success {
  background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
  color: white;
}

.btn-success:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 20px rgba(56, 239, 125, 0.3);
}

.btn-outline-secondary {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--card-border);
  color: var(--text-secondary);
}

.btn-outline-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
  color: var(--text-primary);
}

.gap-2 {
  gap: 0.5rem;
}

.flex-grow-1 {
  flex-grow: 1;
}

.text-success {
  color: #38ef7d;
}

.api-key-input {
  width: 100%;
  padding: 0.8rem 3rem 0.8rem 1.2rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  color: var(--text-primary);
  font-size: 0.95rem;
  transition: all 0.3s ease;
}

.toggle-password-btn {
  position: absolute;
  right: 0.8rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0.5rem;
  font-size: 1rem;
  transition: color 0.3s ease;
}

.toggle-password-btn:hover {
  color: var(--text-primary);
}

.api-key-input:focus {
  outline: none;
  border-color: #667eea;
  background: rgba(255, 255, 255, 0.08);
}

/* Loading Spinner */
.loading {
  text-align: center;
  padding: 3rem;
  display: none;
}

.spinner {
  border: 4px solid rgba(255, 255, 255, 0.1);
  border-top: 4px solid #667eea;
  border-radius: 50%;
  width: 60px;
  height: 60px;
  animation: spin 1s linear infinite;
  margin: 0 auto 1rem;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

/* Alert Messages */
.alert {
  border-radius: 15px;
  border: none;
  animation: fadeInUp 0.5s ease-out;
}

.alert-danger {
  background: rgba(245, 87, 108, 0.2);
  border: 1px solid rgba(245, 87, 108, 0.3);
  color: #ff9aab;
}

.alert-info {
  background: rgba(102, 126, 234, 0.2);
  border: 1px solid rgba(102, 126, 234, 0.3);
  color: #a8b5ff;
}

/* Weather Display */
.weather-display {
  display: none;
  animation: fadeInUp 0.8s ease-out;
}

.city-header {
  background: var(--card-bg);
  backdrop-filter: blur(10px);
  border: 1px solid var(--card-border);
  border-radius: 20px;
  padding: 2rem;
  margin-bottom: 2rem;
  text-align: center;
  box-shadow: var(--shadow-lg);
}

.city-name {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  background: var(--secondary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.current-date {
  font-size: 1.1rem;
  color: var(--text-secondary);
}

/* Forecast Cards */
.forecast-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
}

.forecast-card {
  background: var(--card-bg);
  backdrop-filter: blur(10px);
  border: 1px solid var(--card-border);
  border-radius: 20px;
  padding: 1.5rem;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  animation: fadeInUp 0.6s ease-out backwards;
}

.forecast-card:nth-child(1) {
  animation-delay: 0.1s;
}

.forecast-card:nth-child(2) {
  animation-delay: 0.2s;
}

.forecast-card:nth-child(3) {
  animation-delay: 0.3s;
}

.forecast-card:nth-child(4) {
  animation-delay: 0.4s;
}

.forecast-card:nth-child(5) {
  animation-delay: 0.5s;
}

.forecast-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--primary-gradient);
  opacity: 0;
  transition: opacity 0.4s ease;
  z-index: -1;
}

.forecast-card:hover {
  transform: translateY(-10px) scale(1.02);
  box-shadow: var(--shadow-xl);
  border-color: rgba(102, 126, 234, 0.5);
}

.forecast-card:hover::before {
  opacity: 0.1;
}

.forecast-date {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.3rem;
  color: var(--text-primary);
}

.forecast-day {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

.weather-icon-container {
  text-align: center;
  margin: 1.5rem 0;
}

.weather-icon {
  width: 80px;
  height: 80px;
  filter: drop-shadow(0 5px 15px rgba(102, 126, 234, 0.3));
  animation: float 3s ease-in-out infinite;
}

@keyframes float {

  0%,
  100% {
    transform: translateY(0px);
  }

  50% {
    transform: translateY(-10px);
  }
}

.temperature {
  font-size: 2.5rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 0.5rem;
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.weather-description {
  text-align: center;
  color: var(--text-secondary);
  font-size: 1rem;
  text-transform: capitalize;
  margin-bottom: 1rem;
}

.weather-details {
  border-top: 1px solid var(--card-border);
  padding-top: 1rem;
  margin-top: 1rem;
}

.detail-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}

.detail-label {
  color: var(--text-secondary);
}

.detail-value {
  color: var(--text-primary);
  font-weight: 600;
}

/* Footer */
.app-footer {
  text-align: center;
  margin-top: 4rem;
  padding: 2rem 0;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* Animations */
@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-30px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Responsive Design */
@media (max-width: 768px) {
  .app-title {
    font-size: 2.5rem;
  }

  .app-subtitle {
    font-size: 1rem;
  }

  .forecast-grid {
    grid-template-columns: 1fr;
  }

  .search-section {
    padding: 1.5rem;
  }
}

@media (max-width: 576px) {
  .app-title {
    font-size: 2rem;
  }

  .city-name {
    font-size: 2rem;
  }

  .temperature {
    font-size: 2rem;
  }
}