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

body {
  font-family: 'Poppins', sans-serif;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #334155 100%);
  min-height: 100vh;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 5px;
  background-attachment: fixed;
  margin: 0;
  overflow: hidden;
}

.app-container {
  width: 100%;
  max-width: 450px;
  margin: 0 auto;
  max-height: 95vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.weather-container {
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(20px);
  border-radius: 20px;
  padding: 18px 16px;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(59, 130, 246, 0.2);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  animation: fadeInUp 0.8s ease;
  width: 100%;
  overflow: visible;
  max-height: 90vh;
  overflow-y: auto;
}

.weather-container:hover {
  transform: translateY(-5px);
  box-shadow: 0 35px 70px rgba(59, 130, 246, 0.2);
}

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

.header {
  text-align: center;
  margin-bottom: 15px;
}

.weather-icon-header {
  font-size: 2.2rem;
  color: #3b82f6;
  margin-bottom: 8px;
  animation: bounce 2s infinite;
}

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-10px);
  }
  60% {
    transform: translateY(-5px);
  }
}

.header h1 {
  font-size: 1.8rem;
  font-weight: 600;
  color: #f8fafc;
  margin-bottom: 4px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.subtitle {
  color: #cbd5e1;
  font-size: 0.85rem;
  font-weight: 300;
}

.search-container {
  margin-bottom: 15px;
}

.input-group {
  position: relative;
  display: flex;
  align-items: center;
  background: rgba(30, 41, 59, 0.8);
  border-radius: 50px;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
  overflow: hidden;
  transition: box-shadow 0.3s ease;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.input-group:focus-within {
  box-shadow: 0 12px 35px rgba(59, 130, 246, 0.4);
  border-color: #3b82f6;
}

.search-icon {
  position: absolute;
  left: 20px;
  color: #94a3b8;
  font-size: 1.1rem;
  z-index: 2;
}

input[type="text"] {
  width: 100%;
  padding: 15px 20px 15px 45px;
  border: none;
  outline: none;
  font-size: 0.9rem;
  color: #f8fafc;
  background: transparent;
  font-family: 'Poppins', sans-serif;
}

input[type="text"]::placeholder {
  color: #94a3b8;
  font-weight: 300;
}

/* Improved Touch Targets and Accessibility */
.search-btn {
  padding: 15px 20px;
  background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
  border: none;
  color: white;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 55px;
  min-height: 44px; /* Improved touch target */
  touch-action: manipulation;
}

.search-btn:hover {
  background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
  transform: scale(1.05);
}

.search-btn:active {
  transform: scale(0.98);
}

/* Add new breakpoint for very small devices */
@media (max-width: 320px) {
  body {
    padding: 2px;
  }
  
  .app-container {
    padding-top: 10px;
    min-height: 100vh;
  }
  
  .weather-container {
    padding: 14px 8px;
    border-radius: 10px;
  }
  
  .header {
    margin-bottom: 14px;
  }
  
  .header h1 {
    font-size: 1.3rem;
    line-height: 1.1;
  }
  
  .weather-icon-header {
    font-size: 1.6rem;
    margin-bottom: 5px;
  }
  
  .subtitle {
    font-size: 0.7rem;
    line-height: 1.3;
  }
  
  .search-container {
    margin-bottom: 14px;
  }
  
  input[type="text"] {
    padding: 10px 10px 10px 34px;
    font-size: 0.75rem;
  }
  
  .search-icon {
    left: 10px;
    font-size: 0.8rem;
  }
  
  .search-btn {
    padding: 10px 12px;
    min-width: 38px;
    min-height: 40px;
  }
  
  .weather-stats {
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    margin-top: 8px;
  }
  
  .weather-stat {
    padding: 8px 6px;
    border-radius: 5px;
  }
  
  .weather-stat i {
    font-size: 0.9rem;
    margin-bottom: 3px;
  }
  
  .weather-stat .value {
    font-size: 0.9rem;
    margin-bottom: 1px;
  }
  
  .weather-stat .label {
    font-size: 0.6rem;
    line-height: 1;
  }
  
  .weather-display h2 {
    font-size: 1.1rem;
    margin-bottom: 8px;
    line-height: 1.1;
  }
  
  .weather-info {
    min-height: 70px;
    padding: 4px 0;
  }
  
  .welcome-message {
    font-size: 0.8rem;
    line-height: 1.3;
    padding: 0 6px;
  }
  
  .footer {
    margin-top: 10px;
    padding-top: 6px;
  }
  
  .footer p {
    font-size: 0.55rem;
    margin: 1px 0;
  }
}

.weather-info {
  text-align: center;
  min-height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.welcome-message {
  color: #cbd5e1;
  font-size: 1.1rem;
  font-weight: 300;
}

.location-icon {
  font-size: 1.5rem;
  color: #3b82f6;
  margin-bottom: 10px;
  display: block;
}

.weather-display {
  animation: slideIn 0.5s ease;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.weather-display h2 {
  font-size: 1.6rem;
  color: #f8fafc;
  margin-bottom: 15px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.weather-display .location-pin {
  color: #ef4444;
  font-size: 1.2rem;
}

.weather-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 12px;
}

.weather-stat {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.8) 0%, rgba(51, 65, 85, 0.6) 100%);
  padding: 12px;
  border-radius: 12px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(59, 130, 246, 0.1);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.weather-stat:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(59, 130, 246, 0.15);
}

.weather-stat i {
  font-size: 1.3rem;
  margin-bottom: 6px;
  display: block;
}

.temp-icon { color: #ef4444; }
.weather-icon { color: #3b82f6; }
.humidity-icon { color: #10b981; }
.wind-icon { color: #8b5cf6; }

.weather-stat .value {
  font-size: 1.2rem;
  font-weight: 600;
  color: #f8fafc;
  margin-bottom: 4px;
}

.weather-stat .label {
  font-size: 0.8rem;
  color: #cbd5e1;
  font-weight: 300;
}

.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: #3b82f6;
  font-size: 1.1rem;
}

.loading .spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(59, 130, 246, 0.2);
  border-top: 2px solid #3b82f6;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

.error {
  color: #ef4444;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.error i {
  font-size: 1.3rem;
}

.footer {
  margin-top: 15px;
  padding-top: 12px;
  border-top: 1px solid rgba(59, 130, 246, 0.2);
  text-align: center;
}

.footer p {
  color: #94a3b8;
  font-size: 0.7rem;
  margin: 2px 0;
  font-weight: 300;
}

.footer-credits {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.footer-credits .fa-heart {
  color: #ef4444;
  font-size: 0.7rem;
  animation: heartbeat 1.5s ease-in-out infinite;
}

@keyframes heartbeat {
  0% { transform: scale(1); }
  50% { transform: scale(1.1); }
  100% { transform: scale(1); }
}

/* Responsive Design */
@media (min-width: 1025px) {
  body {
    padding: 8px;
    overflow: hidden;
  }
  
  .app-container {
    max-width: 420px;
    max-height: 95vh;
  }
  
  .weather-container {
    padding: 16px 18px;
    max-height: 88vh;
    overflow-y: auto;
  }
  
  .header {
    margin-bottom: 12px;
  }
  
  .weather-icon-header {
    font-size: 2rem;
    margin-bottom: 6px;
  }
  
  .header h1 {
    font-size: 1.7rem;
    margin-bottom: 3px;
  }
  
  .subtitle {
    font-size: 0.8rem;
  }
  
  .search-container {
    margin-bottom: 12px;
  }
  
  .weather-info {
    min-height: 70px;
  }
  
  .weather-stats {
    gap: 8px;
    margin-top: 10px;
  }
  
  .weather-stat {
    padding: 10px;
  }
  
  .footer {
    margin-top: 12px;
    padding-top: 10px;
  }
}

@media (max-width: 1024px) {
  .app-container {
    max-width: 480px;
  }
  
  .weather-container {
    padding: 20px 18px;
  }
}

/* Enhanced Mobile Responsiveness */
@media (max-width: 768px) {
  body {
    padding: 8px;
    min-height: 100vh;
    background-attachment: scroll;
  }
  
  .app-container {
    padding: 0;
    min-height: 95vh;
    max-width: 100%;
  }
  
  .weather-container {
    padding: 20px 16px;
    border-radius: 16px;
    margin: 0;
    min-height: auto;
  }
  
  .header {
    margin-bottom: 20px;
  }
  
  .header h1 {
    font-size: 1.75rem;
    margin-bottom: 5px;
    line-height: 1.2;
  }
  
  .weather-icon-header {
    font-size: 2.2rem;
    margin-bottom: 8px;
  }
  
  .subtitle {
    font-size: 0.85rem;
    line-height: 1.4;
  }
  
  .search-container {
    margin-bottom: 20px;
  }
  
  .input-group {
    border-radius: 15px;
  }
  
  .weather-stats {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 15px;
  }
  
  .weather-stat {
    padding: 14px 12px;
    border-radius: 10px;
  }
  
  input[type="text"] {
    padding: 14px 16px 14px 42px;
    font-size: 0.9rem;
  }
  
  .search-icon {
    left: 16px;
    font-size: 1rem;
  }
  
  .search-btn {
    padding: 14px 18px;
    min-width: 52px;
  }
  
  .weather-display h2 {
    font-size: 1.4rem;
    margin-bottom: 12px;
    line-height: 1.3;
  }
  
  .weather-info {
    min-height: 100px;
    padding: 10px 0;
  }
  
  .welcome-message {
    font-size: 1rem;
    line-height: 1.5;
  }
  
  .location-icon {
    font-size: 1.3rem;
    margin-bottom: 8px;
  }
  
  .footer {
    margin-top: 16px;
    padding-top: 12px;
  }
  
  .footer p {
    font-size: 0.7rem;
    line-height: 1.3;
  }
}

@media (max-width: 480px) {
  body {
    padding: 5px;
    background-attachment: scroll;
  }
  
  .app-container {
    padding: 0;
    min-height: 98vh;
    justify-content: flex-start;
    padding-top: 20px;
  }
  
  .weather-container {
    padding: 18px 14px;
    border-radius: 14px;
  }
  
  .header {
    margin-bottom: 18px;
  }
  
  .header h1 {
    font-size: 1.6rem;
    margin-bottom: 4px;
    line-height: 1.2;
  }
  
  .weather-icon-header {
    font-size: 2rem;
    margin-bottom: 8px;
  }
  
  .subtitle {
    font-size: 0.8rem;
    line-height: 1.4;
  }
  
  .search-container {
    margin-bottom: 18px;
  }
  
  .input-group {
    border-radius: 12px;
  }
  
  input[type="text"] {
    padding: 13px 14px 13px 40px;
    font-size: 0.85rem;
  }
  
  .search-icon {
    left: 14px;
    font-size: 0.95rem;
  }
  
  .search-btn {
    padding: 13px 16px;
    min-width: 48px;
  }
  
  .search-btn i {
    font-size: 0.9rem;
  }
  
  .weather-stats {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 12px;
  }
  
  .weather-stat {
    padding: 12px 10px;
    border-radius: 8px;
    text-align: center;
  }
  
  .weather-stat i {
    font-size: 1.2rem;
    margin-bottom: 6px;
  }
  
  .weather-stat .value {
    font-size: 1.1rem;
    margin-bottom: 3px;
    font-weight: 600;
  }
  
  .weather-stat .label {
    font-size: 0.75rem;
    line-height: 1.2;
  }
  
  .weather-display h2 {
    font-size: 1.35rem;
    margin-bottom: 12px;
    line-height: 1.3;
    word-break: break-word;
  }
  
  .weather-display .location-pin {
    font-size: 1rem;
  }
  
  .weather-info {
    min-height: 90px;
    padding: 8px 0;
  }
  
  .welcome-message {
    font-size: 0.95rem;
    line-height: 1.5;
    padding: 0 10px;
  }
  
  .location-icon {
    font-size: 1.2rem;
    margin-bottom: 6px;
  }
  
  .loading {
    font-size: 0.95rem;
    gap: 8px;
  }
  
  .loading .spinner {
    width: 18px;
    height: 18px;
  }
  
  .error {
    font-size: 0.95rem;
    gap: 8px;
    padding: 0 10px;
    text-align: center;
  }
  
  .error i {
    font-size: 1.1rem;
  }
  
  .footer {
    margin-top: 14px;
    padding-top: 10px;
  }
  
  .footer p {
    font-size: 0.65rem;
    margin: 2px 0;
    line-height: 1.3;
  }
  
  .footer-credits .fa-heart {
    font-size: 0.6rem;
  }
}

@media (max-width: 360px) {
  body {
    padding: 4px;
  }
  
  .app-container {
    padding-top: 15px;
    min-height: 100vh;
  }
  
  .weather-container {
    padding: 16px 10px;
    border-radius: 12px;
  }
  
  .header {
    margin-bottom: 16px;
  }
  
  .header h1 {
    font-size: 1.4rem;
    line-height: 1.2;
  }
  
  .weather-icon-header {
    font-size: 1.8rem;
    margin-bottom: 6px;
  }
  
  .subtitle {
    font-size: 0.75rem;
    line-height: 1.4;
  }
  
  .search-container {
    margin-bottom: 16px;
  }
  
  .input-group {
    border-radius: 10px;
  }
  
  input[type="text"] {
    padding: 11px 12px 11px 36px;
    font-size: 0.8rem;
  }
  
  .search-icon {
    left: 12px;
    font-size: 0.85rem;
  }
  
  .search-btn {
    padding: 11px 14px;
    min-width: 42px;
  }
  
  .search-btn i {
    font-size: 0.85rem;
  }
  
  .weather-stats {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 10px;
  }
  
  .weather-stat {
    padding: 10px 8px;
    border-radius: 6px;
  }
  
  .weather-stat i {
    font-size: 1rem;
    margin-bottom: 4px;
  }
  
  .weather-stat .value {
    font-size: 1rem;
    margin-bottom: 2px;
  }
  
  .weather-stat .label {
    font-size: 0.65rem;
    line-height: 1.1;
  }
  
  .weather-display h2 {
    font-size: 1.2rem;
    margin-bottom: 10px;
    line-height: 1.2;
  }
  
  .weather-display .location-pin {
    font-size: 0.9rem;
  }
  
  .weather-info {
    min-height: 80px;
    padding: 6px 0;
  }
  
  .welcome-message {
    font-size: 0.85rem;
    line-height: 1.4;
    padding: 0 8px;
  }
  
  .location-icon {
    font-size: 1rem;
    margin-bottom: 4px;
  }
  
  .loading {
    font-size: 0.85rem;
    gap: 6px;
  }
  
  .loading .spinner {
    width: 16px;
    height: 16px;
  }
  
  .error {
    font-size: 0.85rem;
    gap: 6px;
    padding: 0 8px;
  }
  
  .error i {
    font-size: 1rem;
  }
  
  .footer {
    margin-top: 12px;
    padding-top: 8px;
  }
  
  .footer p {
    font-size: 0.6rem;
    margin: 1px 0;
    line-height: 1.2;
  }
  
  .footer-credits .fa-heart {
    font-size: 0.55rem;
  }
}

@media (orientation: landscape) and (max-height: 600px) {
  body {
    height: 100vh;
    overflow: hidden;
  }
  
  .app-container {
    max-height: 95vh;
  }
  
  .weather-container {
    padding: 15px 20px;
    max-height: 90vh;
    overflow-y: auto;
  }
  
  .header {
    margin-bottom: 12px;
  }
  
  .weather-icon-header {
    font-size: 1.8rem;
    margin-bottom: 5px;
  }
  
  .header h1 {
    font-size: 1.5rem;
    margin-bottom: 2px;
  }
  
  .subtitle {
    font-size: 0.8rem;
  }
  
  .search-container {
    margin-bottom: 12px;
  }
  
  .weather-stats {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 8px;
  }
  
  .weather-stat {
    padding: 8px;
  }
  
  .footer {
    margin-top: 10px;
    padding-top: 8px;
  }
}