/* Modern Form Styling for Weather Application */
:root {
  --primary-color: #FFD700;
  --primary-dark: #e6c200;
  --secondary-color: #1c2e4a;
  --secondary-dark: #162447;
  --text-light: #ffffff;
  --text-dark: #333333;
  --accent-color: #00c6ff;
  --error-color: #ff6b6b;
  --success-color: #28a745;
  --card-bg: rgba(28, 46, 74, 0.8);
  --card-border: rgba(255, 215, 0, 0.3);
  --input-bg: rgba(255, 255, 255, 0.1);
  --shadow-glow: 0 0 15px rgba(255, 215, 0, 0.5);
  --transition-speed: 0.3s;
}

/* Form Container */
.form-container {
  background: var(--card-bg);
  border-radius: 12px;
  border: 1px solid var(--card-border);
  box-shadow: var(--shadow-glow);
  padding: 18px;
  margin: 18px auto;
  max-width: 800px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(255px, 1fr)); /* Reduced by 15% from 300px */
  gap: 13px; /* Reduced by 15% from 15px */
  animation: fade-in 0.5s ease-out;
}

/* Form Group */
.form-group {
  margin-bottom: 13px; /* Reduced by 15% from 15px */
  position: relative;
}

/* Labels */
.form-group label {
  display: block;
  margin-bottom: 7px; /* Reduced by 15% from 8px */
  font-weight: 600;
  color: var(--primary-color);
  text-shadow: 0 0 5px rgba(255, 215, 0, 0.3);
  font-size: 0.85rem; /* Reduced by ~15% from 0.9rem */
  letter-spacing: 0.5px;
  padding-left: 25px; /* Add space for the icon */
}

/* Inputs */
.form-group input,
.form-group select {
  width: 100%;
  padding: 10px 13px 10px 34px; /* Reduced by ~15% from 12px 15px 12px 40px */
  background: var(--input-bg);
  background-color: rgba(28, 46, 74, 0.8) !important; /* Force background color */
  border: 1px solid var(--card-border);
  border-radius: 7px; /* Reduced by ~15% from 8px */
  color: var(--text-light);
  font-family: 'Orbitron', sans-serif;
  font-size: 0.85rem; /* Reduced by ~15% from 0.9rem */
  transition: all var(--transition-speed) ease;
  box-sizing: border-box;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  height: 38px; /* Set explicit height for consistency */
}

/* Add dropdown arrow for select elements */
.form-group select {
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23FFD700' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 16px;
  padding-right: 30px;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
  background: rgba(255, 255, 255, 0.15);
}

/* Input Icons */
.form-group::before {
  content: "";
  position: absolute;
  left: 0px; /* Moved to the far left */
  top: 8px; /* Aligned with the label */
  width: 14px; /* Reduced by ~15% from 16px */
  height: 14px; /* Reduced by ~15% from 16px */
  background-size: contain;
  background-repeat: no-repeat;
  opacity: 0.8;
  z-index: 1;
}

.form-group.city::before {
  content: "🏙️";
}

.form-group.latitude::before {
  content: "🌐";
}

.form-group.longitude::before {
  content: "🌐";
}

.form-group.days::before {
  content: "📅";
}

.form-group.interval::before {
  content: "⏱️";
}

.form-group.background::before {
  content: "🎨";
}

.form-group.language::before {
  content: "🌐";
}


/* Buttons */
.btn {
  padding: 10px 17px; /* Reduced by ~15% from 12px 20px */
  border-radius: 7px; /* Reduced by ~15% from 8px */
  border: 1px solid var(--primary-color);
  background: var(--secondary-color);
  color: var(--primary-color);
  font-family: 'Orbitron', sans-serif;
  font-weight: 600;
  font-size: 0.85rem; /* Reduced by ~15% from 0.9rem */
  cursor: pointer;
  transition: all var(--transition-speed) ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.2); /* Reduced by ~15% from 10px */
  height: 38px; /* Set explicit height for consistency */
}

.btn:hover {
  background: var(--primary-color);
  color: var(--secondary-dark);
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
  color: var(--secondary-dark);
}

