/* ==========================================================================
   1. DESIGN TOKENS & CORE RESETS
   ========================================================================== */
:root {
  /* Main Background Color */
  --bg-color: #1e1e2e;
  --bg-card: #252538;
  /* Mantle / Slightly lighter for elevation */
  --border-color: #313244;
  /* Surface 0 / Subtle dividers */

  /* 30% - Typography & UI Elements */
  --text-primary: #cdd6f4;
  /* Text / Soft white */
  --text-muted: #a6adc8;
  /* Subtext */

  /* 10% - Accents (Used sparingly) */
  --accent: #fab387;
  /* Peach / Soft, matte orange */
  --accent-muted: rgba(250, 179, 135, 0.1);
  --success: #a6e3a1;
  /* Green for online/completed tasks */
  --error: #f38ba8;
  /* Red for server alerts */
}

body {
  font-family: "Roboto", sans-serif;
  background-color: var(--bg-color);
}

/* ==========================================================================
   2. HEADER, NAV BAR & FOOTER 
   ========================================================================== */
.site-header {
  display: flex;
  flex-direction: column;
  padding: 0.75rem;
  align-items: center;
  justify-content: center;
  font-family: Russo One;
  color: var(--text-muted);
}

.site-header h1,
.site-header h2,
.site-header h3,
.site-header h4,
.site-header h5,
.site-header h6 {
  margin: 0;
}

.site-header h1 {
  color: var(--text-primary);
}

.nav-custom {
  margin-bottom: 0.75rem;
  font-family: Russo One;
  background-color: var(--bg-card);
}

.nav-custom .navbar-toggler-icon {
  /* 1. Remove Bootstrap's default hardcoded image */
  background-image: none;

  /* 2. Set the color to your exact Catppuccin text variable */
  background-color: var(--text-muted);

  /* 3. Use the hamburger geometry as a stencil (mask) over the color */
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3E%3Cpath stroke='black' stroke-width='2' stroke-linecap='round' d='M4 7h22M4 15h22M4 23h22'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3E%3Cpath stroke='black' stroke-width='2' stroke-linecap='round' d='M4 7h22M4 15h22M4 23h22'/%3E%3C/svg%3E");

  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
}

.nav-custom .navbar-toggler {
  border: var(--text-muted) solid 2px;
}

.nav-custom .navbar-toggler:focus {
  outline: none;
  box-shadow: 0 0 0 4px var(--accent-muted);
  /* A soft 4px peach halo */
}

.nav-custom .nav-item a {
  color: var(--text-muted);
}

.nav-custom .nav-link.active {
  color: var(--text-muted);
}

.nav-custom .navbar-brand {
  color: var(--text-muted);
}

.nav-custom .dropdown-menu {
  background-color: var(--bg-card);
}

.nav-custom .dropdown-item:hover {
  background-color: var(--border-color);
  color: var(--accent);
}

.nav-custom .nav-link.dropdown-toggle.dropdown-custom.show {
  color: var(--text-primary);
}

/* ==========================================================================
   3. MAIN CONTAINERS (Native CSS Nesting Edition)
   ========================================================================== */

.app-container {
  min-height: 100vh;
  padding: 1.5rem;

  @media (min-width: 1024px) {
    padding: 1rem;
    max-width: 2160px;
    margin: 0 auto;
  }

  .app-container__grid {
    display: flex;
    flex-direction: column;

    &.app-container__grid--2 {
      @media (min-width: 1024px) {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
      }
    }

    &.app-container__grid--3 {
      @media (min-width: 1024px) {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
      }
    }

    &.app-container__grid--4 {
      @media (min-width: 1024px) {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
      }
    }

    &.app-container__grid--7 {
      @media (min-width: 1024px) {
        display: grid;
        grid-template-columns: repeat(7, 1fr);
      }
    }

    &.app-container__grid--auto {
      @media (min-width: 1024px) {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
      }
    }
  }

  /* Pure Vertical Stack Element */
  .app-container__flex-col {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
  }

  /* Specialized Layout Element */
  .app-container__grid-stats {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;

    @media (min-width: 1024px) {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      grid-auto-flow: row;
    }

    & > .page-card:first-child {
      @media (min-width: 1024px) {
        grid-column: 1 / -1;
        /* Spans across all columns */
      }
    }
  }
}

/* ==========================================================================
   4. CARDS
   ========================================================================== */

/* The Block */
.page-card {
  color: var(--text-primary);
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin: 0.5rem;

  /* --- Elements --- */
  .page-card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
  }

  .page-card__body {
    flex-grow: 1;
    color: var(--text-primary);

    &.page-card__body--underlined {
      border-bottom: solid var(--border-color) 1px;
    }
  }
  .page-card__footer {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.5rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border-color);
    padding-top: 0.5rem;
  }

  &.page-card--red {
    background-color: rgba(135, 34, 34, 0.5);
  }

  &.page-card--green {
    background-color: rgba(34, 135, 34, 0.5);
  }
}

/* ==========================================================================
   5. COMPONENT: DATA METRIC LISTS
   ========================================================================== */
.metric-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  /* Space between each row of data */

  /* The actual key/value container row */
  .metric-row {
    display: flex;
    justify-content: space-between;
    /* Pushes label left, value right */
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.25rem;

    /* Clean subtle typography for your keys (e.g. "Up Time:") */
    .metric-row__label {
      color: var(--text-muted);
      font-size: 0.875rem;
      /* 14px */
    }

    /* Crisp primary text for the actual figures (e.g. "45°C") */
    .metric-row__value {
      color: var(--text-primary);
      font-weight: 600;
    }

    /* BEM Modifier: Need to highlight an alert or high temperature? */
    .metric-row--danger {
      border-color: var(--error);

      .metric-row__value {
        color: var(--error);
        /* Automatically highlights the number red */
      }
    }
  }

  /* Section subheadings inside the card (like Disk Names) */
  .metric-section-title {
    color: var(--accent);
    /* Uses your soft peach accent color */
    font-size: 0.9rem;
    margin: 1rem 0 0.5rem 0;
    text-transform: uppercase;
    letter-spacing: 0.05em;
  }
}

/* ==========================================================================
   6. BUTTONS
   ========================================================================== */

.btn-custom {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
  font-weight: 700;
  text-decoration: none;
  border-radius: 4px;
  transition: all 0.2s ease-in-out;

  &.btn-custom--green {
    background-color: greenyellow;
    color: black;

    &:hover {
      background-color: #2a3304;
    }
  }

  &.btn-custom--red {
    background-color: rgb(170, 10, 10);
    color: white;

    &:hover {
      background-color: #330404;
    }
  }

  &.btn-custom--blue {
    background-color: rgb(54, 8, 239);
    color: white;

    &:hover {
      background-color: #060433;
    }
  }

  &.btn-custom--orange {
    background-color: rgb(211, 119, 15);
    color: white;

    &:hover {
      background-color: #331f04;
    }
  }
}
