/* ==========================================
   NO LIMITS HUB - STYLESHEET
   Metro UI Design System & Custom Overrides
=========================================== */

/* Base & Typography */
body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: #111111;
  overflow-x: hidden;
  scroll-behavior: smooth;
}

/* Sharp Edges / Metro Design Rule */
* {
  border-radius: 0 !important;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: #111;
}
::-webkit-scrollbar-thumb {
  background: #333;
}
::-webkit-scrollbar-thumb:hover {
  background: #555;
}

/* Metro Grid Layout */
#metro-grid {
  position: relative;
  align-items: stretch;
}

.metro-tile {
  transition: transform 0.1s ease-out, background-color 0.2s, grid-column 0.3s, grid-row 0.3s;
  min-height: 180px;
  height: 100%;
  overflow: hidden;
}

.metro-tile:not(.expanded):active {
  transform: scale(0.98);
}

#metro-grid > .metro-tile:not([id^="tile-"]):active {
  transform: none;
}

/* Responsive 1 / 2 / 3 column hub (hard CSS guarantee, independent of the
   Tailwind CDN). Mobile-friendly progressive layout:
   - Small phones (<640px): single full-width column.
   - Middle range (640px–1023.98px): two columns when there's enough room
     (shrunk browser, low-res screens, big/landscape phones).
   - Desktop (>=1024px): three columns (handled by Tailwind lg:grid-cols-3).
   Tiles sized for the 3-col layout are re-fitted so nothing overflows. */
@media (max-width: 639.98px) {
  #metro-grid {
    grid-template-columns: minmax(0, 1fr) !important;
  }
  #metro-grid > .metro-tile {
    grid-column: 1 / -1 !important;
  }
}

@media (min-width: 640px) and (max-width: 1023.98px) {
  #metro-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
  /* Tiles originally sized for the 3-col desktop layout (3-wide, or 2-wide already
     spanning a whole row) should span the entire 2-column row instead of overflowing. */
  #metro-grid > .metro-tile.col-span-3,
  #metro-grid > .metro-tile.col-span-2 {
    grid-column: 1 / -1 !important;
  }
}

/* Responsive Tile Expanding */
.metro-tile.expanded {
  grid-column: 1 / -1 !important;
  grid-row: span 4 !important;
  min-height: 85vh;
  height: auto !important;
  cursor: default;
}

@media (min-width: 1024px) {
  .metro-tile.expanded {
    min-height: 70vh;
  }
}

/* Metro Inline Popup Tile (3-wide tile shown inside the grid, below the clicked tile).
   Out-of-flow (absolute) so it NEVER distorts / moves the surrounding tiles.
   Height is auto so the enclosure grows to fit its content: no cut-offs, no forced
   inner scrolling, and no empty space on content-light panels. */
.metro-popup-tile {
  position: absolute;
  left: 0;
  right: 0;
  z-index: 45;
  height: auto;               /* let the content define the height */
  min-height: 180px;
  display: flex;
  flex-direction: column;
  background: #111111;
  cursor: default;
  overflow: visible;          /* never clip the enclosed content */
  box-shadow: 0 22px 44px rgba(0, 0, 0, 0.6);
  border: 1px solid #2a2a2a;
}

.metro-popup-tile .tile-content {
  flex: none;
  min-height: 0;
}

.metro-popup-tile .tab-view {
  flex: none;                 /* stop flex-basis:0 + overflow forcing a scroll box */
  overflow: visible;
  min-height: 0;
}

.metro-popup-close {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  font-size: 28px;
  font-weight: 300;
  line-height: 1;
  color: #aaaaaa;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid #444444;
  cursor: pointer;
  transition: color 0.2s, background-color 0.2s, border-color 0.2s;
}

.metro-popup-close:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
  border-color: #888888;
}

