/* Reset e configurações base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary-gradient: linear-gradient(135deg, #2e7d32 0%, #1b5e20 100%);
  --secondary-gradient: linear-gradient(135deg, #4caf50 0%, #2e7d32 100%);
  --success-gradient: linear-gradient(135deg, #66bb6a 0%, #43a047 100%);
  --warning-gradient: linear-gradient(135deg, #8bc34a 0%, #689f38 100%);
  --glass-bg: rgba(255, 255, 255, 0.15);
  --glass-border: rgba(255, 255, 255, 0.25);
  --text-primary: #1a202c;
  --text-secondary: #4a5568;
  --text-light: #ffffff;
  --text-label: #2d3748;
  --shadow-light: 0 8px 32px rgba(46, 125, 50, 0.37);
  --shadow-medium: 0 4px 20px rgba(0, 0, 0, 0.1);
  --border-radius: 20px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: linear-gradient(135deg, #2e7d32 0%, #1b5e20 100%);
  min-height: 100vh;
  color: var(--text-primary);
  overflow-x: hidden;
}

/* Container principal */
.app-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header moderno */
.modern-header {
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--glass-border);
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-light);
}

.header-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo-section {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.logo-container {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.agrinho-logo {
  width: 45px;
  height: 45px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.logo-icon {
  width: 40px;
  height: 40px;
  background: var(--success-gradient);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  color: white;
  animation: pulse 2s infinite;
}

.logo-section h1 {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-light);
  letter-spacing: -0.5px;
}

/* Status indicator */
.status-indicator {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1.5rem;
  background: var(--glass-bg);
  border-radius: 50px;
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(10px);
  transition: var(--transition);
}

.status-indicator:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-medium);
}

.status-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #e53e3e;
  animation: blink 1.5s infinite;
}

.status-indicator.online .status-dot {
  background: #48bb78;
  animation: pulse 2s infinite;
}

.status-indicator.offline .status-dot {
  background: #e53e3e;
  animation: blink 1s infinite;
}

.status-indicator span {
  color: var(--text-light);
  font-weight: 500;
  font-size: 0.9rem;
}

/* Main content */
.main-content {
  flex: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
  width: 100%;
}

/* Cards principais */
.hero-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin-bottom: 3rem;
}

.primary-card {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.25) 0%, rgba(255, 255, 255, 0.15) 100%);
  backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius);
  padding: 2rem;
  position: relative;
  overflow: hidden;
  transition: var(--transition);
  box-shadow: var(--shadow-light);
}

.primary-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--success-gradient);
  transform: scaleX(0);
  transition: var(--transition);
}

.primary-card:hover::before {
  transform: scaleX(1);
}

.primary-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.card-icon {
  width: 60px;
  height: 60px;
  background: var(--success-gradient);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: white;
  margin-bottom: 1.5rem;
  transition: var(--transition);
  box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}

.primary-card:hover .card-icon {
  transform: scale(1.1) rotate(5deg);
}

.card-content h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-label);
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.card-value {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 1rem;
  line-height: 1;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Progress bar para umidade */
.card-progress {
  width: 100%;
  height: 8px;
  background: rgba(0, 0, 0, 0.1);
  border-radius: 4px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: var(--success-gradient);
  border-radius: 4px;
  transition: width 1s ease-in-out;
  width: 0%;
}

/* Weather icon */
.weather-icon {
  position: absolute;
  top: 1rem;
  right: 1rem;
  font-size: 2rem;
  color: #8bc34a;
  animation: float 3s ease-in-out infinite;
}

/* Update indicator */
.update-indicator {
  position: absolute;
  top: 1rem;
  right: 1rem;
  font-size: 1.2rem;
  color: var(--text-secondary);
  animation: spin 2s linear infinite;
}

/* Cards secundários */
.secondary-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-bottom: 3rem;
}

.info-card {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.22) 0%, rgba(255, 255, 255, 0.12) 100%);
  backdrop-filter: blur(15px);
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius);
  padding: 1.5rem;
  transition: var(--transition);
  box-shadow: var(--shadow-light);
}

.info-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

.info-card .card-icon {
  width: 50px;
  height: 50px;
  font-size: 1.2rem;
  margin-bottom: 1rem;
}

