@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700&display=swap");

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  font-family: "Inter", sans-serif;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
  background-color: #f8fafc;
  color: #0f172a;
}

/* App Layout */
.app-layout {
  display: flex;
  height: 100%;
  width: 100%;
}

/* Sidebar */
.main-sidebar {
  width: 250px;
  background: #ffffff;
  border-right: 1px solid #e2e8f0;
  padding: 20px 0;
  display: flex;
  flex-direction: column;
}
.brand {
  font-size: 24px;
  font-weight: 700;
  color: #2a4dff;
  padding: 0 20px 30px 20px;
}
.nav-item {
  padding: 15px 20px;
  color: #64748b;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.2s;
}
.nav-item:hover {
  background: #f1f5f9;
}
.nav-item.active {
  background: #eff6ff;
  color: #2a4dff;
  border-right: 4px solid #2a4dff;
}

/* Main Content Area */
.main-content {
  flex: 1;
  padding: 40px;
  background: #f8fafc;
  position: relative;
}

/* View Toggling */
.app-view {
  display: none;
  height: 100%;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
  border: 1px solid #e2e8f0;
  overflow: hidden;
  flex-direction: column;
}
.app-view.active {
  display: flex;
}

.view-header {
  padding: 20px 30px;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.view-header h2 {
  margin: 0;
  font-size: 20px;
}
.view-body {
  padding: 30px;
  flex: 1;
  overflow-y: auto;
}

/* 1. Browser Styles */
.search-input {
  padding: 10px 15px;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
  width: 300px;
  outline: none;
}
.module-table {
  width: 100%;
  border-collapse: collapse;
}
.module-table th,
.module-table td {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid #f1f5f9;
}

/* 2. Comparator Styles */
.comparator-grid {
  display: flex;
  gap: 20px;
}
.comp-col {
  flex: 1;
  background: #f8fafc;
  padding: 20px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
}
.comp-col h3 {
  margin-top: 0;
  font-size: 16px;
  color: #475569;
  text-align: center;
}
.mod-tag {
  background: #ffffff;
  border-left: 3px solid #2a4dff;
  padding: 10px;
  margin-bottom: 10px;
  border-radius: 4px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}
.mod-tag.green {
  border-left-color: #27c93f;
}

/* 3. Planner Styles */
.planner-grid {
  display: flex;
  gap: 20px;
  height: 100%;
}
.sem-column {
  flex: 1;
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  padding: 15px;
  min-height: 300px;
}
.sem-title {
  font-weight: 600;
  color: #64748b;
  margin-bottom: 15px;
  text-align: center;
}
.draggable-card {
  background: #ffffff;
  padding: 12px;
  border-radius: 6px;
  margin-bottom: 10px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  border: 1px solid #e2e8f0;
  border-left: 3px solid #ffbd2e;
  cursor: grab;
}
.draggable-card:active {
  cursor: grabbing;
}

/* 4. Engine Styles */
.engine-container {
  padding: 60px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
}
.combination-title {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 40px;
}
select {
  font-family: "Inter", sans-serif;
  font-size: 24px;
  font-weight: 700;
  border: none;
  background: transparent;
  cursor: pointer;
  outline: none;
}
select#primary-select {
  color: #2a4dff;
}
select#secondary-select {
  color: #0f172a;
}
.plus-icon {
  color: #64748b;
  font-size: 24px;
  font-weight: 700;
}
.progress-container {
  width: 100%;
  max-width: 800px;
  height: 20px;
  background: #e2e8f0;
  border-radius: 10px;
  overflow: hidden;
  display: flex;
}
.bar-segment {
  transition: width 0.4s ease;
}
#bar-primary {
  background: #2a4dff;
}
#bar-overlap {
  background: #27c93f;
}
#bar-secondary {
  background: #ffbd2e;
}
.progress-labels {
  display: flex;
  width: 100%;
  max-width: 800px;
  justify-content: space-between;
  margin-top: 10px;
  font-size: 12px;
  color: #64748b;
  font-weight: 600;
}
.stats-row {
  display: flex;
  gap: 30px;
  width: 100%;
  max-width: 800px;
  margin-top: 40px;
}
.stat-box {
  flex: 1;
  background: #ffffff;
  padding: 20px;
  border-radius: 8px;
  text-align: center;
  border: 1px solid #e2e8f0;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}
.stat-box.highlight {
  border: 2px solid #27c93f;
}
.stat-value {
  font-size: 32px;
  font-weight: 700;
  color: #2a4dff;
  margin-bottom: 5px;
}
.stat-value.green {
  color: #16a34a;
}
.stat-value.red {
  color: #dc2626;
}
.stat-label {
  font-size: 12px;
  color: #64748b;
  text-transform: uppercase;
}
/* =========================================================
   MOBILE RESPONSIVENESS (Add to bottom of style.css)
   ========================================================= */
@media (max-width: 768px) {
  /* Change layout to put navigation at the bottom */
  .app-layout {
    flex-direction: column-reverse;
  }

  /* Transform Sidebar into a Bottom Nav Bar */
  .main-sidebar {
    width: 100%;
    height: auto;
    flex-direction: row;
    padding: 0;
    border-right: none;
    border-top: 1px solid #e2e8f0;
    justify-content: space-around;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
    z-index: 10;
  }

  .brand {
    display: none; /* Hide brand name to save space on phone */
  }

  .nav-item {
    padding: 12px 5px;
    font-size: 11px;
    text-align: center;
    flex: 1;
    border-right: none;
    border-top: 3px solid transparent;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
  }

  /* Move active highlight to the top edge for bottom nav */
  .nav-item.active {
    border-right: none;
    border-top: 3px solid #2a4dff;
    background: #eff6ff;
  }

  /* Adjust Main Content Area */
  .main-content {
    padding: 15px;
    height: calc(100vh - 60px); /* Leave room for bottom nav */
  }

  /* Stack Header Elements */
  .view-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 15px;
    padding: 15px;
  }

  .search-input {
    width: 100%;
  }

  .view-body {
    padding: 15px;
  }

  /* Stack Grid Columns Vertically */
  .comparator-grid,
  .stats-row {
    flex-direction: column;
    gap: 15px;
  }

  .planner-grid {
    flex-direction: column;
    gap: 15px;
    height: auto; /* Let the grid expand beyond the screen height */
  }

  .sem-column {
    flex: none; /* Stop forcing columns to be equal size */
    min-height: 150px;
    height: auto; /* Allow the dashed box to stretch down when cards are added */
    margin-bottom: 10px;
  }

  /* Adjust Degree Engine for small screens */
  .engine-container {
    padding: 20px 10px;
  }

  .combination-title {
    flex-direction: column;
    gap: 5px;
    text-align: center;
  }

  select {
    font-size: 18px;
    text-align: center;
    padding-right: 0;
  }

  .progress-labels {
    flex-direction: column;
    align-items: center;
    gap: 5px;
  }

  .stat-box {
    padding: 15px;
  }

  .stat-value {
    font-size: 24px;
  }
}
