/* ==========================================================================
   MOSTAFA ELTAWEEL — MINIMALIST 3D AVATAR PORTFOLIO & JOB FAIR ASSISTANT
   Monochrome System: Pure #000000 (Dark) / #FFFFFF (Light)
   ========================================================================== */

:root {
  /* Dark Mode Default */
  --bg-color: #000000;
  --text-color: #FFFFFF;
  --text-muted: #888888;
  --card-bg: rgba(20, 20, 20, 0.75);
  --border-color: rgba(255, 255, 255, 0.18);
  --border-active: #FFFFFF;
  --dock-bg: rgba(12, 12, 12, 0.85);
  --bubble-bg: #FFFFFF;
  --bubble-text: #000000;
  --bubble-tail-color: #FFFFFF;
  --input-bg: rgba(18, 18, 18, 0.85);
  --chip-bg: rgba(255, 255, 255, 0.08);
  --chip-hover: rgba(255, 255, 255, 0.2);
  --logo-filter: none;
  --shadow-color: rgba(0, 0, 0, 0.6);
  --pulse-glow: 0 0 20px rgba(255, 255, 255, 0.45);

  --font-en: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-ar: 'Cairo', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --radius-full: 9999px;
  --radius-md: 14px;
  --radius-lg: 20px;
}

/* Light Mode Overrides */
[data-theme="light"] {
  --bg-color: #FFFFFF;
  --text-color: #000000;
  --text-muted: #666666;
  --card-bg: rgba(245, 245, 245, 0.85);
  --border-color: rgba(0, 0, 0, 0.15);
  --border-active: #000000;
  --dock-bg: rgba(250, 250, 250, 0.9);
  --bubble-bg: #000000;
  --bubble-text: #FFFFFF;
  --bubble-tail-color: #000000;
  --input-bg: rgba(240, 240, 240, 0.95);
  --chip-bg: rgba(0, 0, 0, 0.06);
  --chip-hover: rgba(0, 0, 0, 0.15);
  --logo-filter: invert(1);
  --shadow-color: rgba(0, 0, 0, 0.12);
  --pulse-glow: 0 0 20px rgba(0, 0, 0, 0.35);
}

/* Base Reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  height: 100%;
  width: 100%;
  overflow: hidden;
  background-color: var(--bg-color);
  color: var(--text-color);
  font-family: var(--font-en);
  line-height: 1.5;
  transition: background-color 0.3s ease, color 0.3s ease;
}

[dir="rtl"] {
  font-family: var(--font-ar);
}

/* Scenic Subtle Wallpaper Overlay */
.scenic-bg {
  position: fixed;
  inset: 0;
  background: 
    radial-gradient(circle at 15% 20%, rgba(255, 255, 255, 0.03) 0%, transparent 50%),
    radial-gradient(circle at 85% 80%, rgba(255, 255, 255, 0.02) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}

/* Main Layout: 3 Minimal Zones (Left Dock - Floating Center Bar - Right Avatar) */
.viewport-layout {
  display: flex;
  height: 100dvh;
  width: 100%;
  position: relative;
  z-index: 1;
  direction: ltr !important; /* Sidebar ALWAYS stays on the left */
}

/* ==========================================================================
   1. LEFT VERTICAL DOCK (Real Functional Icons + Logo)
   ========================================================================== */
.left-dock {
  width: 78px;
  height: 100%;
  background: var(--dock-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-right: 1px solid var(--border-color) !important;
  border-left: none !important;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 16px 8px;
  z-index: 20;
  box-shadow: 4px 0 20px var(--shadow-color);
  transition: background 0.3s ease, border-color 0.3s ease;
  direction: ltr !important;
}

/* Logo at Top */
.dock-logo-container {
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  margin-bottom: 8px;
  cursor: pointer;
  transition: transform 0.25s ease;
}

.dock-logo-container:hover {
  transform: scale(1.08);
}

.dock-logo-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: var(--logo-filter);
  transition: filter 0.3s ease;
}

/* Functional Navigation Icons */
.dock-icons-stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: center;
}

.dock-icon-btn {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  color: var(--text-color);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), border-color 0.2s ease, box-shadow 0.2s ease;
}

.dock-icon-btn svg {
  width: 22px;
  height: 22px;
  stroke-width: 2;
  transition: transform 0.2s ease;
}

.dock-icon-btn:hover {
  transform: scale(1.12);
  border-color: var(--border-active);
  box-shadow: var(--pulse-glow);
}

/* Tooltip on Hover (Desktop: Opens to right of dock) */
.dock-icon-btn[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 62px;
  background: var(--bubble-bg);
  color: var(--bubble-text);
  font-size: 0.76rem;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: var(--radius-md);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transform: translateX(-6px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  box-shadow: 0 4px 14px var(--shadow-color);
  z-index: 100;
}

.dock-icon-btn:hover[data-tooltip]::after {
  opacity: 1;
  transform: translateX(0);
}

/* Pulsing highlight effect when referred by AI */
@keyframes icon-pulse {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.8); }
  50% { transform: scale(1.18); box-shadow: 0 0 0 14px rgba(255, 255, 255, 0); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255, 255, 255, 0); }
}

