/* ══════════════════════════════════════════════
   RAIS HELMY — Tip Slide Shared Stylesheet
   Used by all tip pages via /tips_slide/_shared/styles.css
   ══════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=DM+Mono:wght@400;500&family=DM+Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;1,400&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --red:      #dc2626;
  --red-mid:  #b91c1c;
  --red-soft: #fca5a5;
  --red-pale: #fff5f5;
  --rule:     #f0bfbf;
  --green:    #16a34a;
  --green-bg: #052e16;
  --green-lt: #86efac;
  --ink:      #0f0f0f;
  --ink-2:    #2a2a2a;
  --ink-3:    #666;
  --white:    #ffffff;

  /* ── Theme tokens (light default) ── */
  --body-bg:       #f2ede6;
  --topbar-bg:     #ffffff;
  --topbar-border: #e5e0d8;
  --topbar-title:  #dc2626;
  --btn-border:    #e0dbd2;
  --btn-color:     #555;
  --back-color:    #888;
  --pbar-bg:       #e5e0d8;
  --toast-bg:      #ffffff;
  --toast-color:   #111;
  --toast-border:  #e5e0d8;
  --dot-color:     #ccc;
  --arr-bg:        rgba(255,255,255,0.92);
  --arr-border:    #d8d3cc;
  --arr-color:     #888;
  --dl-menu-bg:    #ffffff;
  --dl-menu-border:#e5e0d8;
  --dl-btn-color:  #444;
}

body.dark {
  --body-bg:       #111;
  --topbar-bg:     #111;
  --topbar-border: #1e1e1e;
  --topbar-title:  #fca5a5;
  --btn-border:    #2a2a2a;
  --btn-color:     #888;
  --back-color:    #555;
  --pbar-bg:       #1e1e1e;
  --toast-bg:      #1a1a1a;
  --toast-color:   #ccc;
  --toast-border:  #333;
  --dot-color:     #333;
  --arr-bg:        rgba(0,0,0,0.65);
  --arr-border:    #2a2a2a;
  --arr-color:     #666;
  --dl-menu-bg:    #1a1a1a;
  --dl-menu-border:#2e2e2e;
  --dl-btn-color:  #ccc;
}