.info-card .card-content h3 {
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
  font-weight: 700;
  color: var(--text-label);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.info-card .card-value {
  font-size: 1.5rem;
  margin-bottom: 0;
}

/* Seção de previsão */
.forecast-section {
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius);
  padding: 2rem;
  margin-bottom: 3rem;
  box-shadow: var(--shadow-light);
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

.section-header h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-label);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.btn-refresh {
  width: 45px;
  height: 45px;
  background: var(--success-gradient);
  border: none;
  border-radius: 50%;
  color: white;
  font-size: 1.1rem;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-refresh:hover {
  transform: rotate(180deg);
  box-shadow: var(--shadow-medium);
}

/* Container de previsão */
.forecast-container {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 1.5rem;
  justify-content: center;
}

.forecast-loading {
  grid-column: 1 / -1;
  text-align: center;
  padding: 3rem;
  color: var(--text-label);
  font-weight: 500;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(0, 0, 0, 0.1);
  border-left: 4px solid #4caf50;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 1rem;
}

/* Card de previsão */
.forecast-card {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 15px;
  padding: 1.5rem;
  text-align: center;
  transition: var(--transition);
  border: 1px solid var(--glass-border);
  display: flex;
  flex-direction: column;
  min-height: 280px;
}

.forecast-card:hover {
  transform: translateY(-4px);
  background: rgba(255, 255, 255, 0.15);
}

.forecast-date {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-label);
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.forecast-date-small {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 1rem;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.forecast-icon {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  color: #8bc34a;
}

.forecast-temp {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.forecast-desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
  text-transform: capitalize;
  font-weight: 500;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  margin-bottom: 1rem;
}

.forecast-precipitation {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: auto;
}

.precip-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.precip-item i {
  color: #4caf50;
  font-size: 0.9rem;
}

.precip-item span {
  font-weight: 500;
}

/* Seção de histórico */
.history-section {
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius);
  padding: 2rem;
  margin-bottom: 3rem;
  box-shadow: var(--shadow-light);
}

.history-chart {
  min-height: 300px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chart-placeholder {
  text-align: center;
  color: var(--text-label);
  font-weight: 500;
}

.chart-placeholder i {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: 0.5;
}

/* Footer moderno */
.modern-footer {
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  border-top: 1px solid var(--glass-border);
  padding: 2rem 0;
  margin-top: auto;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-content p {
  color: var(--text-light);
  font-weight: 500;
}

.footer-info {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.agrinho-credit {
  font-size: 0.9rem;
  opacity: 0.9;
}

.agrinho-credit strong {
  color: #8bc34a;
}

.footer-links {
  display: flex;
  gap: 2rem;
}

.footer-link {
  color: var(--text-light);
  text-decoration: none;
  font-weight: 500;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.footer-link:hover {
  color: #8bc34a;
  transform: translateY(-2px);
}

/* Loading overlay */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  transition: var(--transition);
}

.loading-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.loading-content {
  text-align: center;
  color: white;
}

.loading-spinner-large {
  width: 60px;
  height: 60px;
  border: 6px solid rgba(255, 255, 255, 0.1);
  border-left: 6px solid white;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 1rem;
}

.loading-content p {
  font-size: 1.1rem;
  font-weight: 500;
}

/* Animações */
@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

@keyframes blink {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0.3; }
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-10px); }
}

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

/* Responsividade melhorada para dispositivos móveis */
@media (max-width: 768px) {
  /* Header mais compacto */
  .header-content {
    padding: 0.5rem 1rem;
    gap: 0.5rem;
  }

  .logo-section {
    gap: 0.5rem;
  }
  
  .logo-section h1 {
    font-size: 1.3rem;
  }
  
  .agrinho-logo {
    width: 32px;
    height: 32px;
  }
  
  .logo-icon {
    width: 28px;
    height: 28px;
    font-size: 0.9rem;
  }

  .status-indicator {
    padding: 0.4rem 0.8rem;
    gap: 0.5rem;
  }

  .status-indicator span {
    font-size: 0.7rem;
  }
  
  /* Conteúdo principal mais compacto */
  .main-content {
    padding: 0.8rem;
  }
  
  /* Cards principais em coluna única */
  .hero-cards {
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-bottom: 2rem;
  }
  
  .primary-card {
    padding: 1.2rem;
  }
  
  .card-icon {
    width: 45px;
    height: 45px;
    font-size: 1.2rem;
    margin-bottom: 1rem;
  }
  
  .card-content h3 {
    font-size: 0.85rem;
    margin-bottom: 0.3rem;
  }
  
  .card-value {
    font-size: 2rem;
    margin-bottom: 0.8rem;
  }
  
  /* Cards secundários em grid 2x2 */
  .secondary-cards {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.8rem;
    margin-bottom: 2rem;
  }

  .info-card {
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 0.8rem;
  }

  .info-card .card-icon {
    width: 35px;
    height: 35px;
    font-size: 1rem;
    margin-bottom: 0;
    flex-shrink: 0;
  }

  .info-card .card-content {
    flex: 1;
  }

  .info-card .card-content h3 {
    font-size: 0.75rem;
    margin-bottom: 0.2rem;
  }

  .info-card .card-value {
    font-size: 1.1rem;
  }
  
  /* Previsão do tempo mais compacta */
  .forecast-section {
    padding: 1.2rem;
    margin-bottom: 2rem;
  }
  
  .section-header {
    margin-bottom: 1.5rem;
  }
  
  .section-header h2 {
    font-size: 1.2rem;
  }
  
  .forecast-container {
    grid-template-columns: repeat(3, 1fr);
    gap: 0.8rem;
  }
  
  .forecast-card {
    min-height: 180px;
    padding: 1rem;
  }
  
  .forecast-date {
    font-size: 0.75rem;
  }

  .forecast-date-small {
    font-size: 0.65rem;
  }

  .forecast-icon {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
  }

  .forecast-temp {
    font-size: 1.4rem;
  }

  .forecast-desc {
    font-size: 0.75rem;
    margin-bottom: 0.5rem;
  }
  
  /* Footer mais compacto */
  .footer-content {
    flex-direction: column;
    text-align: center;
    gap: 1rem;
    padding: 0 1rem;
  }
  
  .footer-links {
    justify-content: center;
  }
  
  .footer-info {
    align-items: center;
  }
}

@media (max-width: 480px) {
  /* Header ultra compacto */
  .header-content {
    padding: 0.3rem 0.8rem;
  }

  .logo-section h1 {
    font-size: 1.1rem;
  }

  .agrinho-logo {
    width: 28px;
    height: 28px;
  }

  .logo-icon {
    width: 24px;
    height: 24px;
    font-size: 0.8rem;
  }

  .status-indicator {
    padding: 0.3rem 0.6rem;
  }

  .status-indicator span {
    font-size: 0.65rem;
  }

  /* Conteúdo principal ultra compacto */
  .main-content {
    padding: 0.5rem;
  }
  
  /* Cards principais */
  .hero-cards {
    gap: 0.8rem;
    margin-bottom: 1.5rem;
  }
  
  .primary-card {
    padding: 1rem;
  }
  
  .card-icon {
    width: 40px;
    height: 40px;
    font-size: 1.1rem;
    margin-bottom: 0.8rem;
  }
  
  .card-content h3 {
    font-size: 0.8rem;
  }
  
  .card-value {
    font-size: 1.8rem;
    margin-bottom: 0.6rem;
  }
  
  /* Cards secundários em coluna única */
  .secondary-cards {
    grid-template-columns: 1fr;
    gap: 0.6rem;
    margin-bottom: 1.5rem;
  }

  .info-card {
    padding: 0.8rem;
    gap: 0.6rem;
  }

  .info-card .card-icon {
    width: 30px;
    height: 30px;
    font-size: 0.9rem;
  }

  .info-card .card-content h3 {
    font-size: 0.7rem;
  }

  .info-card .card-value {
    font-size: 1rem;
  }
  
  /* Previsão do tempo ultra compacta */
  .forecast-section {
    padding: 1rem;
    margin-bottom: 1.5rem;
  }
  
  .section-header {
    margin-bottom: 1rem;
  }
  
  .section-header h2 {
    font-size: 1.1rem;
  }
  
  .forecast-container {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.6rem;
  }
  
  .forecast-card {
    min-height: 160px;
    padding: 0.8rem;
  }

  .forecast-date {
    font-size: 0.7rem;
  }

  .forecast-date-small {
    font-size: 0.6rem;
  }

  .forecast-icon {
    font-size: 1.5rem;
    margin-bottom: 0.4rem;
  }

  .forecast-temp {
    font-size: 1.2rem;
  }

  .forecast-desc {
    font-size: 0.7rem;
    margin-bottom: 0.4rem;
  }
  
  /* Footer ultra compacto */
  .modern-footer {
    padding: 1.5rem 0;
  }
  
  .footer-content {
    padding: 0 0.8rem;
  }
  
  .footer-content p {
    font-size: 0.85rem;
  }
  
  .agrinho-credit {
    font-size: 0.8rem;
  }
  
  .footer-links {
    gap: 1rem;
  }
  
  .footer-link {
    font-size: 0.85rem;
  }
}

/* Responsividade para histórico */
@media (max-width: 768px) {
  .history-section {
    padding: 1rem;
    margin-bottom: 1.5rem;
  }
  
  .history-header {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 0.8rem;
    padding: 0.8rem 1rem;
  }
  
  .history-title {
    flex-direction: row;
    align-items: center;
    gap: 0.8rem;
    flex: 1;
  }
  
  .history-title h2 {
    font-size: 1.1rem;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
  }
  
  .history-title h2 i {
    font-size: 1rem;
  }
  
  .activity-counter {
    font-size: 0.75rem;
    padding: 0.3rem 0.6rem;
    white-space: nowrap;
  }
  
  .activity-counter span {
    font-size: 0.9rem;
  }
  
  .history-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
  }
  
  .history-actions .btn-refresh,
  .history-actions .btn-filter-toggle {
    width: 35px;
    height: 35px;
    font-size: 0.9rem;
  }
  
  .history-filters.show {
    padding: 0.8rem 1rem;
    max-height: 300px;
  }
  
  .filters-row {
    flex-direction: column;
    gap: 0.8rem;
  }
  
  .filter-group {
    min-width: auto;
    width: 100%;
  }
  
  .filter-group label {
    font-size: 0.75rem;
    margin-bottom: 0.3rem;
  }
  
  .filter-select,
  .filter-input {
    padding: 0.5rem 0.6rem;
    font-size: 0.85rem;
    width: 100%;
  }
  
  .filter-actions {
    justify-content: space-between;
    gap: 0.5rem;
  }
  
  .btn-filter,
  .btn-clear {
    padding: 0.5rem 0.8rem;
    font-size: 0.8rem;
    flex: 1;
  }
  
  .activity-list {
    padding: 0.8rem;
    max-height: 300px;
  }
  
  .activity-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.6rem;
    padding: 0.8rem;
    margin-bottom: 0.6rem;
  }
  
  .activity-icon {
    width: 40px;
    height: 40px;
    font-size: 1rem;
  }
  
  .activity-content {
    width: 100%;
  }
  
  .activity-header {
    width: 100%;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  
  .activity-type {
    font-size: 0.7rem;
    padding: 0.2rem 0.5rem;
  }
  
  .activity-timestamp {
    font-size: 0.8rem;
  }
  
  .activity-data {
    width: 100%;
    flex-direction: column;
    gap: 0.4rem;
  }
  
  .data-item {
    justify-content: space-between;
    font-size: 0.8rem;
    padding: 0.2rem 0;
  }
  
  .pagination {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
    padding: 0.8rem 1rem;
  }
  
  .btn-pagination {
    padding: 0.6rem 1rem;
    font-size: 0.85rem;
    white-space: nowrap;
  }
  
  .page-info {
    padding: 0.6rem 1rem;
    font-size: 0.85rem;
    text-align: center;
    white-space: nowrap;
  }
  
  /* Melhorar mensagem de erro */
  .activity-loading {
    padding: 2rem 1rem;
    text-align: center;
  }
  
  .activity-loading .loading-spinner {
    width: 30px;
    height: 30px;
    margin-bottom: 0.8rem;
  }
  
  .activity-loading p {
    font-size: 0.9rem;
    color: var(--text-secondary);
  }
  
  /* Mensagem de erro específica */
  .activity-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.8rem;
    padding: 2rem 1rem;
    text-align: center;
  }
  
  .activity-error i {
    font-size: 2.5rem;
    color: #e53e3e;
    opacity: 0.8;
  }
  
  .activity-error p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin: 0;
  }
}