.dock-icon-btn.pulse-active {
  animation: icon-pulse 1.2s infinite;
  border-color: var(--border-active);
}

/* Bottom Controls (Theme & Lang Switchers) */
.dock-controls {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
}

.control-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background: var(--chip-bg);
  border: 1px solid var(--border-color);
  color: var(--text-color);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 800;
  transition: transform 0.2s ease, background 0.2s ease;
}

.control-btn:hover {
  transform: scale(1.1);
  background: var(--chip-hover);
}

/* ==========================================================================
   2. CENTER FLOATING BAR (Simple Bar To Contact With Him)
   ========================================================================== */
.center-stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  position: relative;
  z-index: 10;
}

.contact-bar-wrapper {
  width: 100%;
  max-width: 560px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: center;
}

/* Candidate Minimal Brand Pill above Bar */
.brand-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  padding: 6px 16px;
  border-radius: var(--radius-full);
  font-size: 0.84rem;
  font-weight: 700;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 4px 16px var(--shadow-color);
}

.online-dot {
  width: 8px;
  height: 8px;
  background: #10B981;
  border-radius: var(--radius-full);
  box-shadow: 0 0 10px #10B981;
}

/* Floating Clean Prompt Bar (Inspired by User Diagram) */
.simple-prompt-bar {
  width: 100%;
  background: var(--input-bg);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-full);
  padding: 8px 10px 8px 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 12px 35px var(--shadow-color);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
}

[dir="rtl"] .simple-prompt-bar {
  padding: 8px 24px 8px 10px;
}

.simple-prompt-bar:focus-within {
  border-color: var(--border-active);
  box-shadow: 0 16px 45px var(--shadow-color), var(--pulse-glow);
  transform: translateY(-2px);
}

.prompt-icon-search {
  color: var(--text-muted);
  display: flex;
  align-items: center;
}

.simple-input-field {
  flex: 1;
  font-size: 1rem;
  color: var(--text-color);
  background: transparent;
  padding: 8px 0;
}

.simple-input-field::placeholder {
  color: var(--text-muted);
  font-size: 0.94rem;
}

.prompt-submit-btn {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  background: var(--text-color);
  color: var(--bg-color);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.2s ease;
}

.prompt-submit-btn svg {
  width: 20px;
  height: 20px;
}

[dir="rtl"] .prompt-submit-btn svg {
  transform: scaleX(-1);
}

.prompt-submit-btn:hover {
  transform: scale(1.08);
}

/* ==========================================================================
   3. 2.5D RIGGED AVATAR & SPEECH MOTION
   (Detailed Rig, States & Animations are maintained in css/avatar-motion.css)
   ========================================================================== */

/* ==========================================================================
   4. MODALS (Infographic Preview)
   ========================================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(10px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

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

.modal-card {
  background: var(--bg-color);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 900px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.7);
}

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

.modal-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-color);
}

.modal-close-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-color);
  cursor: pointer;
  background: var(--chip-bg);
}

.modal-close-btn:hover {
  background: var(--chip-hover);
}

.modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-body iframe {
  width: 100%;
  height: 72vh;
  border: none;
  border-radius: var(--radius-md);
  background: #ffffff;
}

/* Credentials Hub Styling */
.modal-credentials-card {
  max-width: 760px;
}

.credentials-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  padding: 6px;
}

.credential-item-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  text-decoration: none;
  color: var(--text-color);
  transition: all 0.2s ease;
}

.credential-item-card:hover:not([style*="cursor: default"]) {
  border-color: var(--border-active);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px var(--shadow-color);
}

.credential-item-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.credential-item-logo {
  width: 44px;
  height: 44px;
  object-fit: contain;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  padding: 4px;
  flex-shrink: 0;
}

[data-theme="light"] .credential-item-logo {
  background: rgba(0, 0, 0, 0.04);
}

.credential-item-details h4 {
  font-size: 0.94rem;
  font-weight: 700;
  margin-bottom: 3px;
  color: var(--text-color);
}

.credential-item-details p {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.credential-verify-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: var(--radius-full);
  background: var(--chip-bg);
  border: 1px solid var(--border-color);
  color: var(--text-color);
  white-space: nowrap;
  flex-shrink: 0;
}

