/* ====================================================
   Mechanical Engineering Career OS - Global Bento Grid CSS Styling
   Aesthetic: Premium Bento Grid Dark Theme with Ambient Glow
   ==================================================== */

:root {
  /* Bento Grid Dark Theme Palette (Default) */
  --bg-base: #0a0a0c;
  --bg-surface-1: #16161a;
  --bg-surface-2: #1c1c21;
  --bg-surface-3: #26262e;
  --bg-glass: rgba(22, 22, 26, 0.82);
  --bg-card-gradient: linear-gradient(180deg, rgba(255, 255, 255, 0.03) 0%, rgba(255, 255, 255, 0) 100%), #16161a;

  --border-color: rgba(255, 255, 255, 0.08);
  --border-color-subtle: rgba(255, 255, 255, 0.05);
  --border-highlight: rgba(99, 102, 241, 0.4);
  --border-glow: rgba(59, 130, 246, 0.5);

  --text-main: #f4f4f5;
  --text-subtle: #a1a1aa;
  --text-muted: #71717a;

  --accent-primary: #3b82f6;
  --accent-primary-hover: #2563eb;
  --accent-secondary: #8b5cf6;
  --accent-success: #10b981;
  --accent-warning: #f59e0b;
  --accent-danger: #ef4444;
  --accent-info: #06b6d4;

  --shadow-card: 0 10px 30px -10px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.05);
  --shadow-bento: 0 20px 40px -15px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.1);
  --shadow-glow: 0 0 20px rgba(59, 130, 246, 0.25);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-2xl: 24px;
  --radius-pill: 9999px;

  --font-family: 'Plus Jakarta Sans', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

[data-theme="light"] {
  --bg-base: #f4f4f7;
  --bg-surface-1: #ffffff;
  --bg-surface-2: #f1f3f9;
  --bg-surface-3: #e2e8f0;
  --bg-glass: rgba(255, 255, 255, 0.88);
  --bg-card-gradient: linear-gradient(180deg, rgba(255, 255, 255, 1) 0%, rgba(248, 250, 252, 1) 100%);

  --border-color: rgba(0, 0, 0, 0.08);
  --border-color-subtle: rgba(0, 0, 0, 0.04);
  --border-highlight: rgba(59, 130, 246, 0.4);
  --border-glow: rgba(59, 130, 246, 0.3);

  --text-main: #09090b;
  --text-subtle: #52525b;
  --text-muted: #a1a1aa;

  --shadow-card: 0 4px 20px 0 rgba(0, 0, 0, 0.05), 0 0 0 1px rgba(0, 0, 0, 0.05);
  --shadow-bento: 0 10px 25px -5px rgba(0, 0, 0, 0.08), 0 0 0 1px rgba(0, 0, 0, 0.06);
}

/* RESET & BASE */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-base);
  color: var(--text-main);
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--accent-primary);
  text-decoration: none;
}

/* APP LAYOUT */
#app-layout {
  display: flex;
  min-height: 100vh;
}

/* SIDEBAR NAVIGATION */
#sidebar {
  width: 280px;
  background-color: var(--bg-surface-1);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 100;
  backdrop-filter: blur(16px);
}

.sidebar-header {
  padding: 24px 20px;
  border-bottom: 1px solid var(--border-color);
}

.brand-title {
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  background: linear-gradient(135deg, #ffffff 20%, var(--accent-primary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-tagline {
  font-size: 0.75rem;
  color: var(--text-subtle);
  margin-top: 4px;
}

.nav-group {
  padding: 16px 12px;
  flex: 1;
  overflow-y: auto;
}

.nav-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  padding: 10px 12px 6px;
  margin-top: 10px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-subtle);
  border-radius: var(--radius-md);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  margin-bottom: 3px;
}

.nav-link:hover {
  background-color: var(--bg-surface-2);
  color: var(--text-main);
  transform: translateX(2px);
}

.nav-link.active {
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-primary-hover));
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 4px 16px rgba(59, 130, 246, 0.35);
}

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

/* MAIN CONTENT AREA */
#main-content {
  margin-left: 280px;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* TOP HEADER BAR */
#top-header {
  height: 72px;
  background-color: var(--bg-glass);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  position: sticky;
  top: 0;
  z-index: 90;
}

