/* 
 * AlumniX — Light Signal-Green Fintech Design System
 * Modern, clean, trustworthy aesthetic with white surfaces and soft signal-green accents.
 */

:root {
  /* Color Palette */
  --bg-page: #F5FAF6;
  --surface-card: #FFFFFF;
  --border-default: #E4EEE6;
  --border-hover: #CFE6D5;
  
  --primary-green: #4CAF50;
  --primary-hover: #66BB6A;
  --primary-light-tint: rgba(76, 175, 80, 0.10);
  --primary-glow: rgba(76, 175, 80, 0.20);
  
  --logo-gradient-start: #A5D6A7;
  --logo-gradient-end: #4CAF50;
  
  --text-primary: #1A1F1C;
  --text-secondary: #6B7A70;
  --text-muted: #98A69D;
  --text-white: #FFFFFF;
  
  --alert-red: #E53935;
  --alert-red-bg: rgba(229, 57, 53, 0.10);
  
  --toggle-inactive: #C9D2CC;
  --toggle-active: #4CAF50;
  
  /* Elevation & Shadows */
  --shadow-sm: 0 2px 8px rgba(26, 31, 28, 0.04);
  --shadow-card: 0 2px 12px rgba(0, 0, 0, 0.06);
  --shadow-hover: 0 6px 20px rgba(76, 175, 80, 0.12);
  --shadow-modal: 0 16px 36px rgba(26, 31, 28, 0.16);
  
  /* Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  /* Layout */
  --sidebar-width: 240px;
  --header-height: 68px;
  --bottom-nav-height: 64px;

  /* Font Stack */
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, Helvetica, Arial, sans-serif;
  --font-mono: SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace;
}

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

html, body {
  height: 100%;
  font-family: var(--font-body);
  background-color: var(--bg-page);
  color: var(--text-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--primary-green);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--primary-hover);
}

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
}

/* Typography Helpers */
h1, h2, h3, h4, h5, h6 {
  color: var(--text-primary);
  font-weight: 700;
  line-height: 1.25;
}

h1 { font-size: 2.25rem; }
h2 { font-size: 1.75rem; }
h3 { font-size: 1.25rem; }

.highlight-green {
  color: var(--primary-green);
}

.text-muted {
  color: var(--text-secondary);
}

.text-sm {
  font-size: 0.875rem;
}

.text-xs {
  font-size: 0.75rem;
}

.mono-tag {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

/* App Shell Layout */
.app-container {
  display: flex;
  min-height: 100vh;
  width: 100%;
}

.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  margin-left: var(--sidebar-width);
  padding-bottom: calc(var(--bottom-nav-height) + 20px);
  transition: margin-left 0.3s ease;
}

@media (max-width: 768px) {
  .main-content {
    margin-left: 0;
    padding-bottom: calc(var(--bottom-nav-height) + env(safe-area-inset-bottom) + 20px);
    overflow-x: hidden;
  }
}

.page-wrapper {
  padding: 24px 32px;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

@media (max-width: 768px) {
  .page-wrapper {
    padding: 16px;
  }
}

/* Brand & Logo */
.logo-wrapper {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.35rem;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  user-select: none;
}

.logo-emblem {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--logo-gradient-start), var(--logo-gradient-end));
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(76, 175, 80, 0.25);
  color: white;
  font-size: 16px;
}

.logo-text-dark {
  color: var(--text-primary);
}

.logo-text-x {
  color: var(--primary-green);
}

/* Header Bar */
.top-header {
  height: var(--header-height);
  background-color: var(--surface-card);
  border-bottom: 1px solid var(--border-default);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  position: sticky;
  top: 0;
  z-index: 40;
}

@media (max-width: 768px) {
  .top-header {
    padding: 0 16px;
  }
}

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

.user-avatar-initial {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background-color: var(--primary-light-tint);
  color: var(--primary-green);
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-hover);
}

/* Sidebar Shell */
.sidebar {
  width: var(--sidebar-width);
  background-color: var(--surface-card);
  border-right: 1px solid var(--border-default);
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
  padding: 20px 16px;
  transition: transform 0.3s ease;
}

.sidebar-header {
  padding-bottom: 24px;
  padding-left: 8px;
}

.nav-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.nav-item a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.95rem;
  transition: all 0.2s ease;
  position: relative;
}

.nav-item a:hover {
  background-color: var(--bg-page);
  color: var(--text-primary);
}

.nav-item.active a {
  background-color: var(--primary-light-tint);
  color: var(--primary-green);
  font-weight: 600;
}

.nav-item.active a::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 4px;
  border-radius: 0 4px 4px 0;
  background-color: var(--primary-green);
}

.nav-icon {
  font-size: 1.1rem;
  width: 20px;
  text-align: center;
}

.sidebar-footer {
  padding-top: 16px;
  border-top: 1px solid var(--border-default);
}

/* Mobile Navigation */
.mobile-hamburger {
  display: none;
  background: none;
  border: none;
  font-size: 1.4rem;
  color: var(--text-primary);
  cursor: pointer;
  padding: 4px;
}

