/* ==========================================================================
   MOBILE CALL LOG MANAGEMENT SYSTEM - 4TH YEAR FINAL GRADE DESIGN SYSTEM
   Authors: Krishna Rustagi, Samaksh Raj, Rimesh Raj, Aditya Raj
   Institution: DIT University | CSN102 Data Structure Project
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600;700&display=swap');

:root {
  --bg-deep: #06080e;
  --bg-surface: #0b0f19;
  --bg-card: rgba(15, 22, 38, 0.78);
  --bg-card-hover: rgba(22, 32, 54, 0.9);
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-active: rgba(56, 189, 248, 0.45);
  
  --primary: #0284c7;
  --primary-light: #38bdf8;
  --primary-glow: rgba(56, 189, 248, 0.3);
  
  --accent-green: #10b981;
  --accent-green-glow: rgba(16, 185, 129, 0.25);
  --accent-red: #ef4444;
  --accent-red-glow: rgba(239, 68, 68, 0.25);
  --accent-amber: #f59e0b;
  --accent-purple: #8b5cf6;
  --accent-cyan: #06b6d4;
  
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  
  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 38px;
  
  --font-main: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  
  --shadow-phone: 0 25px 60px -15px rgba(0, 0, 0, 0.9), 0 0 0 2px rgba(255, 255, 255, 0.08);
  --shadow-card: 0 10px 30px -5px rgba(0, 0, 0, 0.5);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-deep);
  color: var(--text-main);
  min-height: 100vh;
  overflow-x: hidden;
  background-image: 
    radial-gradient(circle at 10% 15%, rgba(14, 165, 233, 0.15) 0%, transparent 45%),
    radial-gradient(circle at 90% 85%, rgba(139, 92, 246, 0.12) 0%, transparent 45%),
    radial-gradient(circle at 50% 50%, rgba(16, 185, 129, 0.06) 0%, transparent 60%);
  background-attachment: fixed;
  padding-bottom: 70px; /* Space for mobile nav */
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.16);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* Glassmorphism Classes */
.glass {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-subtle);
}

/* ==========================================================================
   TOP HEADER & ACADEMIC DOSSIER BAR
   ========================================================================== */
.top-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(6, 8, 14, 0.9);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  border-bottom: 1px solid var(--border-subtle);
  padding: 10px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
}

.dit-badge {
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  color: #fff;
  font-weight: 800;
  font-size: 12px;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  letter-spacing: 0.5px;
  box-shadow: 0 4px 15px rgba(2, 132, 199, 0.4);
  display: flex;
  align-items: center;
  gap: 6px;
}

.dit-badge svg {
  width: 15px;
  height: 15px;
}

.title-group h1 {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.title-group p {
  font-size: 11.5px;
  color: var(--text-muted);
}

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

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-family: var(--font-main);
  font-size: 12.5px;
  font-weight: 600;
  padding: 7px 13px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
}

.btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn-primary {
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  border-color: #38bdf8;
  color: #fff;
  box-shadow: 0 4px 15px rgba(2, 132, 199, 0.35);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #0369a1 0%, #0284c7 100%);
  box-shadow: 0 6px 20px rgba(56, 189, 248, 0.5);
}

.btn-viva {
  background: linear-gradient(135deg, #8b5cf6 0%, #6d28d9 100%);
  border-color: #a78bfa;
  color: #fff;
  box-shadow: 0 4px 15px rgba(139, 92, 246, 0.35);
  animation: pulse-viva 2.5s infinite;
}

@keyframes pulse-viva {
  0%, 100% { box-shadow: 0 0 0 0 rgba(139, 92, 246, 0.4); }
  50% { box-shadow: 0 0 0 6px rgba(139, 92, 246, 0); }
}

.btn-success {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.4);
  color: #34d399;
}
.btn-success:hover {
  background: rgba(16, 185, 129, 0.25);
  box-shadow: 0 0 15px var(--accent-green-glow);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.4);
  color: #f87171;
}
.btn-danger:hover {
  background: rgba(239, 68, 68, 0.25);
  box-shadow: 0 0 15px var(--accent-red-glow);
}

.btn-amber {
  background: rgba(245, 158, 11, 0.15);
  border-color: rgba(245, 158, 11, 0.4);
  color: #fbbf24;
}

