/* --- VARIABLES --- */
:root {
  --bg-dark: #0f172a;
  --card-bg: rgba(30, 41, 59, 0.6);
  --accent-blue: #38bdf8;
  --accent-green: #4ade80;
  --accent-red: #f87171;
  --text-main: #f8fafc;
  --glass-border: rgba(255, 255, 255, 0.1);
}

/* --- BASE STYLES --- */
body {
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: "Segoe UI", system-ui, sans-serif;
  margin: 0;
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.header {
  text-align: center;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}

.header-logo {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: 2px solid var(--accent-blue);
}

/* --- THE MASTER DASHBOARD GRID --- */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr); 
    gap: 20px;
    padding: 10px;
    width: 100%;
    max-width: 1800px;
}

/* --- NAVIGATION TILES --- */
.nav-grid-container {
  grid-column: 1 / -1; 
  display: grid;
  grid-template-columns: repeat(3, 1fr); 
  gap: 12px; 
  margin-bottom: 25px;
  width: 100%;
}

.nav-box {
  background: var(--card-bg);
  backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  padding: 12px 5px; 
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  text-decoration: none;
  color: var(--text-main);
  font-weight: bold;
  font-size: 0.95rem;
  transition: all 0.2s ease;
}

.nav-box:hover {
  background: rgba(56, 189, 248, 0.2);
  border-color: var(--accent-blue);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* --- NEW: CARD ROW (FLEXBOX FOR EQUAL HEIGHTS) --- */
.card-row {
    display: flex;
    flex-wrap: nowrap;
    gap: 20px;
    grid-column: 1 / -1;
    align-items: stretch; /* This forces all cards in the row to match the height of the tallest card */
    width: 100%;
    margin-bottom: 20px;
}

/* --- INFO CARDS --- */
.info-card {
  background: var(--card-bg);
  backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  height: auto; /* Changed from min-content to allow stretching */
  position: relative;
  transition: all 0.2s ease;
  cursor: pointer;
  z-index: 1;
}

/* Ensure cards inside the card-row take up equal width */
.card-row .info-card {
    flex: 1;
}

.full-width { 
    grid-column: 1 / -1; 
}

h3 {
  margin-top: 0;
  color: var(--accent-blue);
  font-size: 1rem;
  border-bottom: 1px solid var(--glass-border);
  padding-bottom: 12px;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Iframes now grow to fill the card height */
iframe {
  width: 100%;
  flex-grow: 1; /* Allows iframe to fill the vertical space of a stretched card */
  min-height: 450px; 
  border: none;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.2);
}

/* --- INTERACTIVITY & CLICKS --- */
.info-card:hover {
    border-color: var(--accent-blue);
    background: rgba(56, 189, 248, 0.1); 
    transform: scale(1.02); 
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
    z-index: 10;
}

.info-card h3 a {
    text-decoration: none !important;
    color: inherit !important;
}

.stretched-link::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 999; /* Sits on top of iframe/content to make the whole card clickable */
    pointer-events: auto;
}

/* --- RESPONSIVE BREAKPOINTS --- */

/* Tablet: Stack cards 2x2 in the row */
@media (max-width: 1200px) {
    .card-row { flex-wrap: wrap; }
    .card-row .info-card { flex: 1 1 calc(50% - 20px); }
}

/* 1 Wide Content (Mobile) */
@media (max-width: 700px) {
    .dashboard-grid { grid-template-columns: 1fr; gap: 15px; }
    .card-row { flex-wrap: wrap; }
    .card-row .info-card { flex: 1 1 100%; }
    
    .nav-grid-container {
      grid-template-columns: repeat(2, 1fr);
      gap: 8px;
    }
    .nav-box { padding: 10px; font-size: 0.85rem; }
    iframe { min-height: 350px; }
}

/* --- SCROLLBARS --- */
.status-scroll::-webkit-scrollbar, 
#recent-additions::-webkit-scrollbar {
    width: 4px;
}
.status-scroll::-webkit-scrollbar-thumb,
#recent-additions::-webkit-scrollbar-thumb {
    background: var(--glass-border);
    border-radius: 10px;
}