/* Custom Styles for Monitoring System */

/* ===== Code Blocks ===== */
.codeblock {
  white-space: pre;
  overflow-x: auto;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(15, 23, 42, 0.6);
  color: rgba(226, 232, 240, 0.95);
  font-size: 12px;
  line-height: 1.45;
}

@media (max-width: 640px) {
  .codeblock {
    font-size: 10px;
    padding: 8px 10px;
  }
}

.codeblock-compact {
  white-space: pre;
  overflow-x: auto;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(15, 23, 42, 0.5);
  color: rgba(226, 232, 240, 0.9);
  font-size: 10px;
  line-height: 1.4;
}

/* ===== Metric Cards ===== */
.metric-card {
  display: flex;
  flex-direction: column;
  height: 68px;
  min-height: 68px;
  max-height: 68px;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: rgba(2, 6, 23, 0.6);
  overflow: hidden;
}

@media (max-width: 640px) {
  .metric-card {
    height: auto;
    min-height: 60px;
    max-height: none;
    padding: 10px;
  }
}

.metric-value {
  margin-top: auto;
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.2;
}

@media (max-width: 640px) {
  .metric-value {
    font-size: 1rem;
  }
}

.metric-value-small {
  margin-top: auto;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.2;
}

/* ===== Charts ===== */
.chart-container {
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: rgba(2, 6, 23, 0.6);
  padding: 12px;
  min-height: 220px;
  height: 220px;
}

@media (max-width: 640px) {
  .chart-container {
    min-height: 180px;
    height: 180px;
    padding: 8px;
  }
}

/* ===== Time Range Buttons ===== */
.time-btn {
  padding: 8px 16px;
  font-size: 12px;
  font-weight: 500;
  border-radius: 8px;
  border: 2px solid rgba(148, 163, 184, 0.4);
  background: rgba(30, 41, 59, 0.7);
  color: rgba(226, 232, 240, 1);
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  white-space: nowrap;
}

@media (max-width: 640px) {
  .time-btn {
    padding: 6px 12px;
    font-size: 11px;
  }
}

.time-btn:hover {
  background: rgba(51, 65, 85, 0.8);
  border-color: rgba(148, 163, 184, 0.6);
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

.time-btn:active {
  transform: translateY(0);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.time-btn.active {
  background: rgba(52, 211, 153, 0.25);
  border-color: rgba(52, 211, 153, 0.8);
  color: rgba(52, 211, 153, 1);
  font-weight: 600;
  box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.15), 0 2px 6px rgba(0, 0, 0, 0.4);
}

/* ===== Mobile Responsive Tables ===== */
@media (max-width: 768px) {
  table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
  }
  
  table thead {
    display: table-header-group;
  }
  
  table tbody {
    display: table-row-group;
  }
}

/* ===== Mobile Form Adjustments ===== */
@media (max-width: 640px) {
  input[type="text"],
  input[type="email"],
  input[type="password"],
  textarea,
  select {
    font-size: 16px !important; /* Prevents zoom on iOS */
  }
}

/* ===== Mobile Grid Adjustments ===== */
@media (max-width: 640px) {
  .grid-cols-2,
  .grid-cols-3,
  .grid-cols-4 {
    grid-template-columns: repeat(1, minmax(0, 1fr));
  }
}

@media (min-width: 641px) and (max-width: 768px) {
  .grid-cols-3,
  .grid-cols-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* ===== Smooth Scrolling ===== */
html {
  scroll-behavior: smooth;
}

/* ===== Mobile Menu Animation ===== */
#mobile-menu {
  transition: all 0.3s ease-in-out;
}

/* ===== Touch-friendly Buttons ===== */
@media (max-width: 768px) {
  button,
  a.button {
    min-height: 44px; /* iOS recommendation for touch targets */
    min-width: 44px;
  }
}

/* ===== Prevent Text Selection on Buttons ===== */
button,
.time-btn {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}


