/* =====================================================
   GU Student Information System - Global Styles
   Matches PeopleSoft Fluid UI appearance
   ===================================================== */

/* ─── CSS Variables / Design Tokens ─── */
:root {
  /* Primary palette */
  --gu-green: #006747;
  --gu-green-dark: #004d35;
  --gu-green-light: #e8f5e9;
  --header-bg: #1a1a1a;
  --header-text: #fff;

  /* Status colors */
  --success: #3DA16A;
  --warning: #ED6647;
  --info: #267DB3;
  --progress-blue: rgba(38,125,179,1);

  /* Neutrals */
  --bg-primary: #f5f5f5;
  --bg-card: #ffffff;
  --border: #e0e0e0;
  --border-light: #f0f0f0;
  --text-primary: #1a1a1a;
  --text-secondary: #555;
  --text-muted: #888;

  /* Sizing */
  --sidebar-width: 280px;
  --header-height: 50px;
  --radius: 0px;
  --radius-sm: 0px;

  /* Transitions */
  --transition: 0.2s ease;
}

/* ─── Reset & Base ─── */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 14px;
  scroll-behavior: smooth;
}

body {
  font-family: Arial, Helvetica, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100vh;
}

a {
  color: var(--gu-green);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: var(--gu-green-dark);
  text-decoration: underline;
}

/* ─── Header ─── */
.header {
  background: var(--header-bg);
  color: var(--header-text);
  height: var(--header-height);
  display: flex;
  align-items: center;
  padding: 0 16px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 3px rgba(0,0,0,0.12);
}

.header-back {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--header-text);
  font-size: 0.875rem;
  cursor: pointer;
  transition: opacity var(--transition);
  text-decoration: none;
}

.header-back:hover {
  opacity: 0.8;
  text-decoration: none;
  color: var(--header-text);
}

.header-back svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.header-title {
  flex: 1;
  text-align: center;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-actions button {
  background: none;
  border: none;
  color: var(--header-text);
  cursor: pointer;
  padding: 6px;
  border-radius: 4px;
  transition: background var(--transition);
}

.header-actions button:hover {
  background: rgba(255,255,255,0.1);
}

/* ─── Layout ─── */
.layout {
  display: flex;
  min-height: calc(100vh - var(--header-height));
}

/* ─── Sidebar ─── */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  flex-shrink: 0;
  overflow-y: auto;
}

.sidebar-header {
  padding: 16px;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  color: var(--text-primary);
  font-size: 0.9rem;
}

.sidebar-nav {
  list-style: none;
}

.sidebar-nav li {
  border-bottom: 1px solid var(--border-light);
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  color: var(--text-primary);
  transition: background var(--transition);
  font-size: 0.875rem;
}

.sidebar-nav a:hover {
  background: var(--gu-green-light);
  text-decoration: none;
}

.sidebar-nav a.active {
  background: var(--gu-green-light);
  border-left: 3px solid var(--gu-green);
  font-weight: 600;
  color: var(--gu-green);
}

.sidebar-nav .nav-icon {
  font-size: 1.2rem;
  width: 24px;
  text-align: center;
}

/* ─── Main Content ─── */
.main-content {
  flex: 1;
  padding: 24px;
  overflow-y: auto;
  max-width: 1200px;
}

/* ─── Page Title ─── */
.page-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 20px;
  padding-bottom: 8px;
}

/* ─── Cards ─── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 20px;
  overflow: hidden;
}

.card-header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-body {
  padding: 16px;
}

.card-row-count {
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--text-muted);
}

/* ─── Tables ─── */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.data-table thead th {
  background: #fafafa;
  border-bottom: 2px solid var(--border);
  padding: 10px 12px;
  text-align: left;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
  font-size: 0.8rem;
  text-transform: capitalize;
}

.data-table tbody td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-light);
  vertical-align: middle;
}

.data-table tbody tr:hover {
  background: #fafafa;
}

.data-table .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.data-table .row-num {
  width: 40px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.8rem;
}

/* ─── Progress Bar ─── */
.progress-container {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}

.progress-bar {
  position: relative;
  height: 15px;
  background: #eee;
  flex: 1;
  border: 1px solid #bebebe;
}

.progress-fill {
  height: 100%;
  transition: width 0.6s ease;
}

.progress-fill.green { background: var(--success); }
.progress-fill.red   { background: var(--warning); }
.progress-fill.blue  { background: var(--info); }

.progress-labels {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ─── Status Icons ─── */
.status-icon {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
}

.status-icon.satisfied { color: var(--success); }
.status-icon.not-satisfied { color: var(--warning); }

.status-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: #fff;
  flex-shrink: 0;
}

.status-dot.success {
  background: var(--success);
}

.status-dot.warning {
  background: #F5A623;
}

/* ─── Academic Progress List ─── */
.progress-list {
  list-style: none;
}

.progress-item {
  padding: 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background var(--transition);
}

.progress-item:hover {
  background: #fafafa;
}

.progress-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.progress-item-title {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--gu-green);
}

.progress-item-title a {
  color: var(--gu-green);
}

.progress-item.sub .progress-item-title {
  padding-left: 24px;
}

.progress-item-arrow {
  color: var(--text-muted);
  font-size: 1.2rem;
}

.progress-item .status-icon {
  margin-top: 2px;
}

.progress-item.sub .status-icon {
  padding-left: 24px;
}