.btn-sm {
  font-size: 11px;
  padding: 5px 9px;
  border-radius: var(--radius-xs);
}

/* Secondary Meta Bar */
.meta-bar {
  background: rgba(11, 15, 25, 0.85);
  border-bottom: 1px solid var(--border-subtle);
  padding: 8px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 11.5px;
  flex-wrap: wrap;
}

.team-chips {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.team-label {
  color: var(--text-dim);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 10.5px;
  letter-spacing: 0.5px;
}

.member-chip {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  padding: 3px 8px;
  border-radius: 20px;
  color: #cbd5e1;
  font-size: 11px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.member-chip.lead {
  border-color: rgba(56, 189, 248, 0.4);
  background: rgba(56, 189, 248, 0.1);
  color: #38bdf8;
  font-weight: 700;
}

.stack-live-hud {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 11px;
}

.hud-stat {
  display: flex;
  align-items: center;
  gap: 5px;
}

.hud-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-green);
  box-shadow: 0 0 8px var(--accent-green);
  animation: pulse-slow 2s infinite;
}

.hud-dot.full {
  background: var(--accent-red);
  box-shadow: 0 0 8px var(--accent-red);
}

@keyframes pulse-slow {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

/* ==========================================================================
   VIEW SWITCHER / MAIN NAVIGATION PILLS
   ========================================================================== */
.main-view-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 20px 0;
  max-width: 1480px;
  margin: 0 auto;
}

.view-pill-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: 30px;
  padding: 8px 18px;
  color: var(--text-muted);
  font-family: var(--font-main);
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.view-pill-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.view-pill-btn.active {
  background: linear-gradient(135deg, rgba(2, 132, 199, 0.3) 0%, rgba(56, 189, 248, 0.15) 100%);
  border-color: #38bdf8;
  color: #fff;
  box-shadow: 0 0 20px rgba(56, 189, 248, 0.3);
}

/* ==========================================================================
   APP WORKSPACE CONTAINER (DESKTOP & MOBILE MODES)
   ========================================================================== */
.app-container {
  max-width: 1480px;
  margin: 0 auto;
  padding: 20px;
  display: grid;
  grid-template-columns: 410px 1fr;
  gap: 24px;
  align-items: start;
}

/* Standalone View containers for full-width views */
.standalone-view {
  max-width: 1480px;
  margin: 0 auto;
  padding: 20px;
  display: none;
}

.standalone-view.active {
  display: block;
}

/* ==========================================================================
   LEFT COLUMN: FLAGSHIP SMARTPHONE COMPONENT
   ========================================================================== */
.phone-wrapper {
  position: sticky;
  top: 90px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.smartphone-frame {
  width: 380px;
  height: 730px;
  background: #0f141f;
  border-radius: 48px;
  box-shadow: var(--shadow-phone);
  border: 4px solid #252f44;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  user-select: none;
}

.smartphone-frame::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: 44px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  pointer-events: none;
  z-index: 50;
}

/* Phone Status Bar */
.phone-status-bar {
  height: 42px;
  padding: 0 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #fff;
  font-size: 12.5px;
  font-weight: 600;
  position: relative;
  z-index: 40;
  background: rgba(0, 0, 0, 0.5);
}

.dynamic-island {
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: 110px;
  height: 24px;
  background: #000;
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.5);
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.dynamic-island.calling {
  width: 190px;
  background: #064e3b;
  border: 1px solid #10b981;
}

.camera-dot {
  width: 9px;
  height: 9px;
  background: #0f172a;
  border-radius: 50%;
  border: 1px solid #1e293b;
}

.sensor-dot {
  width: 6px;
  height: 6px;
  background: #111;
  border-radius: 50%;
}

.status-icons {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
}