@media (max-width: 480px) {
  .history-section {
    padding: 0.8rem;
    margin-bottom: 1rem;
  }
  
  .history-header {
    padding: 0.6rem 0.8rem;
    gap: 0.6rem;
  }
  
  .history-title {
    gap: 0.6rem;
  }
  
  .history-title h2 {
    font-size: 1rem;
  }
  
  .history-title h2 i {
    font-size: 0.9rem;
  }
  
  .activity-counter {
    font-size: 0.7rem;
    padding: 0.25rem 0.5rem;
  }
  
  .activity-counter span {
    font-size: 0.8rem;
  }
  
  .history-actions .btn-refresh,
  .history-actions .btn-filter-toggle {
    width: 32px;
    height: 32px;
    font-size: 0.8rem;
  }
  
  .history-filters.show {
    padding: 0.6rem 0.8rem;
    max-height: 250px;
  }
  
  .filters-row {
    gap: 0.6rem;
  }
  
  .filter-group label {
    font-size: 0.7rem;
  }
  
  .filter-select,
  .filter-input {
    padding: 0.4rem 0.5rem;
    font-size: 0.8rem;
  }
  
  .btn-filter,
  .btn-clear {
    padding: 0.4rem 0.6rem;
    font-size: 0.75rem;
  }
  
  .activity-list {
    padding: 0.6rem;
    max-height: 250px;
  }
  
  .activity-item {
    padding: 0.6rem;
    margin-bottom: 0.5rem;
    gap: 0.5rem;
  }
  
  .activity-icon {
    width: 35px;
    height: 35px;
    font-size: 0.9rem;
  }
  
  .activity-header {
    gap: 0.4rem;
  }
  
  .activity-type {
    font-size: 0.65rem;
    padding: 0.15rem 0.4rem;
  }
  
  .activity-timestamp {
    font-size: 0.75rem;
  }
  
  .activity-data {
    gap: 0.3rem;
  }
  
  .data-item {
    font-size: 0.75rem;
    padding: 0.15rem 0;
  }
  
  .pagination {
    padding: 0.6rem 0.8rem;
    gap: 0.5rem;
  }
  
  .btn-pagination {
    padding: 0.5rem 0.8rem;
    font-size: 0.8rem;
  }
  
  .page-info {
    padding: 0.5rem 0.8rem;
    font-size: 0.8rem;
  }
  
  /* Mensagem de erro mais compacta */
  .activity-error {
    padding: 1.5rem 0.8rem;
    gap: 0.6rem;
  }
  
  .activity-error i {
    font-size: 2rem;
  }
  
  .activity-error p {
    font-size: 0.8rem;
  }
  
  .activity-loading {
    padding: 1.5rem 0.8rem;
  }
  
  .activity-loading .loading-spinner {
    width: 25px;
    height: 25px;
    margin-bottom: 0.6rem;
  }
  
  .activity-loading p {
    font-size: 0.8rem;
  }
}