.btn-location {
  background: linear-gradient(135deg, var(--accent-color), #0072ff);
  border-color: var(--accent-color);
  color: var(--text-light);
}

.btn-location:hover {
  background: linear-gradient(135deg, #0072ff, var(--accent-color));
  color: var(--text-light);
}

/* City Suggestions */
#citySuggestions {
  position: absolute;
  z-index: 1100;
  background-color: var(--secondary-dark);
  border: 1px solid var(--card-border);
  border-radius: 0 0 8px 8px;
  width: 100%;
  max-height: 200px;
  overflow-y: auto;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.suggestion {
  padding: 10px 15px;
  cursor: pointer;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-light);
  transition: background var(--transition-speed) ease;
}

.suggestion:hover {
  background-color: rgba(255, 215, 0, 0.2);
  color: var(--primary-color);
}

/* Background Selector */
.background-preview {
  display: inline-block;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  margin-right: 5px;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

/* Responsive Design */
@media (max-width: 768px) {
  .form-container {
    grid-template-columns: 1fr;
    padding: 15px;
  }
  
  .btn {
    width: 100%;
    margin-bottom: 10px;
  }
}

@media (max-width: 480px) {
  .form-container {
    grid-template-columns: 1fr;
  }
}

/* Animation */
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(255, 215, 0, 0.4); }
  70% { box-shadow: 0 0 0 10px rgba(255, 215, 0, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 215, 0, 0); }
}

.pulse {
  animation: pulse 2s infinite;
}

/* Selectors Row */
.selectors-row {
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 17px; /* Reduced by ~15% from 20px */
  padding-bottom: 13px; /* Reduced by ~15% from 15px */
  border-bottom: 1px solid var(--card-border);
}

/* Language and Background Selectors */
#selectors-container {
  display: flex;
  align-items: center;
  gap: 15px;
  position: relative;
  z-index: 1100;
}

#selectors-container .form-group {
  margin-bottom: 0;
  min-width: 128px; /* Reduced by ~15% from 150px */
}

#selectors-container select {
  background-color: var(--secondary-dark);
  border-color: var(--primary-color);
  border-radius: 17px; /* Reduced by ~15% from 20px */
  padding: 7px 13px 7px 30px; /* Reduced by ~15% from 8px 15px 8px 35px */
  font-size: 0.8rem; /* Reduced by ~15% from 0.85rem */
  cursor: pointer;
  transition: all 0.3s ease;
  height: 32px; /* Set explicit height for consistency */
  position: relative;
  z-index: 1100;
}

#selectors-container select:hover {
  box-shadow: 0 0 8px rgba(255, 215, 0, 0.5);
}

#selectors-container select:focus {
  outline: none;
  box-shadow: 0 0 12px rgba(255, 215, 0, 0.7);
}

#selectors-container label {
  font-size: 0.75rem; /* Reduced by ~15% from 0.8rem */
  margin-bottom: 4px; /* Reduced by ~15% from 5px */
}

/* Buttons Container */
.buttons-container {
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px; /* Reduced by ~15% from 10px */
  gap: 13px; /* Reduced by ~15% from 15px */
}

.buttons-container .btn {
  flex: 1;
  text-align: center;
}

/* Responsive adjustments for selectors and buttons */
@media (max-width: 768px) {
  .selectors-row {
    flex-direction: column;
    gap: 10px;
  }
  
  #selectors-container {
    justify-content: center;
    width: 100%;
  }
  
  .buttons-container {
    flex-direction: column;
  }
  
  .buttons-container .btn {
    width: 100%;
    margin-bottom: 10px;
  }
}

/* Print styles - Hide filter panel and print button when printing */
@media print {
  .form-container {
    display: none;
  }
  
  /* Hide the print button itself */
  button.btn[onclick="window.print()"] {
    display: none;
  }
  
  /* Ensure tables and content are properly formatted for print */
  #weatherTable, #hourlyTable {
    width: 100%;
    page-break-inside: avoid;
  }
  
  /* Remove any animations or effects not needed for print */
  * {
    animation: none !important;
    transition: none !important;
    box-shadow: none !important;
  }
}