html { height: 100%; }
body {
  font-family: 'DM Sans', sans-serif;
  background: var(--body-bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  min-height: 100%;
  display: flex; flex-direction: column;
  transition: background 0.2s ease;
}

/* ── TOP BAR ── */
#topbar {
  position: fixed; top: 0; left: 0; right: 0; height: 46px;
  background: var(--topbar-bg); border-bottom: 1px solid var(--topbar-border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 14px; z-index: 500; gap: 8px;
  transition: background 0.2s ease, border-color 0.2s ease;
}
.tb-title {
  font-family: 'DM Mono', monospace; font-size: 9px;
  letter-spacing: .1em; text-transform: uppercase; color: var(--topbar-title);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1;
}
.tb-right { display: flex; gap: 6px; flex-shrink: 0; }
.tb-btn {
  font-family: 'DM Mono', monospace; font-size: 9px;
  letter-spacing: .05em; text-transform: uppercase;
  padding: 5px 11px; border-radius: 2px; cursor: pointer;
  border: 1px solid var(--btn-border); background: transparent;
  color: var(--btn-color); transition: all .15s; text-decoration: none;
  display: inline-flex; align-items: center; gap: 4px; white-space: nowrap;
}
.tb-btn:hover { border-color: var(--red); color: var(--red); }
.tb-btn.red { background: var(--red); border-color: var(--red); color: #fff; }
.tb-btn.red:hover { background: var(--red-mid); }

/* ── DOWNLOAD DROPDOWN ── */
.tb-dl-wrap { position: relative; }
.tb-dl-menu {
  display: none; position: absolute; top: calc(100% + 6px); right: 0;
  background: var(--dl-menu-bg); border: 1px solid var(--dl-menu-border); border-radius: 6px;
  padding: 5px; min-width: 175px; z-index: 600;
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}
.tb-dl-menu.open { display: flex; flex-direction: column; gap: 1px; }
.tb-dl-menu button {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px; border-radius: 4px; border: none;
  background: transparent; color: var(--dl-btn-color); cursor: pointer;
  font-family: 'DM Mono', monospace; font-size: 9px;
  letter-spacing: .04em; text-align: left; width: 100%;
  transition: background .1s, color .1s;
}
.tb-dl-menu button:hover { background: #dc2626; color: #fff; }
.tb-dl-menu button svg { flex-shrink: 0; opacity: .7; }

/* ── BACK LINK ── */
.tb-back {
  font-family: 'DM Mono', monospace; font-size: 9px;
  letter-spacing: .05em; color: var(--back-color); text-decoration: none;
  display: inline-flex; align-items: center; gap: 5px;
  transition: color .15s;
}
.tb-back:hover { color: var(--red); }

/* ── PROGRESS ── */
#pbar { position: fixed; top: 46px; left: 0; right: 0; height: 2px; background: var(--pbar-bg); z-index: 500; }
#pfill { height: 100%; background: var(--red); transition: width .35s ease; }

/* ── TOAST ── */
#toast {
  position: fixed; bottom: 60px; left: 50%;
  transform: translateX(-50%) translateY(12px);
  background: var(--toast-bg); color: var(--toast-color);
  font-family: 'DM Mono', monospace; font-size: 10px;
  padding: 8px 18px; border: 1px solid var(--toast-border); border-radius: 2px;
  opacity: 0; transition: all .3s; pointer-events: none; z-index: 999; white-space: nowrap;
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}
#toast.on { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ── MAIN ── */
#main {
  margin-top: 48px; flex: 1;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 14px 0 68px;
}

/* ── SLIDE WRAP ── */
#slide-wrap {
  width: 210mm; height: 210mm; position: relative;
}
@media (max-width: 820px) {
  #slide-wrap { width: 92vw; height: 92vw; }
}

/* ── SLIDE ── */
.slide {
  position: absolute; inset: 0;
  background: var(--white);
  box-shadow: 0 8px 60px rgba(0,0,0,.55);
  overflow: hidden;
  display: none; flex-direction: column;
}
.slide.active { display: flex; }
.slide::after {
  content: ''; position: absolute; inset: 0; pointer-events: none; z-index: 0;
  background: repeating-linear-gradient(0deg,transparent,transparent 3px,rgba(220,38,38,.007) 3px,rgba(220,38,38,.007) 6px);
}

/* ── SLIDE INNER ── */
.si {
  position: relative; z-index: 1;
  width: 100%; height: 100%;
  padding: 6.2%; display: flex; flex-direction: column;
}
.snum {
  position: absolute; top: 4.5%; right: 5%;
  font-family: 'DM Mono', monospace; font-size: clamp(7px,1.2vw,9px);
  color: var(--red-soft); letter-spacing: .08em; z-index: 10;
}

/* ── SHARED TYPOGRAPHY ── */
.label {
  font-family: 'DM Mono', monospace;
  font-size: clamp(7px,1.1vw,8.5px); letter-spacing: .16em;
  text-transform: uppercase; color: var(--red); margin-bottom: 5px;
}
.red-rule { height: 1.5px; background: var(--red); margin: 7px 0 10px; }