/* Melhorias específicas para telas muito pequenas */
@media (max-width: 360px) {
  .history-section {
    padding: 0.6rem;
  }
  
  .history-header {
    padding: 0.5rem 0.6rem;
    gap: 0.4rem;
  }
  
  .history-title {
    gap: 0.4rem;
  }
  
  .history-title h2 {
    font-size: 0.9rem;
  }
  
  .activity-counter {
    font-size: 0.65rem;
    padding: 0.2rem 0.4rem;
  }
  
  .activity-counter span {
    font-size: 0.75rem;
  }
  
  .history-actions .btn-refresh,
  .history-actions .btn-filter-toggle {
    width: 30px;
    height: 30px;
    font-size: 0.75rem;
  }
  
  .activity-item {
    padding: 0.5rem;
    margin-bottom: 0.4rem;
  }
  
  .activity-icon {
    width: 32px;
    height: 32px;
    font-size: 0.85rem;
  }
  
  .activity-type {
    font-size: 0.6rem;
    padding: 0.1rem 0.3rem;
  }
  
  .activity-timestamp {
    font-size: 0.7rem;
  }
  
  .data-item {
    font-size: 0.7rem;
  }
  
  .pagination {
    padding: 0.5rem 0.6rem;
    gap: 0.4rem;
  }
  
  .btn-pagination {
    padding: 0.4rem 0.6rem;
    font-size: 0.75rem;
  }
  
  .page-info {
    padding: 0.4rem 0.6rem;
    font-size: 0.75rem;
  }
}

