/* ==========================================================================
   RESUME STYLES & DESIGN SYSTEM
   Thristan Jericho Tolentino - Senior Infrastructure Administrator / Full Stack Developer
   ========================================================================== */

@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&display=swap');

:root {
  --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Theme Tokens: Light Mode Defaults */
  --bg-main: #f8fafc;
  --bg-surface: #ffffff;
  --bg-surface-elevated: #f1f5f9;
  --bg-surface-glass: rgba(255, 255, 255, 0.82);
  --border-color: #e2e8f0;
  --border-subtle: #f1f5f9;
  
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  
  --accent-primary: #0284c7;       /* Azure Blue */
  --accent-primary-hover: #0369a1;
  --accent-secondary: #4f46e5;     /* Tech Indigo */
  --accent-emerald: #059669;       /* Uptime & Success */
  --accent-amber: #d97706;         /* Highlights */

  --tag-bg: #e0f2fe;
  --tag-text: #0369a1;
  --tag-border: #bae6fd;

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
  --shadow-glow: 0 0 25px -5px rgba(2, 132, 199, 0.2);
}

/* Dark Mode Tokens */
html.dark {
  --bg-main: #090d16;
  --bg-surface: #111726;
  --bg-surface-elevated: #1a2236;
  --bg-surface-glass: rgba(17, 23, 38, 0.85);
  --border-color: #1e293b;
  --border-subtle: #172033;
  
  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  
  --accent-primary: #38bdf8;       /* Glowing Sky */
  --accent-primary-hover: #7dd3fc;
  --accent-secondary: #818cf8;
  --accent-emerald: #34d399;
  --accent-amber: #fbbf24;

  --tag-bg: rgba(56, 189, 248, 0.12);
  --tag-text: #7dd3fc;
  --tag-border: rgba(56, 189, 248, 0.25);

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.5), 0 2px 4px -2px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 25px -3px rgba(0, 0, 0, 0.6), 0 4px 6px -4px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 30px -5px rgba(56, 189, 248, 0.25);
}

/* Base Body & Reset */
* {
  box-sizing: border-box;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-main);
  color: var(--text-primary);
  margin: 0;
  padding: 0;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color 0.25s ease, color 0.25s ease;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-main);
}
::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--accent-primary);
}

/* Glassmorphism & Surface utilities */
.glass-panel {
  background: var(--bg-surface-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
}

.surface-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease-in-out;
}

.surface-card:hover {
  box-shadow: var(--shadow-md);
  border-color: rgba(56, 189, 248, 0.4);
}

/* Glow Badge & Gradient Text */
.gradient-text-azure {
  background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.gradient-border {
  position: relative;
}
.gradient-border::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, var(--accent-primary), transparent 60%, var(--accent-secondary));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

/* Interactive Highlight State for Filtering */
.highlight-match {
  outline: 2px solid var(--accent-primary) !important;
  background-color: rgba(56, 189, 248, 0.12) !important;
  transform: scale(1.02);
  transition: all 0.2s ease;
}

.highlight-tag {
  background-color: var(--accent-primary) !important;
  color: #ffffff !important;
  font-weight: 600 !important;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.5);
}

.dimmed {
  opacity: 0.35;
  transition: opacity 0.2s ease;
}

/* Toast Notifications */
#toast-notification {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1000;
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}

#toast-notification.show {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

/* ==========================================================================
   VIEW MODES: EXECUTIVE VS CLEAN A4 PAGINATED VIEW
   ========================================================================== */

/* Clean Paper View Mode (Desk background with distinct white A4 pages) */
body.view-paper {
  background-color: #94a3b8 !important;
  color: #0f172a !important;
}

html.dark body.view-paper {
  background-color: #0f172a !important;
}

body.view-paper .main-container {
  max-width: 100% !important;
  padding-top: 16px !important;
  padding-bottom: 40px !important;
}

/* Individual A4 Page Wrappers & Tags */
.a4-sheet-wrapper {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 0 auto;
}

.a4-sheet-tag {
  width: 210mm;
  max-width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 4px 6px 4px;
  font-size: 11px;
  font-family: var(--font-mono);
  font-weight: 700;
  color: #334155;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

html.dark .a4-sheet-tag {
  color: #94a3b8;
}

/* Standard A4 Paper Dimensions: 210mm wide x 297mm high */
.a4-sheet {
  width: 210mm;
  height: 297mm;
  min-height: 297mm;
  max-height: 297mm;
  max-width: 100%;
  background: #ffffff !important;
  color: #0f172a !important;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.22), 0 3px 10px rgba(0, 0, 0, 0.1);
  border: 1px solid #cbd5e1;
  border-radius: 2px;
  padding: 13mm 16mm 10mm 16mm;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  font-size: 9.2pt;
  line-height: 1.34;
  overflow: hidden;
}

.a4-content {
  flex: 1 1 auto;
  overflow: hidden;
}

.a4-footer {
  flex-shrink: 0;
  padding-top: 5px;
  margin-top: 6px;
  border-top: 1px solid #cbd5e1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 8pt;
  font-family: var(--font-mono);
  color: #64748b;
}

.a4-header-mini {
  padding-bottom: 4px;
  margin-bottom: 8px;
  border-bottom: 1.5px solid #0f172a;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}

.a4-section-title {
  font-size: 10.5pt;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #0f172a;
  border-bottom: 1.5px solid #0f172a;
  padding-bottom: 2px;
  margin-top: 9px;
  margin-bottom: 5px;
}

@media (max-width: 820px) {
  .a4-sheet {
    width: 100% !important;
    height: auto !important;
    min-height: auto !important;
    max-height: none !important;
    padding: 20px !important;
  }
}

/* ==========================================================================
   PRINT OPTIMIZATIONS (@media print)
   ========================================================================== */

@page {
  size: A4 portrait;
  margin: 0;
}

@media print {
  /* Hide UI elements and executive dashboard */
  .no-print,
  #nav-action-bar,
  #toast-notification,
  #executive-canvas,
  footer,
  .a4-sheet-tag {
    display: none !important;
  }

  html, body {
    background: #ffffff !important;
    color: #000000 !important;
    font-size: 9pt !important;
    line-height: 1.32 !important;
    font-family: Arial, Helvetica, sans-serif !important;
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
  }

  .main-container {
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    box-shadow: none !important;
    border: none !important;
    background: transparent !important;
  }

  #paper-canvas {
    display: block !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  .a4-sheet-wrapper {
    margin: 0 !important;
    padding: 0 !important;
    display: block !important;
  }

  /* Force exact A4 dimensions and page break per sheet */
  .a4-sheet {
    width: 210mm !important;
    height: 297mm !important;
    min-height: 297mm !important;
    max-height: 297mm !important;
    margin: 0 !important;
    padding: 12mm 15mm 10mm 15mm !important;
    box-shadow: none !important;
    border: none !important;
    border-radius: 0 !important;
    page-break-after: always !important;
    break-after: page !important;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;
  }

  .a4-sheet:last-child {
    page-break-after: auto !important;
    break-after: auto !important;
  }

  a {
    color: #000000 !important;
    text-decoration: none !important;
  }
}