.search-box {
  position: relative;
  width: 380px;
}

.search-input {
  width: 100%;
  padding: 10px 16px 10px 42px;
  background-color: var(--bg-surface-2);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-pill);
  color: var(--text-main);
  font-size: 0.88rem;
  outline: none;
  transition: all 0.2s ease;
}

.search-input:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
  background-color: var(--bg-surface-1);
}

.search-icon-fixed {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

/* VIEW CONTAINER */
.view-container {
  padding: 32px;
  max-width: 1440px;
  margin: 0 auto;
  width: 100%;
}

/* BENTO GRID & CARDS */
.card, .bento-card {
  background: var(--bg-card-gradient);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-card);
  padding: 24px;
  position: relative;
  overflow: hidden;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.25s ease, box-shadow 0.25s ease;
}

.card::before, .bento-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.12), transparent);
  pointer-events: none;
}

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

.card-title {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--text-main);
}

.section-title {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.025em;
}

.section-desc {
  font-size: 0.92rem;
  color: var(--text-subtle);
  line-height: 1.5;
}

/* GRID SYSTEM & BENTO SPANS */
.grid, .bento-grid {
  display: grid;
  gap: 20px;
}

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.col-span-1 { grid-column: span 1; }
.col-span-2 { grid-column: span 2; }
.col-span-3 { grid-column: span 3; }
.col-span-4 { grid-column: span 4; }
.row-span-2 { grid-row: span 2; }

/* STAT CARDS - BENTO TILES */
.stat-card {
  background: var(--bg-card-gradient);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

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

.stat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.stat-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-subtle);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.stat-value {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-main);
}

/* HERO BANNER - BENTO HERO TILE */
.hero-banner {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.12) 0%, rgba(139, 92, 246, 0.08) 50%, rgba(16, 185, 129, 0.05) 100%), var(--bg-surface-1);
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: var(--radius-xl);
  padding: 32px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 20px 40px -15px rgba(59, 130, 246, 0.15), 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.hero-banner::after {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.18) 0%, transparent 70%);
  pointer-events: none;
}

.hero-title {
  font-size: 1.85rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  color: var(--text-main);
}

.hero-desc {
  font-size: 0.98rem;
  color: var(--text-subtle);
  margin-top: 6px;
  max-width: 680px;
}

/* BUTTONS */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  font-size: 0.88rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-primary-hover));
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(59, 130, 246, 0.35);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--accent-primary-hover), #1d4ed8);
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.45);
  transform: translateY(-1px);
}

.btn-secondary {
  background-color: var(--bg-surface-2);
  color: var(--text-main);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background-color: var(--bg-surface-3);
  border-color: var(--border-highlight);
}

.btn-danger {
  background-color: var(--accent-danger);
  color: #ffffff;
}

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

.btn-icon {
  background: none;
  border: none;
  color: var(--text-subtle);
  cursor: pointer;
  padding: 8px;
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
}

.btn-icon:hover {
  color: var(--text-main);
  background-color: var(--bg-surface-2);
}

/* BADGES - BENTO TAGS */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: var(--radius-pill);
  letter-spacing: 0.01em;
}

.badge-primary { background: rgba(59, 130, 246, 0.12); color: #60a5fa; border: 1px solid rgba(59, 130, 246, 0.25); }
.badge-success { background: rgba(16, 185, 129, 0.12); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.25); }
.badge-warning { background: rgba(245, 158, 11, 0.12); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.25); }
.badge-danger { background: rgba(239, 68, 68, 0.12); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.25); }
.badge-info { background: rgba(6, 182, 212, 0.12); color: #38bdf8; border: 1px solid rgba(6, 182, 212, 0.25); }
.badge-outline { background: rgba(255, 255, 255, 0.03); border: 1px solid var(--border-color); color: var(--text-subtle); }
.badge-high { background: rgba(239, 68, 68, 0.18); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.3); }
.badge-med { background: rgba(245, 158, 11, 0.18); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.3); }