.progress-item .completion-text {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

.progress-item.sub .completion-text {
  padding-left: 24px;
}

.progress-item .progress-bar-wrapper {
  margin-top: 6px;
  max-width: 200px;
  margin-left: auto;
}

.progress-item.sub .progress-bar-wrapper {
  margin-left: auto;
}

/* ─── View Grades Term List ─── */
.term-list {
  list-style: none;
}

.term-item {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background var(--transition);
}

.term-item:hover {
  background: #fafafa;
}

.term-item a {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--gu-green);
}

.term-item .career {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ─── Grade Badge ─── */
.grade-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 3px;
  font-size: 0.8rem;
  font-weight: 500;
}

.grade-badge.excellent { background: #e8f5e9; color: #2e7d32; }
.grade-badge.very-good { background: #e3f2fd; color: #1565c0; }
.grade-badge.good { background: #fff3e0; color: #e65100; }
.grade-badge.satisfactory { background: #fce4ec; color: #c62828; }
.grade-badge.pass { background: #f3e5f5; color: #6a1b9a; }
.grade-badge.fail { background: #ffebee; color: #b71c1c; }
.grade-badge.insufficient { background: #fff8e1; color: #f57f17; }

/* ─── Detail List ─── */
.detail-list {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 8px 16px;
  font-size: 0.875rem;
}

.detail-label {
  font-weight: 600;
  color: var(--text-secondary);
}

.detail-value {
  color: var(--text-primary);
}

/* ─── Tabs ─── */
.tab-bar {
  display: flex;
  border-bottom: 2px solid var(--border);
  margin-bottom: 20px;
}

.tab {
  padding: 10px 20px;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all var(--transition);
}

.tab:hover {
  color: var(--gu-green);
}

.tab.active {
  color: var(--gu-green);
  border-bottom-color: var(--gu-green);
  font-weight: 600;
}

/* ─── Info Box ─── */
.info-box {
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 0.85rem;
  margin-bottom: 16px;
}

.info-box.success { background: #e8f5e9; border-left: 3px solid var(--success); }
.info-box.warning { background: #fff3e0; border-left: 3px solid #F5A623; }
.info-box.info    { background: #e3f2fd; border-left: 3px solid var(--info); }

/* ─── Generated timestamp ─── */
.generated-at {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 16px;
  font-style: italic;
}

/* ─── Responsive ─── */
@media (max-width: 768px) {
  .sidebar {
    display: none;
  }

  .main-content {
    padding: 16px;
  }

  .data-table {
    font-size: 0.78rem;
  }

  .data-table thead th,
  .data-table tbody td {
    padding: 8px;
  }

  .detail-list {
    grid-template-columns: 1fr;
  }
}

/* ─── Scrollbar Styles ─── */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: #a1a1a1;
}

/* ─── Course Status Table ─── */
.course-status-table td:last-child {
  font-weight: 500;
}

/* ─── Print Styles ─── */
@media print {
  .header, .sidebar {
    display: none;
  }
  .layout {
    display: block;
  }
  .main-content {
    max-width: 100%;
    padding: 0;
  }
}

/* ─── PeopleSoft Fluid UI Tile Grid Layout ─── */
.nuitilegrid {
  padding: 24px;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 10px;
  max-width: 1200px;
  margin: 0 auto;
}

.nuitile {
  width: 270px;
  height: 200px;
  position: relative;
  display: inline-block;
  background: #ffffff;
  border: 1px solid #d9d9d9;
  border-radius: 2px;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
  transition: box-shadow 0.2s;
}

.nuitile:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.nuilp {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  height: 100%;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  padding: 20px 16px;
}

.nuilp:hover {
  text-decoration: none;
  color: inherit;
}

.tile-title {
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.95rem;
  font-weight: bold;
  color: #333333;
  margin-bottom: 16px;
  text-align: center;
  line-height: 1.3;
}

.tile-icon {
  width: 64px;
  height: 64px;
}

.tile-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* ─── Responsive Tile Grid ─── */
@media (max-width: 768px) {
  .nuitilegrid {
    padding: 16px;
    justify-content: center;
    gap: 10px;
  }

  .nuitile {
    width: calc(50% - 10px);
    height: 160px;
    min-width: 140px;
  }

  .tile-title {
    font-size: 0.8rem;
    margin-bottom: 10px;
  }

  .tile-icon {
    width: 48px;
    height: 48px;
  }
}

@media (max-width: 400px) {
  .nuitile {
    width: calc(50% - 8px);
    height: 150px;
  }

  .tile-title {
    font-size: 0.75rem;
  }

  .tile-icon {
    width: 40px;
    height: 40px;
  }
}

/* ─── PeopleSoft Grid/Table Padding & Formatting Overrides ─── */
.ps_grid-cell, 
.ps_grid-head th, 
.ps_grid-row td {
  padding: 12px 16px !important;
  vertical-align: middle !important;
}

.ps_box-grid-flex, .ps_grid-flex-head {
  border-collapse: separate !important;
  border-spacing: 0 !important;
  border: 1px solid var(--border) !important;
  border-radius: 4px !important;
  overflow: hidden !important;
}

.ps_grid-head-row {
  background-color: #fafafa !important;
  border-bottom: 2px solid var(--border) !important;
}

.ps_grid-row {
  border-bottom: 1px solid var(--border-light) !important;
  transition: background var(--transition);
}

.ps_grid-row:hover {
  background-color: #fcfcfc !important;
}

/* Fix for phone/mobile/desktop view list items in contact/addresses */
.ps_box-text {
  padding: 10px 14px !important;
  background-color: #fcfcfc !important;
  border: 1px solid var(--border) !important;
  border-radius: 4px !important;
  margin-bottom: 12px !important;
  display: inline-block;
  min-width: 250px;
}


