:root {
  /* Farm-themed color palette */
  --primary-green: #4caf50;
  /* Farm-themed color palette */
  --primary-red: #ff0808;
  /* Fresh grass green */
  --light-green: #81c784;
  /* Light leaf green */
  --dark-green: #2e7d32;
  /* Deep forest green */
  --primary-brown: #8d6e63;
  /* Earthy brown */
  --dark-brown: #5d4037;
  /* Soil brown */
  --golden-yellow: #ffc107;
  /* Wheat/Harvest gold */
  --sky-blue: #64b5f6;
  /* Clear sky blue */
  --sunset-orange: #ff8a65;
  /* Sunset orange */

  /* Background colors */
  --dark-earth: #1a1f16;
  /* Dark earth background */
  --medium-earth: #2d3529;
  /* Medium earth */
  --light-earth: #3d4a35;
  /* Light earth */

  /* Card and UI colors */
  --card-bg: rgba(45, 53, 41, 0.85);
  --card-border: rgba(76, 175, 80, 0.2);
  --white: #ffffff;
  --off-white: #e8f5e9;
  /* Light green tinted white */
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  --transition: all 0.3s ease;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

body {
  background: url("https://docit.docteur-aoun.com/storage/uploads/Media/2025-12-25/SYuGohRWqh4I0yEq3HZ63w1OWnnm81asKNsow1Ke.jpg");
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  color: var(--off-white);
  min-height: 100vh;
  overflow-x: hidden;
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px;
}

/* Header Styles */
header {
  background:
    linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)),
    url("https://docit.docteur-aoun.com/storage/uploads/Media/2025-12-25/8ThCz57hdAQr10IvXS55ozuMkS3bDUstcH5x4s95.jpg");
  background-size: cover;
  background-position: center;
  border-radius: 20px;
  padding: 30px 40px;
  margin-bottom: 40px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid var(--card-border);
}

.header-bg {
  display: none;
}

.header-content {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header-text h1 {
  font-size: 2.8rem;
  background: linear-gradient(
    to right,
    var(--primary-green),
    var(--primary-blue)
  );
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: 10px;
  letter-spacing: 1px;
}

.header-text p {
  font-size: 1.2rem;
  color: rgba(255, 255, 255, 0.8);
  max-width: 600px;
}

.header-text h2 {
  font-size: 4rem;
  color: var(--white);
  margin-bottom: 10px;
  font-weight: 500;
  letter-spacing: 0.5px;
}

.station-name {
  font-size: 1.9rem;
  color: var(--primary-red);
  margin-top: 10px;
  font-weight: 600;
}

@keyframes pulse {
  0% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.05);
  }

  100% {
    transform: scale(1);
  }
}

/* Loading Spinner */
.loading-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px;
}

.spinner {
  width: 60px;
  height: 60px;
  border: 4px solid rgba(255, 255, 255, 0.1);
  border-left-color: var(--primary-green);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

.loading-text {
  margin-top: 20px;
  font-size: 1.2rem;
  color: rgba(255, 255, 255, 0.7);
}

/* Error Message */
.error-container {
  background: rgba(244, 67, 54, 0.1);
  border: 1px solid rgba(244, 67, 54, 0.3);
  border-radius: 12px;
  padding: 30px;
  text-align: center;
  margin: 20px 0;
}

.error-container i {
  font-size: 3rem;
  color: #f44336;
  margin-bottom: 15px;
}

.error-container h3 {
  color: #f44336;
  margin-bottom: 10px;
}

.retry-btn {
  background: var(--dark-green);
  color: white;
  border: none;
  padding: 12px 30px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1rem;
  margin-top: 15px;
  transition: var(--transition);
}

.retry-btn:hover {
  background: var(--primary-green);
  transform: translateY(-2px);
}

.dashboard-main-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
  margin-bottom: 50px;
}

.map-section {
  /* background: var(--card-bg); */
  border-radius: 18px;
  border: 1px solid var(--card-border);
  padding: 25px;
  backdrop-filter: blur(5px);
  display: flex;
  flex-direction: column;
}

/* Sensor Cards Grid */
.cards-section {
  margin-bottom: 0px;
}

.section-title {
  font-size: 1.8rem;
  margin-bottom: 25px;
  color: var(--white);
  display: flex;
  align-items: center;
}

.section-title i {
  margin-right: 15px;
  color: var(--light-green);
}

.last-update {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.6);
  margin-left: auto;
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 25px;
}

.sensor-card {
  background: var(--card-bg);
  border-radius: 18px;
  padding: 25px;
  display: flex;
  flex-direction: column;
  transition: var(--transition);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
  border: 1px solid var(--card-border);
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(5px);
}

.sensor-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 5px;
  height: 100%;
  transition: var(--transition);
}

.sensor-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.3);
}

.sensor-card:hover::before {
  width: 8px;
}

.card-weather::before {
  background: var(--sky-blue);
}

.card-soil::before {
  background: var(--primary-brown);
}

.card-nutrient::before {
  background: var(--golden-yellow);
}