/* PROGRESS BAR */
.progress-bar-bg {
  width: 100%;
  height: 8px;
  background-color: var(--bg-surface-2);
  border-radius: var(--radius-pill);
  overflow: hidden;
  border: 1px solid var(--border-color-subtle);
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-primary), #60a5fa);
  border-radius: var(--radius-pill);
  transition: width 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.bg-success { background: linear-gradient(90deg, #10b981, #34d399) !important; }
.bg-warning { background: linear-gradient(90deg, #f59e0b, #fbbf24) !important; }
.bg-danger { background: linear-gradient(90deg, #ef4444, #f87171) !important; }
.bg-info { background: linear-gradient(90deg, #06b6d4, #38bdf8) !important; }

/* GAUGE SVG */
.gauge-container {
  position: relative;
  width: 160px;
  height: 160px;
}

.gauge-bg {
  fill: none;
  stroke: var(--bg-surface-2);
  stroke-width: 12;
}

.gauge-fill {
  fill: none;
  stroke: var(--accent-primary);
  stroke-width: 12;
  stroke-dasharray: 440;
  stroke-dashoffset: 440;
  stroke-linecap: round;
  transform: rotate(-90deg);
  transform-origin: 50% 50%;
  transition: stroke-dashoffset 0.8s ease;
}

.gauge-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
}

.gauge-num {
  display: block;
  font-size: 1.85rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.gauge-label {
  font-size: 0.75rem;
  color: var(--text-subtle);
}

/* TASK LIST */
.task-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background-color: var(--bg-surface-2);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  margin-bottom: 8px;
  transition: all 0.2s ease;
}

.task-item:hover {
  border-color: var(--border-highlight);
}

.task-item.completed .task-text {
  text-decoration: line-through;
  color: var(--text-muted);
}

.task-text {
  font-size: 0.88rem;
  cursor: pointer;
}

/* FORMS & INPUTS */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

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

.form-input, .form-select {
  padding: 10px 14px;
  background-color: var(--bg-surface-2);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-size: 0.88rem;
  outline: none;
  width: 100%;
  transition: all 0.2s ease;
}

.form-input:focus, .form-select:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
  background-color: var(--bg-surface-1);
}

/* TABLES */
.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.88rem;
}

.table th {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-subtle);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
}

.table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-color);
}

/* MODAL & OVERLAYS */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-container {
  background: var(--bg-surface-1);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 580px;
  padding: 28px;
  box-shadow: var(--shadow-bento);
}

.search-results-overlay {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 8px;
  background-color: var(--bg-surface-1);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-bento);
  max-height: 400px;
  overflow-y: auto;
  z-index: 150;
}

/* TOASTS */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  padding: 12px 20px;
  background-color: var(--bg-surface-2);
  border-left: 4px solid var(--accent-primary);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-size: 0.88rem;
  box-shadow: var(--shadow-card);
}

.toast-success { border-left-color: var(--accent-success); }
.toast-danger { border-left-color: var(--accent-danger); }

/* HELPER UTILITIES */
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-align { display: flex; align-items: center; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-column { display: flex; flex-direction: column; }
.flex-end { display: flex; justify-content: flex-end; }

.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.gap-20 { gap: 20px; }

.mb-4 { margin-bottom: 4px; }
.mb-6 { margin-bottom: 6px; }
.mb-8 { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.mb-20 { margin-bottom: 20px; }
.mb-24 { margin-bottom: 24px; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }

.p-12 { padding: 12px; }
.p-16 { padding: 16px; }
.p-20 { padding: 20px; }
.p-24 { padding: 24px; }

.hidden { display: none !important; }
.cursor-pointer { cursor: pointer; }
.text-subtle { color: var(--text-subtle); }
.text-primary { color: var(--accent-primary); }
.text-success { color: var(--accent-success); }
.text-warning { color: var(--accent-warning); }
.text-danger { color: var(--accent-danger); }
.text-info { color: var(--accent-info); }
.font-bold { font-weight: 700; }
.text-xs { font-size: 0.75rem; }
.text-sm { font-size: 0.85rem; }
.text-md { font-size: 1rem; }
.text-2xl { font-size: 1.5rem; }
.text-truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.list-bullet { padding-left: 18px; }
.list-number { padding-left: 18px; }
.list-bullet li, .list-number li { margin-bottom: 4px; }

.hover-bg:hover { background-color: var(--bg-surface-2); }