.bottom-tab-bar {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: calc(var(--bottom-nav-height) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background-color: var(--surface-card);
  border-top: 1px solid var(--border-default);
  z-index: 45;
  justify-content: space-around;
  align-items: center;
  box-shadow: 0 -2px 10px rgba(0,0,0,0.04);
}

.bottom-tab-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  font-size: 0.7rem;
  gap: 2px;
  padding: 6px;
  width: 20%;
  height: 100%;
  min-height: 44px;
  min-width: 44px;
  text-align: center;
}

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

.bottom-tab-item .icon {
  font-size: 1.25rem;
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: var(--shadow-modal);
  }
  .mobile-hamburger {
    display: none; /* Hide hamburger as we use bottom tabs on mobile */
  }
  .bottom-tab-bar {
    display: flex;
  }
  
  /* Collapse grids to 1 column */
  .page-wrapper > div[style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
  }
  #dashboard-stats-grid, #dashboard-body-grid, #alumni-cards-grid, #jobs-grid-container {
    grid-template-columns: 1fr !important;
  }
  
  /* Touch target size for buttons */
  .btn, .form-control {
    min-height: 44px;
  }
}

/* Cards & Components */
.card {
  background-color: var(--surface-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  border: 1px solid var(--border-default);
  padding: 24px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card-hover:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
  border-color: var(--border-hover);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-primary {
  background-color: var(--primary-green);
  color: var(--text-white);
  box-shadow: 0 2px 8px rgba(76, 175, 80, 0.25);
}

.btn-primary:hover {
  background-color: var(--primary-hover);
  color: var(--text-white);
}

.btn-secondary {
  background-color: var(--surface-card);
  color: var(--text-primary);
  border: 1px solid var(--border-hover);
}

.btn-secondary:hover {
  background-color: var(--bg-page);
  border-color: var(--primary-green);
}

.btn-sm {
  padding: 6px 14px;
  font-size: 0.85rem;
  border-radius: var(--radius-sm);
}

.btn-lg {
  padding: 14px 28px;
  font-size: 1.05rem;
  border-radius: var(--radius-lg);
}

.btn-block {
  width: 100%;
}

/* Inputs & Form Control */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 18px;
}

.form-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
}

.form-control {
  padding: 12px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-default);
  background-color: #FAFCFA;
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-control:focus {
  border-color: var(--primary-green);
  box-shadow: 0 0 0 3px var(--primary-light-tint);
  background-color: #FFFFFF;
}

textarea.form-control {
  resize: vertical;
  min-height: 100px;
}

/* Pills & Badges */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.4;
}

.pill-green {
  background-color: var(--primary-light-tint);
  color: var(--primary-green);
  border: 1px solid rgba(76, 175, 80, 0.3);
}

.pill-neutral {
  background-color: #EFEFEF;
  color: var(--text-secondary);
}

.pill-alert {
  background-color: var(--alert-red-bg);
  color: var(--alert-red);
  border: 1px solid rgba(229, 57, 53, 0.3);
}

/* Segmented Toggle (Role Selector) */
.segmented-toggle {
  display: flex;
  background-color: #EAEFEA;
  padding: 4px;
  border-radius: var(--radius-lg);
  margin-bottom: 24px;
  width: 100%;
}

.segmented-toggle-btn {
  flex: 1;
  padding: 10px 16px;
  border: none;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--text-secondary);
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.segmented-toggle-btn.active {
  background-color: var(--surface-card);
  color: var(--primary-green);
  box-shadow: var(--shadow-sm);
}

/* Stat Card */
.stat-card {
  background: var(--surface-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-card);
}

.stat-value {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.1;
  margin-top: 4px;
}

.stat-label {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-secondary);
  letter-spacing: 0.04em;
}

.stat-icon-chip {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background-color: var(--primary-light-tint);
  color: var(--primary-green);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
}

/* Modal Overlay */
.modal-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(26, 31, 28, 0.5);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 16px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.modal-overlay.open {
  opacity: 1;
  visibility: visible;
}

.modal-card {
  background-color: var(--surface-card);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-modal);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 28px;
  position: relative;
  transform: scale(0.95);
  transition: transform 0.2s ease;
}

.modal-overlay.open .modal-card {
  transform: scale(1);
}

.modal-close-btn {
  position: absolute;
  top: 20px;
  right: 20px;
  background: none;
  border: none;
  font-size: 1.25rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 50%;
  transition: color 0.2s;
}

.modal-close-btn:hover {
  color: var(--text-primary);
}

/* Banner Alerts */
.alert-box {
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.alert-error {
  background-color: var(--alert-red-bg);
  color: var(--alert-red);
  border: 1px solid rgba(229, 57, 53, 0.25);
}

.alert-success {
  background-color: var(--primary-light-tint);
  color: var(--primary-green);
  border: 1px solid rgba(76, 175, 80, 0.25);
}

/* AI Assistant Character Avatar */
.ai-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #A5D6A7, #4CAF50);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  box-shadow: 0 2px 6px rgba(76, 175, 80, 0.3);
}

/* Progress bar */
.progress-bar-bg {
  width: 100%;
  height: 8px;
  background-color: var(--border-default);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background-color: var(--primary-green);
  border-radius: var(--radius-full);
  transition: width 0.4s ease;
}

/* Loading Animations */
@keyframes pulse-light {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.animate-pulse {
  animation: pulse-light 1.5s infinite ease-in-out;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.spinner {
  width: 24px;
  height: 24px;
  border: 3px solid var(--primary-light-tint);
  border-top-color: var(--primary-green);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: inline-block;
}