.card-status::before {
  background: var(--primary-green);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.card-icon {
  font-size: 2.5rem;
  width: 70px;
  height: 70px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-weather .card-icon {
  background: rgba(100, 181, 246, 0.2);
  color: var(--sky-blue);
}

.card-soil .card-icon {
  background: rgba(141, 110, 99, 0.2);
  color: var(--primary-brown);
}

.card-nutrient .card-icon {
  background: rgba(255, 193, 7, 0.15);
  color: var(--primary-yellow);
}

.card-status .card-icon {
  background: rgba(0, 196, 87, 0.15);
  color: var(--primary-green);
}

.card-value {
  font-size: 2.8rem;
  font-weight: 700;
  margin-bottom: 5px;
}

.card-label {
  font-size: 1.1rem;
  color: rgba(255, 255, 255, 0.7);
}

.card-unit {
  font-size: 1.2rem;
  color: rgba(255, 255, 255, 0.6);
}

.card-footer {
  margin-top: auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 15px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.status-indicator {
  display: flex;
  align-items: center;
  font-size: 0.9rem;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 8px;
}

.online {
  background: var(--primary-green);
}

.offline {
  background: #f44336;
}

/* Pagination */
.pagination-container {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin: 30px 0;
  flex-wrap: wrap;
}

.pagination-btn {
  background: var(--card-bg);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--off-white);
  padding: 10px 18px;
  border-radius: 8px;
  cursor: pointer;
  transition: var(--transition);
  font-size: 0.95rem;
}

.pagination-btn:hover:not(:disabled) {
  background: var(--dark-green);
  border-color: var(--dark-green);
}

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

.pagination-btn.active {
  background: var(--primary-green);
  border-color: var(--primary-green);
}

.pagination-info {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.95rem;
}

/* History Table */
.history-section {
  margin-bottom: 50px;
}

.history-table-container {
  background: var(--card-bg);
  border-radius: 18px;
  padding: 25px;
  overflow-x: auto;
  border: 1px solid var(--card-border);
  backdrop-filter: blur(5px);
}

.history-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 800px;
}

.history-table th,
.history-table td {
  padding: 14px 16px;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.history-table th {
  background: rgba(76, 175, 80, 0.15);
  color: var(--light-green);
  font-weight: 600;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.history-table tr:hover {
  background: rgba(76, 175, 80, 0.08);
}

.history-table td {
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.95rem;
}

.status-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
}

.status-badge.active {
  background: rgba(0, 196, 87, 0.2);
  color: var(--primary-green);
}

.status-badge.inactive {
  background: rgba(244, 67, 54, 0.2);
  color: #f44336;
}

/* Charts Section */
.charts-section {
  margin-bottom: 50px;
}

.charts-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 30px;
}

.chart-card {
  background: var(--card-bg);
  border-radius: 18px;
  padding: 25px;
  box-shadow: var(--shadow);
  border: 1px solid var(--card-border);
  backdrop-filter: blur(5px);
}

.chart-title {
  font-size: 1.3rem;
  margin-bottom: 20px;
  color: var(--white);
  display: flex;
  align-items: center;
}

.chart-title i {
  margin-right: 10px;
  color: var(--primary-green);
}

.chart-container {
  position: relative;
  height: 250px;
  width: 100%;
}

/* Footer */
footer {
  background: rgba(45, 53, 41, 0.9);
  border-radius: 20px;
  padding: 30px;
  text-align: center;
  border: 1px solid var(--card-border);
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(10px);
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
}

.footer-logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary-green);
}

.copyright {
  color: rgba(255, 255, 255, 0.6);
  font-size: 1rem;
}

.contact-info {
  display: flex;
  align-items: center;
  color: rgba(255, 255, 255, 0.7);
}

.contact-info i {
  margin-right: 8px;
  color: var(--light-green);
}

.footer-animation {
  margin-top: 20px;
  font-size: 1.5rem;
  color: var(--primary-green);
  animation: bounce 2s infinite;
}

@keyframes bounce {
  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-10px);
  }
}

/* Responsive Design */
@media (max-width: 1100px) {
  .dashboard-main-layout {
    grid-template-columns: 1fr;
  }

  .map-section {
    padding: 15px;
  }

  .charts-container {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .header-content {
    flex-direction: column;
    text-align: center;
  }

  .cards-grid {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  }

  .footer-content {
    flex-direction: column;
    text-align: center;
  }

  .chart-card {
    padding: 20px;
  }

  .last-update {
    margin-left: 0;
    margin-top: 10px;
    width: 100%;
  }

  .section-title {
    flex-wrap: wrap;
  }
}

@media (max-width: 480px) {
  .header-text h1 {
    font-size: 2rem;
  }

  .header-text p {
    font-size: 1rem;
  }

  .sensor-card {
    padding: 20px;
  }

  .card-value {
    font-size: 2.2rem;
  }

  .charts-container {
    gap: 20px;
  }
}

/* Geometric shapes in background */
.bg-shapes {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  overflow: hidden;
}

.shape {
  position: absolute;
  border-radius: 50%;
  opacity: 0.05;
}

.shape-1 {
  width: 400px;
  height: 400px;
  background: var(--sky-blue);
  top: -200px;
  right: -100px;
}

.shape-2 {
  width: 300px;
  height: 300px;
  background: var(--primary-green);
  bottom: -150px;
  left: -100px;
}

.shape-3 {
  width: 200px;
  height: 200px;
  background: var(--golden-yellow);
  top: 50%;
  right: 10%;
}