@media (max-width: 600px) {
  .credential-item-card {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  .credential-verify-badge {
    align-self: flex-end;
  }
}


/* ==========================================================================
   5. RESPONSIVENESS (Mobile, Tablet & Desktop)
   ========================================================================== */
@media (max-width: 1024px) and (min-width: 769px) {
  .viewport-layout {
    flex-direction: column;
    min-height: 100dvh;
    height: auto;
    overflow-y: auto;
    padding-bottom: 84px;
  }

  .left-dock {
    width: 100%;
    height: 60px;
    flex-direction: row;
    padding: 8px 20px;
    border-right: none;
    border-bottom: none;
    border-top: 1px solid var(--border-color);
    position: fixed;
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1000;
  }

  .dock-icons-stack {
    flex-direction: row;
    gap: 12px;
  }

  /* Tooltip on Tablet: Sits directly ABOVE the icon */
  .dock-icon-btn[data-tooltip]::after {
    left: 50% !important;
    right: auto !important;
    bottom: calc(100% + 10px) !important;
    top: auto !important;
    transform: translateX(-50%) translateY(4px) !important;
    font-size: 0.74rem;
    padding: 5px 10px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.45);
    background: var(--bubble-bg);
    color: var(--bubble-text);
    border: 1px solid var(--border-color);
    white-space: nowrap;
    z-index: 1020;
  }

  .dock-icon-btn[data-tooltip]::before {
    content: '';
    position: absolute;
    bottom: calc(100% + 4px);
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 6px solid var(--bubble-bg);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 1021;
  }

  .dock-icon-btn:hover[data-tooltip]::after,
  .dock-icon-btn:focus[data-tooltip]::after,
  .dock-icon-btn:active[data-tooltip]::after {
    opacity: 1 !important;
    transform: translateX(-50%) translateY(0) !important;
  }

  .dock-icon-btn:hover[data-tooltip]::before,
  .dock-icon-btn:focus[data-tooltip]::before,
  .dock-icon-btn:active[data-tooltip]::before {
    opacity: 1 !important;
  }

  .dock-controls {
    flex-direction: row;
    gap: 10px;
  }

  .center-stage {
    padding: 24px 20px;
    justify-content: center;
    gap: 14px;
  }

  .avatar-stage-container {
    position: relative !important;
    right: auto !important;
    left: auto !important;
    bottom: auto !important;
    flex-direction: column !important;
    align-items: center !important;
    margin: 0 auto !important;
  }
}

@media (max-width: 768px) {
  .viewport-layout {
    min-height: 100dvh;
    height: auto;
    flex-direction: column;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 78px;
    box-sizing: border-box;
  }

  .left-dock {
    position: fixed;
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    height: 54px;
    width: 100%;
    border-bottom: none;
    border-top: 1px solid var(--border-color);
    padding: 6px 12px;
    z-index: 1000;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-around;
    background: var(--dock-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
  }

  .dock-logo-container {
    display: none;
  }

  .dock-icons-stack {
    flex-direction: row;
    gap: 8px;
  }

  .dock-controls {
    flex-direction: row;
    gap: 6px;
  }

  /* Tooltip on Mobile / Tablet: Sits directly ABOVE the icon */
  .dock-icon-btn[data-tooltip]::after {
    left: 50% !important;
    right: auto !important;
    bottom: calc(100% + 10px) !important;
    top: auto !important;
    transform: translateX(-50%) translateY(4px) !important;
    font-size: 0.74rem;
    padding: 5px 10px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.45);
    background: var(--bubble-bg);
    color: var(--bubble-text);
    border: 1px solid var(--border-color);
    white-space: nowrap;
    z-index: 1020;
  }

  .dock-icon-btn[data-tooltip]::before {
    content: '';
    position: absolute;
    bottom: calc(100% + 4px);
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 6px solid var(--bubble-bg);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 1021;
  }

  .dock-icon-btn:hover[data-tooltip]::after,
  .dock-icon-btn:focus[data-tooltip]::after,
  .dock-icon-btn:active[data-tooltip]::after {
    opacity: 1 !important;
    transform: translateX(-50%) translateY(0) !important;
  }

  .dock-icon-btn:hover[data-tooltip]::before,
  .dock-icon-btn:focus[data-tooltip]::before,
  .dock-icon-btn:active[data-tooltip]::before {
    opacity: 1 !important;
  }

  .dock-icon-btn {
    width: 40px;
    height: 40px;
  }

  .dock-icon-btn svg {
    width: 18px;
    height: 18px;
  }

  .control-btn {
    width: 36px;
    height: 36px;
    font-size: 0.74rem;
  }

  .center-stage {
    margin-top: 0;
    margin-bottom: 0;
    padding: 10px 12px 14px 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 6px;
    width: 100%;
    box-sizing: border-box;
  }

  /* Candidate Brand Pill */
  .brand-pill {
    font-size: 0.72rem;
    padding: 4px 12px;
    max-width: 96%;
    text-align: center;
    line-height: 1.35;
    margin-bottom: 2px;
  }

  /* Avatar Stage Sits Directly Above the Question Bar with ZERO gap */
  .avatar-stage-container {
    margin-bottom: 4px !important;
  }

  .contact-bar-wrapper {
    width: 100%;
    max-width: 440px;
    margin-top: 4px;
    position: relative;
    z-index: 20;
  }

  .simple-prompt-bar {
    padding: 6px 8px 6px 16px;
    background: var(--input-bg);
    box-shadow: 0 8px 24px var(--shadow-color);
  }

  [dir="rtl"] .simple-prompt-bar {
    padding: 6px 16px 6px 8px;
  }

  .simple-input-field {
    font-size: 0.9rem;
    padding: 6px 0;
  }

  .prompt-submit-btn {
    width: 38px;
    height: 38px;
  }
}