.phone-screen {
  flex: 1;
  background: #000;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

/* Phone Header */
.phone-app-header {
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.phone-app-title {
  font-size: 17px;
  font-weight: 700;
  color: #fff;
}

.phone-view-tabs {
  display: flex;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  padding: 2px;
  gap: 2px;
}

.phone-tab-btn {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.2s;
}

.phone-tab-btn.active {
  background: #fff;
  color: #000;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* Search Bar in Phone */
.phone-search-row {
  padding: 8px 14px;
  background: rgba(0, 0, 0, 0.6);
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  position: relative;
}

.phone-search-input {
  width: 100%;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 6px 10px 6px 30px;
  color: #fff;
  font-size: 11.5px;
  outline: none;
}

.phone-search-input:focus {
  border-color: #38bdf8;
  background: rgba(255, 255, 255, 0.1);
}

.search-icon-inside {
  position: absolute;
  left: 22px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
  pointer-events: none;
}

/* Recents Tab Body */
.phone-tab-content {
  flex: 1;
  overflow-y: auto;
  display: none;
  flex-direction: column;
}

.phone-tab-content.active {
  display: flex;
}

.recents-filter-bar {
  display: flex;
  padding: 6px 14px;
  gap: 5px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  background: rgba(0, 0, 0, 0.4);
  overflow-x: auto;
}

.filter-pill {
  border: none;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-dim);
  font-size: 10.5px;
  font-weight: 500;
  padding: 3px 9px;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.filter-pill.active {
  background: rgba(56, 189, 248, 0.2);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.stack-top-badge {
  background: linear-gradient(90deg, rgba(2, 132, 199, 0.25), rgba(16, 185, 129, 0.15));
  border-bottom: 1px solid rgba(56, 189, 248, 0.25);
  padding: 6px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 10px;
  color: #38bdf8;
  font-family: var(--font-mono);
}

.call-list {
  flex: 1;
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.call-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.call-item:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.1);
  transform: translateX(2px);
}

.call-item.is-top {
  border-color: rgba(56, 189, 248, 0.55);
  background: linear-gradient(90deg, rgba(56, 189, 248, 0.12), rgba(2, 132, 199, 0.05));
  box-shadow: 0 0 16px rgba(56, 189, 248, 0.2);
}

.call-item.is-top::before {
  content: 'TOP ➔ s->top';
  position: absolute;
  top: 2px;
  right: 6px;
  font-family: var(--font-mono);
  font-size: 8px;
  color: #38bdf8;
  letter-spacing: 0.5px;
  font-weight: 800;
}

.call-item.highlight-peek {
  animation: peek-glow 1.8s ease-in-out;
}

@keyframes peek-glow {
  0% { transform: scale(1); box-shadow: 0 0 0 rgba(56, 189, 248, 0); }
  50% { transform: scale(1.03); box-shadow: 0 0 25px rgba(56, 189, 248, 0.85); border-color: #38bdf8; }
  100% { transform: scale(1); box-shadow: 0 0 0 rgba(56, 189, 248, 0); }
}

.call-left {
  display: flex;
  align-items: center;
  gap: 9px;
}

.avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #1e293b;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 12px;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.call-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.call-number {
  font-size: 13px;
  font-weight: 600;
  color: #fff;
}

.call-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10.5px;
  color: var(--text-muted);
}

.badge-type {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
}

.badge-type.incoming { background: rgba(16, 185, 129, 0.18); color: #34d399; }
.badge-type.outgoing { background: rgba(56, 189, 248, 0.18); color: #38bdf8; }
.badge-type.missed   { background: rgba(239, 68, 68, 0.18); color: #f87171; }

.call-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
}

.call-time {
  font-size: 9.5px;
  color: var(--text-dim);
  font-family: var(--font-mono);
}

.call-duration {
  font-size: 10px;
  color: #94a3b8;
  font-family: var(--font-mono);
}

/* Keypad Tab */
.keypad-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 14px 22px 18px;
}

.dial-display {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 70px;
  position: relative;
}

.dial-number {
  font-size: 28px;
  font-weight: 600;
  color: #fff;
  letter-spacing: 1px;
  min-height: 38px;
  word-break: break-all;
  text-align: center;
  max-width: 270px;
}

.dial-actions-row {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
}

.btn-backspace {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px;
  border-radius: 50%;
  transition: all 0.2s;
}
.btn-backspace:hover { color: #fff; }

.keypad-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  justify-items: center;
  margin-bottom: 10px;
}

.key-btn {
  width: 65px;
  height: 65px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: none;
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

.key-btn:hover { background: rgba(255, 255, 255, 0.16); transform: scale(1.05); }
.key-btn:active { background: rgba(255, 255, 255, 0.3); transform: scale(0.95); }

.key-num { font-size: 24px; font-weight: 500; line-height: 1; }
.key-sub { font-size: 8.5px; font-weight: 700; letter-spacing: 1.5px; color: var(--text-muted); margin-top: 2px; }

.call-action-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

.btn-call-trigger {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  border: none;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 8px 25px rgba(16, 185, 129, 0.45);
  transition: all 0.2s;
}

.btn-call-trigger:hover { transform: scale(1.08); box-shadow: 0 10px 30px rgba(16, 185, 129, 0.65); }

/* Active Call Overlay */
.active-call-overlay {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: radial-gradient(circle at top, #0d382e 0%, #03120f 85%);
  z-index: 60;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 55px 22px 35px;
  animation: slide-up 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.active-call-overlay.open { display: flex; }

.caller-avatar-lg {
  width: 75px;
  height: 75px;
  border-radius: 50%;
  background: #064e3b;
  border: 2px solid #10b981;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 26px;
  font-weight: 700;
  box-shadow: 0 0 25px rgba(16, 185, 129, 0.35);
}

.caller-name-lg { font-size: 20px; font-weight: 700; color: #fff; margin-top: 6px; }
.call-status-indicator { font-size: 12px; color: #34d399; display: flex; align-items: center; gap: 6px; }
.call-duration-timer { font-family: var(--font-mono); font-size: 18px; color: #fff; font-weight: 600; margin-top: 4px; }

.call-tools-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  width: 100%;
  max-width: 250px;
}

.call-tool-btn {
  background: rgba(255, 255, 255, 0.12);
  border: none;
  color: #fff;
  border-radius: 50%;
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-end-call {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%);
  border: none;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 8px 25px rgba(239, 68, 68, 0.5);
  transition: all 0.2s;
}

.btn-end-call:hover { transform: scale(1.08); }

/* Incoming Call Modal Banner */
.incoming-call-modal {
  position: absolute;
  top: 12px; left: 12px; right: 12px;
  background: rgba(15, 23, 42, 0.96);
  border: 1px solid rgba(56, 189, 248, 0.4);
  border-radius: var(--radius-md);
  padding: 12px;
  z-index: 70;
  display: none;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.75), 0 0 20px rgba(56, 189, 248, 0.25);
  animation: slide-down 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.incoming-call-modal.open { display: block; }

.incoming-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.btn-accept-mini {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #10b981;
  border: none;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.btn-decline-mini {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #ef4444;
  border: none;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.phone-triggers-bar {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* ==========================================================================
   RIGHT COLUMN: DATA STRUCTURE ENGINE WORKSPACE
   ========================================================================== */
.engine-workspace {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.panel-card {
  border-radius: var(--radius-lg);
  padding: 20px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

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

.panel-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
}

.panel-title svg { color: #38bdf8; }

.panel-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* Algorithm Live Step Tracer Box */
.tracer-banner {
  background: linear-gradient(90deg, rgba(2, 132, 199, 0.15) 0%, rgba(139, 92, 246, 0.12) 100%);
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.tracer-content {
  display: flex;
  align-items: center;
  gap: 10px;
}

.tracer-step-tag {
  background: #0284c7;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 6px;
  letter-spacing: 0.5px;
}

.tracer-text {
  font-family: var(--font-mono);
  font-size: 12px;
  color: #e2e8f0;
}

/* Stack Operations Hub Grid */
.stack-ops-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

.op-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.02);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  text-align: left;
}

.op-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

.op-btn.push { border-color: rgba(16, 185, 129, 0.3); }
.op-btn.push:hover { background: rgba(16, 185, 129, 0.1); box-shadow: 0 0 20px var(--accent-green-glow); }

.op-btn.pop { border-color: rgba(239, 68, 68, 0.3); }
.op-btn.pop:hover { background: rgba(239, 68, 68, 0.1); box-shadow: 0 0 20px var(--accent-red-glow); }

.op-btn.peek { border-color: rgba(56, 189, 248, 0.3); }
.op-btn.peek:hover { background: rgba(56, 189, 248, 0.1); box-shadow: 0 0 20px var(--primary-glow); }

.op-btn.traverse { border-color: rgba(139, 92, 246, 0.3); }
.op-btn.traverse:hover { background: rgba(139, 92, 246, 0.1); box-shadow: 0 0 20px rgba(139, 92, 246, 0.25); }

.op-title {
  display: flex;
  align-items: center;
  gap: 5px;
  font-weight: 700;
  font-size: 13px;
  color: #fff;
  margin-bottom: 2px;
}

.op-c-fn { font-family: var(--font-mono); font-size: 10px; color: var(--text-dim); }
.op-badge { margin-top: 6px; font-family: var(--font-mono); font-size: 9.5px; padding: 2px 6px; border-radius: 4px; background: rgba(255, 255, 255, 0.06); color: var(--text-muted); }

/* Stack Memory Architecture View */
.stack-viz-container {
  display: grid;
  grid-template-columns: 1fr 270px;
  gap: 18px;
  align-items: start;
}

@media (max-width: 900px) {
  .stack-viz-container { grid-template-columns: 1fr; }
}

.stack-memory-column {
  background: rgba(9, 13, 22, 0.75);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px;
  min-height: 380px;
  display: flex;
  flex-direction: column;
}

.stack-header-hud {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 10px;
  margin-bottom: 10px;
  border-bottom: 1px solid var(--border-subtle);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
}

.stack-items-stack {
  display: flex;
  flex-direction: column-reverse; /* calls[0] bottom, calls[top] top */
  gap: 8px;
  max-height: 480px;
  overflow-y: auto;
  padding: 4px;
}

.stack-slot {
  display: grid;
  grid-template-columns: 85px 1fr 90px;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 11.5px;
  position: relative;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.stack-slot.empty-preview { opacity: 0.35; border-style: dashed; background: transparent; }

.stack-slot.top-item {
  border-color: #38bdf8;
  background: linear-gradient(90deg, rgba(2, 132, 199, 0.22) 0%, rgba(14, 165, 233, 0.06) 100%);
  box-shadow: 0 0 20px rgba(56, 189, 248, 0.3);
}

.slot-index { color: var(--text-dim); font-size: 10.5px; display: flex; align-items: center; gap: 4px; }
.pointer-arrow { display: inline-block; color: #38bdf8; font-weight: 800; animation: bounce-right 1s infinite alternate; }

.slot-content { display: flex; flex-direction: column; gap: 2px; }
.slot-number { color: #fff; font-weight: 600; font-size: 12px; }
.slot-details { font-size: 9.5px; color: var(--text-muted); }
.slot-memory { font-size: 9.5px; color: var(--text-dim); text-align: right; }

/* Stack Telemetry Sidebar */
.stack-telemetry-col { display: flex; flex-direction: column; gap: 12px; }

.telemetry-card {
  background: rgba(9, 13, 22, 0.75);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 13px;
}

.telemetry-card h4 {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.metric-number { font-family: var(--font-mono); font-size: 22px; font-weight: 700; color: #fff; }
.metric-sub { font-size: 10.5px; color: var(--text-dim); margin-top: 2px; }

.progress-bar-bg {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  overflow: hidden;
  margin-top: 6px;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #0284c7, #38bdf8);
  border-radius: 4px;
  transition: width 0.3s ease;
}

.complexity-table { width: 100%; border-collapse: collapse; font-size: 11px; margin-top: 4px; }
.complexity-table td { padding: 4px 0; border-bottom: 1px solid rgba(255, 255, 255, 0.04); }
.complexity-table td:last-child { text-align: right; font-family: var(--font-mono); color: #38bdf8; font-weight: 600; }

/* ==========================================================================
   ANALYTICS & METRICS DASHBOARD
   ========================================================================== */
.analytics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.analytics-stat-card {
  background: rgba(15, 22, 38, 0.75);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.stat-card-title {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}

.stat-card-val {
  font-family: var(--font-mono);
  font-size: 24px;
  font-weight: 700;
  color: #fff;
}

.stat-card-desc {
  font-size: 11px;
  color: var(--text-dim);
}

/* ==========================================================================
   FACULTY / VIVA MODE PRESENTATION DOSSIER
   ========================================================================== */
.viva-card {
  background: linear-gradient(180deg, rgba(22, 19, 43, 0.8) 0%, rgba(13, 17, 30, 0.85) 100%);
  border: 1px solid rgba(139, 92, 246, 0.35);
  border-radius: var(--radius-lg);
  padding: 24px;
}

.viva-rubric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.rubric-box {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-md);
  padding: 14px 16px;
}

.rubric-box h4 {
  font-size: 13px;
  color: #a78bfa;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.rubric-box p {
  font-size: 12px;
  color: #cbd5e1;
  line-height: 1.6;
}

/* Terminal & Code Viewers */
.terminal-view {
  background: #04060a;
  border-radius: var(--radius-md);
  border: 1px solid #1e293b;
  overflow: hidden;
  font-family: var(--font-mono);
  font-size: 12px;
}

.terminal-header {
  background: #0d1322;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.term-dots { display: flex; gap: 5px; }
.term-dot { width: 9px; height: 9px; border-radius: 50%; }
.term-dot.red { background: #ef4444; }
.term-dot.yellow { background: #f59e0b; }
.term-dot.green { background: #10b981; }

.term-title { color: var(--text-muted); font-size: 10.5px; }

.terminal-body {
  padding: 14px;
  min-height: 250px;
  max-height: 350px;
  overflow-y: auto;
  color: #e2e8f0;
  line-height: 1.55;
}

.term-line { margin-bottom: 3px; word-break: break-all; }
.term-prompt { color: #38bdf8; font-weight: 600; }
.term-highlight { color: #34d399; font-weight: 600; }

.terminal-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: #090e1a;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.term-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-family: var(--font-mono);
  font-size: 12px;
  color: #fff;
}

.code-viewer-pre {
  background: #04060a;
  border: 1px solid #1e293b;
  border-radius: var(--radius-md);
  padding: 14px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: #cbd5e1;
  max-height: 420px;
  overflow-y: auto;
  line-height: 1.5;
}

/* Modals */
.modal-backdrop {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(10px);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-backdrop.open { display: flex; }

.modal-box {
  background: #0d121f;
  border: 1px solid var(--border-active);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 540px;
  box-shadow: 0 25px 60px rgba(0,0,0,0.85), 0 0 35px var(--primary-glow);
  overflow: hidden;
  animation: modal-pop 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes modal-pop {
  from { transform: scale(0.92); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h3 { font-size: 15px; color: #fff; display: flex; align-items: center; gap: 8px; }
.modal-close-btn { background: transparent; border: none; color: var(--text-muted); cursor: pointer; padding: 4px; font-size: 18px; }
.modal-close-btn:hover { color: #fff; }

.modal-body { padding: 18px 20px; display: flex; flex-direction: column; gap: 14px; }
.form-group { display: flex; flex-direction: column; gap: 5px; }
.form-label { font-size: 11.5px; font-weight: 600; color: var(--text-muted); }
.form-input, .form-select {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 9px 11px;
  color: #fff;
  font-family: var(--font-main);
  font-size: 13px;
  outline: none;
  transition: all 0.2s;
}
.form-input:focus, .form-select:focus { border-color: #38bdf8; box-shadow: 0 0 10px rgba(56, 189, 248, 0.25); }

.modal-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  background: rgba(0, 0, 0, 0.25);
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 75px;
  right: 20px;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  background: rgba(13, 18, 30, 0.95);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 16px;
  color: #fff;
  font-size: 12.5px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  gap: 8px;
  pointer-events: auto;
  animation: toast-in 0.3s ease;
  min-width: 260px;
}

.toast.success { border-color: rgba(16, 185, 129, 0.5); }
.toast.danger { border-color: rgba(239, 68, 68, 0.5); }
.toast.info { border-color: rgba(56, 189, 248, 0.5); }

/* ==========================================================================
   MOBILE BOTTOM DOCK NAVIGATION
   (Ensures Mam and mobile evaluators can easily toggle screens on any phone!)
   ========================================================================== */
.mobile-bottom-dock {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(6, 8, 14, 0.95);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  border-top: 1px solid var(--border-subtle);
  display: none;
  justify-content: space-around;
  padding: 8px 10px;
  z-index: 150;
}

.dock-btn {
  background: transparent;
  border: none;
  color: var(--text-dim);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  padding: 4px 8px;
  border-radius: 8px;
}

.dock-btn svg { width: 18px; height: 18px; }
.dock-btn.active { color: #38bdf8; background: rgba(56, 189, 248, 0.1); }

@media (max-width: 980px) {
  .app-container {
    grid-template-columns: 1fr;
  }
  .phone-wrapper {
    position: static;
    margin-bottom: 20px;
  }
  .mobile-bottom-dock {
    display: flex;
  }
}

/* Footer */
.site-footer {
  margin-top: 40px;
  border-top: 1px solid var(--border-subtle);
  padding: 20px;
  text-align: center;
  color: var(--text-dim);
  font-size: 11.5px;
}
