/* Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  height: 100vh;
  font-family: 'Poppins', sans-serif;
  background: linear-gradient(135deg, #f5f7fa 0%, #d2d2d2 100%);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Navigation Bar */
.nav-bar {
  position: relative;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 25px;
  background-color: #ffffff;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  flex-shrink: 0;
}

.card-title {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.3;
  text-transform: uppercase;
  color: #000000;
}

.dashboard-title {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  font-size: 28px;
  font-weight: 700;
  color: #000000;
  letter-spacing: 1px;
}

/* Navigation Right */
.nav-right {
  display: flex;
  align-items: center;
  gap: 15px;
}

.log-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background-color: #e8e8e8;
  border: 1px solid #c0c0c0;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  color: #000000;
}

.log-icon:hover {
  background-color: #d2d2d2;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.log-icon svg {
  width: 20px;
  height: 20px;
}

/* Card Time - Fixed Width */
.card-time {
  display: flex;
  gap: 12px;
  padding: 6px 12px;
  background-color: #e8e8e8;
  border: 1px solid #c0c0c0;
  border-radius: 4px;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
  min-width: 200px;
}

.time-section {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 85px;
}

.time-label {
  margin-bottom: 2px;
  font-size: 9px;
  font-weight: 600;
  color: #000000;
  white-space: nowrap;
}

.time-value {
  font-size: 14px;
  font-weight: 700;
  color: #000000;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.5px;
}

/* Main Content */
.main-content {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 15px;
  padding: 15px;
  flex: 1;
  min-height: 0;
}

/* Columns */
.left-column,
.right-column {
  display: flex;
  flex-direction: column;
  gap: 15px;
  min-height: 0;
}

/* Card Styles */
.card {
  background-color: #ffffff;
  border-radius: 6px;
  padding: 18px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.card-header {
  margin-bottom: 15px;
  font-size: 16px;
  font-weight: 700;
  text-align: center;
  color: #000000;
  flex-shrink: 0;
}


.card-large {
  flex: 1;
  min-height: 0;
}

/* Card Control - Structure */
.card-control .control-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 0;
}

.control-top {
  display: flex;
  justify-content: center;
  padding: 10px 0;
}

.control-bottom {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  padding-bottom: 10px;
}

/* Device Status */
.device-status {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.control-label {
  font-size: 18px;
  font-weight: 700;
  color: #000000;
  text-align: center;
  margin: 0;
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
}

.status-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  animation: pulse 2s infinite;
}

.status-dot.online {
  background-color: #22c55e;
  box-shadow: 0 0 10px rgba(34, 197, 94, 0.5);
}

.status-dot.offline {
  background-color: #ef4444;
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.5);
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

/* Weather Status Card */
.weather-status {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
}

.status-text {
  font-size: 70px;
  font-weight: 700;
  color: #000000;
}

/* Actuator Control */
.actuator-control {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
  width: 100%;
  max-width: 300px;
}

.control-subtitle {
  font-size: 16px;
  font-weight: 700;
  color: #000000;
  margin: 0;
}

/* Toggle Switch */
.toggle-container {
  display: flex;
  align-items: center;
  gap: 12px;
}

.toggle-label {
  font-size: 13px;
  font-weight: 700;
  color: #000000;
  min-width: 35px;
  text-align: center;
}

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 55px;
  height: 28px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ef4444;
  transition: 0.4s;
  border-radius: 28px;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: 0.4s;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

input:checked + .toggle-slider {
  background-color: #22c55e;
}

input:checked + .toggle-slider:before {
  transform: translateX(27px);
}

/* Actuator Status */
.actuator-status {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  padding: 12px 20px;
  background-color: #f5f5f5;
  border-radius: 6px;
  border: 1px solid #d2d2d2;
}

.status-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
}

.status-label {
  font-size: 13px;
  font-weight: 600;
  color: #555555;
}

.status-value {
  font-size: 15px;
  font-weight: 700;
  color: #ef4444;
  transition: color 0.3s ease;
  min-width: 70px;
  text-align: right;
}

/* Parameters Card */
.card-parameters {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.parameters-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  flex: 1;
  align-content: start;
}

.parameter-card {
  background-color: #d2d2d2;
  padding: 10px;
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 90px;
}

.parameter-card-full {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 15px;
  align-items: center;
  min-height: 120px;
}

.parameter-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  background-color: rgba(0, 0, 0, 0.1);
  border-radius: 50%;
}

.parameter-icon svg {
  width: 18px;
  height: 18px;
  color: #000000;
}

.parameter-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.parameter-chart {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  min-height: 0;
}

.chart-canvas {
  width: 100%;
  height: 100%;
  max-height: 100px;
}

.parameter-name {
  margin-bottom: 5px;
  font-size: 12px;
  font-weight: 600;
  color: #000000;
  text-align: center;
}

.parameter-value {
  font-size: 20px;
  font-weight: 700;
  color: #000000;
}

.parameter-unit {
  font-size: 16px;
  font-weight: 600;
}

/* Log Page */
.log-content {
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px;
  height: calc(100vh - 80px);
  overflow-y: auto;
}

.log-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 15px;
}

.log-filters {
  display: flex;
  gap: 10px;
  align-items: center;
}

.filter-input {
  padding: 8px 12px;
  border: 1px solid #c0c0c0;
  border-radius: 6px;
  font-family: 'Poppins', sans-serif;
  font-size: 14px;
}

.btn-filter,
.btn-export {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background-color: #e8e8e8;
  border: 1px solid #c0c0c0;
  border-radius: 6px;
  cursor: pointer;
  font-family: 'Poppins', sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: #000000;
  transition: all 0.3s ease;
}

.btn-filter:hover,
.btn-export:hover {
  background-color: #d2d2d2;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.btn-filter svg,
.btn-export svg {
  width: 16px;
  height: 16px;
}

/* Table */
.table-container {
  overflow-x: auto;
  margin-bottom: 20px;
}

.log-table {
  width: 100%;
  border-collapse: collapse;
  background-color: #ffffff;
}

.log-table thead {
  background-color: #e8e8e8;
}

.log-table th,
.log-table td {
  padding: 12px;
  text-align: center;
  border: 1px solid #d2d2d2;
  font-size: 13px;
}

.log-table th {
  font-weight: 700;
  color: #000000;
}

.log-table tbody tr:hover {
  background-color: #f5f5f5;
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 15px;
}

.btn-page {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background-color: #e8e8e8;
  border: 1px solid #c0c0c0;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-page:hover {
  background-color: #d2d2d2;
}

.btn-page svg {
  width: 20px;
  height: 20px;
}

.page-info {
  font-size: 14px;
  font-weight: 600;
  color: #000000;
}

/* Responsive */
@media (max-width: 1024px) {
  .main-content {
    grid-template-columns: 1fr;
    overflow-y: auto;
  }
}

@media (max-width: 768px) {
  body {
    overflow-y: auto;
    height: auto;
  }

  .nav-bar {
    flex-direction: column;
    gap: 12px;
    padding: 15px;
  }

  .dashboard-title {
    position: static;
    transform: none;
    font-size: 24px;
  }

  .main-content {
    overflow-y: auto;
  }

  .parameters-grid {
    grid-template-columns: 1fr;
  }

  .parameter-card-full {
    grid-column: 1;
    grid-template-columns: 1fr;
  }
  
  .log-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .actuator-control {
    width: 100%;
  }
}