/* ── CODE BLOCKS ── */
.code {
  background: #0d0d0d; border-left: 3px solid var(--red);
  padding: clamp(7px,1.5vw,11px) clamp(8px,1.8vw,13px); flex: 1; overflow: hidden;
}
.code pre {
  font-family: 'DM Mono', monospace;
  font-size: clamp(7px,1.1vw,8.5px); line-height: 1.75;
  color: #e2e8f0; white-space: pre-wrap; word-break: break-word;
}
/* Syntax highlight classes */
.cr { color: #f87171; }
.cg { color: #86efac; }
.cb { color: #93c5fd; }
.cy { color: #fde68a; }
.cgr{ color: #6b7280; }
.cp { color: #c4b5fd; }
.co { color: #fdba74; }
.cw { color: #fff; }

/* ── EVR SPLIT ── */
.evr { display: grid; grid-template-columns: 1fr 1fr; flex: 1; border: 1.5px solid var(--rule); }
.evr-col { padding: clamp(7px,1.6vw,12px); display: flex; flex-direction: column; gap: 5px; }
.evr-col.left { border-right: 1.5px solid var(--rule); background: #f0fdf4; }
.evr-col.right { background: #fff8f8; }
.evr-head {
  font-family: 'DM Mono', monospace;
  font-size: clamp(7px,1.1vw,8px); letter-spacing: .1em; text-transform: uppercase;
  padding-bottom: 5px; border-bottom: 1px solid var(--rule); margin-bottom: 3px;
}
.evr-head.exp { color: var(--green); }
.evr-head.real { color: var(--red); }
.evr-item {
  font-size: clamp(7.5px,1.2vw,9px); color: var(--ink-2);
  line-height: 1.55; padding-left: 12px; position: relative;
}
.evr-item::before { position: absolute; left: 0; top: 1px; font-size: 8px; }
.evr-item.exp::before { content: '✦'; color: var(--green); }
.evr-item.real::before { content: '✗'; color: var(--red); }

/* ── INFO GRID ── */
.info-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  border: 1.5px solid var(--red); flex: 1; position: relative;
}
.ig-cell {
  padding: clamp(6px,1.4vw,10px) clamp(7px,1.5vw,12px);
  border-right: 1.5px solid var(--red); border-bottom: 1.5px solid var(--red);
}
.ig-cell:nth-child(even) { border-right: none; }
.ig-cell:nth-last-child(-n+2) { border-bottom: none; }
.ig-cell .il { font-family:'DM Mono',monospace; font-size:clamp(6.5px,1vw,8px); letter-spacing:.12em; text-transform:uppercase; color:var(--red); margin-bottom:2px; }
.ig-cell .iv { font-size:clamp(8px,1.3vw,10px); font-weight:600; color:var(--ink); line-height:1.3; }
.ig-cell .is { font-family:'DM Mono',monospace; font-size:clamp(6.5px,1vw,7.5px); color:var(--ink-3); margin-top:2px; }

/* ── SLIDE FOOTER ── */
.sf {
  margin-top: auto; padding-top: 8px; border-top: 1.5px solid var(--rule);
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 5px;
}
.sf a { font-family:'DM Mono',monospace; font-size:clamp(7px,1.1vw,8px); color:var(--red); text-decoration:none; }
.sf a:hover { text-decoration:underline; }
.sf .au { font-family:'DM Mono',monospace; font-size:clamp(7px,1.1vw,8px); color:var(--ink-3); }

/* ── CTA LINKS ── */
.cta-link {
  display: flex; align-items: center; gap: 10px;
  padding: clamp(7px,1.4vw,11px) clamp(9px,1.6vw,13px);
  border-radius: 2px; text-decoration: none;
  transition: opacity .18s; margin-bottom: 5px;
}
.cta-link:hover { opacity: .85; }
.cl-label { font-family:'DM Mono',monospace; font-size:clamp(7px,1.1vw,8px); text-transform:uppercase; letter-spacing:.08em; }
.cl-val { font-size:clamp(8px,1.2vw,9.5px); margin-top:1px; }

/* ── ARROWS & DOTS ── */
#dots {
  position: fixed; bottom: 18px; left: 50%;
  transform: translateX(-50%); display: flex; gap: 6px; z-index: 500;
}
.dot { width: 6px; height: 6px; border-radius: 50%; background: var(--dot-color); cursor: pointer; border: none; transition: all .22s; }
.dot.on { background: var(--red); width: 18px; border-radius: 3px; }
.arr {
  position: fixed; top: 50%; transform: translateY(-50%);
  z-index: 500; background: var(--arr-bg); border: 1px solid var(--arr-border);
  color: var(--arr-color); width: 34px; height: 34px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 15px; transition: all .18s; user-select: none;
}
.arr:hover { border-color: var(--red); color: var(--red); }
#al { left: 10px; } #ar { right: 10px; }
@media (max-width: 500px) { .arr { display: none; } }

/* ── LINKEDIN CAPTION PANEL ── */
#li-panel {
  display: none;
}
@media (min-width: 1200px) {
  #li-panel {
    position: fixed;
    top: 48px; left: 0; bottom: 0;
    width: 300px;
    display: flex; flex-direction: column;
    padding: 13px 14px 16px;
    border-right: 1px solid var(--topbar-border);
    background: var(--topbar-bg);
    z-index: 400;
    overflow: hidden;
    transition: background .2s ease, border-color .2s ease, width .2s ease;
  }
  #li-panel.li-collapsed {
    width: 44px;
    padding: 13px 0;
    align-items: center;
  }
  #li-panel.li-collapsed #li-panel-body { display: none; }
  #al { left: 310px; transition: left .2s ease; }
  #li-panel.li-collapsed ~ #al,
  body:has(#li-panel.li-collapsed) #al { left: 54px; }
}
.li-panel-toprow {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 10px; flex-shrink: 0;
}
.li-panel-badge {
  font-family: 'DM Mono', monospace;
  font-size: 8px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--red); display: flex; align-items: center; gap: 5px;
}
#li-panel.li-collapsed .li-panel-badge span { display: none; }
.li-collapse-btn {
  background: transparent; border: 1px solid var(--btn-border);
  color: var(--btn-color); width: 22px; height: 22px; border-radius: 2px;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: border-color .15s, color .15s; flex-shrink: 0;
}
.li-collapse-btn:hover { border-color: var(--red); color: var(--red); }
.li-panel-body {
  flex: 1; min-height: 0; display: flex; flex-direction: column;
}
.li-panel-header {
  display: flex; align-items: center; gap: 9px;
  padding-bottom: 10px; border-bottom: 1px solid var(--topbar-border);
  margin-bottom: 10px;
}
.li-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--red); color: #fff;
  font-family: 'DM Mono', monospace; font-size: 11px; font-weight: 700; letter-spacing: 0;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.li-meta-name { font-size: 12px; font-weight: 600; color: var(--ink); line-height: 1.2; }
.li-meta-role {
  font-family: 'DM Mono', monospace; font-size: 8px;
  color: var(--ink-3); margin-top: 2px; letter-spacing: .04em;
}
.li-caption-box {
  flex: 1; min-height: 0;
  background: var(--body-bg); border: 1px solid var(--topbar-border); border-radius: 4px;
  padding: 10px 12px;
  font-family: 'DM Sans', sans-serif; font-size: 11.5px; line-height: 1.8;
  color: var(--ink); white-space: pre-wrap; word-break: break-word;
  overflow-y: auto; cursor: text; outline: none;
}
.li-caption-box:focus { border-color: var(--red); }
.li-copy-btn {
  margin-top: 9px; width: 100%; flex-shrink: 0;
  font-family: 'DM Mono', monospace; font-size: 9px;
  letter-spacing: .08em; text-transform: uppercase;
  padding: 9px 0; border: 1px solid var(--red); background: var(--red); color: #fff;
  border-radius: 2px; cursor: pointer;
  transition: background .18s, border-color .18s;
  display: flex; align-items: center; justify-content: center; gap: 6px;
}
.li-copy-btn:hover { background: var(--red-mid); border-color: var(--red-mid); }
.li-copy-btn.copied { background: #16a34a; border-color: #16a34a; }

/* ── PRINT ── */
@media print {
  #topbar,#pbar,#dots,#al,#ar,#toast,#li-panel { display:none !important; }
  body { background:#fff; display:block; }
  #main { margin-top:0; padding:0; display:block; }
  #slide-wrap { width:210mm; height:210mm; position:relative; display:block; }
  .slide { position:relative; display:flex !important; width:210mm; height:210mm; box-shadow:none; page-break-after:always; break-after:page; }
  .slide:last-child { page-break-after:avoid; break-after:avoid; }
}
@page { size:210mm 210mm; margin:0; }