/* Desktop grande - melhor espaçamento */
@media (min-width: 1200px) {
  .forecast-container {
    max-width: 1200px;
    margin: 0 auto;
    gap: 2rem;
  }
  
  .forecast-card {
    min-height: 300px;
    padding: 2rem;
  }
}

/* Scrollbar personalizada */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.1);
}

::-webkit-scrollbar-thumb {
  background: var(--success-gradient);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--primary-gradient);
}

/* Histórico de Atividades */
.history-section {
  margin: 2rem 0;
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  border-radius: var(--border-radius);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-light);
  overflow: hidden;
}

/* Top Bar do Histórico */
.history-top-bar {
  background: rgba(255, 255, 255, 0.05);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.history-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 2rem;
  gap: 1rem;
}

.history-title {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex: 1;
}

.history-title h2 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-light);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.activity-counter {
  background: var(--success-gradient);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 600;
  box-shadow: var(--shadow-medium);
  white-space: nowrap;
}

.activity-counter span {
  font-weight: 700;
  font-size: 1.1rem;
}

.history-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Filtros */
.history-filters {
  background: rgba(255, 255, 255, 0.05);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  transition: all 0.3s ease;
  max-height: 0;
  overflow: hidden;
}

.history-filters.show {
  max-height: 200px;
  padding: 1.5rem 2rem;
}

.filters-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: end;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-width: 140px;
  flex: 1;
}

.filter-group label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-light);
  opacity: 0.8;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.filter-select,
.filter-input {
  padding: 0.6rem 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-light);
  font-size: 0.9rem;
  backdrop-filter: blur(10px);
  transition: var(--transition);
}

.filter-select:focus,
.filter-input:focus {
  outline: none;
  border-color: #4caf50;
  background: rgba(255, 255, 255, 0.15);
  box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.2);
}

.filter-select option {
  background: #2e7d32;
  color: white;
}

.filter-actions {
  display: flex;
  gap: 0.75rem;
  align-items: end;
}

.btn-filter,
.btn-clear,
.btn-filter-toggle {
  padding: 0.6rem 1rem;
  border: none;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  white-space: nowrap;
}

.btn-filter {
  background: var(--success-gradient);
  color: white;
  box-shadow: var(--shadow-medium);
}

.btn-filter:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 15px rgba(76, 175, 80, 0.4);
}

.btn-clear {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-light);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-clear:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: translateY(-1px);
}

.btn-filter-toggle {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-light);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-filter-toggle:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: translateY(-1px);
}

.btn-filter-toggle.active {
  background: var(--success-gradient);
  color: white;
  border-color: transparent;
}

/* Lista de atividades */
.activity-list {
  padding: 2rem;
  max-height: 600px;
  overflow-y: auto;
}

.activity-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding: 3rem;
  color: var(--text-light);
}

.activity-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.5rem;
  margin-bottom: 1rem;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 15px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: var(--transition);
  animation: slideIn 0.6s ease-out both;
}

.activity-item:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: translateY(-2px);
  box-shadow: var(--shadow-medium);
}

.activity-icon {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  color: white;
  flex-shrink: 0;
}

.activity-icon.irrigation {
  background: var(--success-gradient);
}

.activity-icon.sensor {
  background: var(--warning-gradient);
}

.activity-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.activity-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.activity-type {
  background: rgba(255, 255, 255, 0.2);
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: 15px;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.activity-type.irrigation {
  background: rgba(76, 175, 80, 0.3);
  border: 1px solid rgba(76, 175, 80, 0.5);
}

.activity-type.sensor {
  background: rgba(139, 195, 74, 0.3);
  border: 1px solid rgba(139, 195, 74, 0.5);
}

.activity-timestamp {
  color: var(--text-light);
  font-size: 0.9rem;
  opacity: 0.8;
}

.activity-data {
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
}

.data-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-light);
  font-size: 0.9rem;
}

.data-item i {
  opacity: 0.7;
}

.data-value {
  font-weight: 600;
}

/* Paginação */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  padding: 1.5rem 2rem;
  background: rgba(255, 255, 255, 0.05);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-pagination {
  padding: 0.75rem 1.5rem;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-light);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-pagination:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

.btn-pagination:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.page-info {
  color: var(--text-light);
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.75rem 1.5rem;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.2);
} 