/* ══════════════════════════════════════════════════════════
   RESULT.CSS — Vaivox Result Display Styles
   Result section, result modal, summary modal, download,
   share buttons, banners, mobile result overlay
   Extracted from main.css
   ══════════════════════════════════════════════════════════ */

/* ═══════════════════════════════════════════
   RESULT SECTION
═══════════════════════════════════════════ */
#result-section {
  display:none; animation:fadeUp .5s ease both;
  /* Break out dal hero (max-width:740px) per essere largo come pricing (1100px) */
  width:100vw;
  max-width:1100px;
  margin-left:50%;
  transform:translateX(-50%);
  padding:0 24px;
  box-sizing:border-box;
}

.result-card { background:transparent; border:none; box-shadow:none; border-radius:0; overflow:visible; margin-bottom:20px; }

.result-banner {
  display:none;
}

/* ═══════════════════════════════════════════
   RESULT MODAL
═══════════════════════════════════════════ */
#result-modal-overlay {
  display: none; position: fixed; inset: 0; z-index: 9999;
  background: rgba(255,255,255,0.82);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  align-items: flex-start; justify-content: center;
  padding: 40px 24px;
  overflow-y: auto;
}
#result-modal-overlay.open { display: flex; }

.result-modal {
  width: 100%; max-width: 900px;
  position: relative;
  animation: fadeUp .4s ease both;
  padding-top: 50px;
}

.result-modal-close {
  position: absolute; top: 0; right: 0;
  background: rgba(0,0,0,0.06);
  border: 1px solid rgba(0,0,0,0.1);
  color: rgba(0,0,0,0.5);
  width: 40px; height: 40px; border-radius: 50%;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: all .2s; z-index: 10;
}
.result-modal-close:hover { background: rgba(0,0,0,0.1); color: #000; }

/* Video player TV */
.result-modal-player {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
  background: #000;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,0.8);
  border: 1px solid rgba(255,255,255,0.08);
}
.result-modal-player #result-yt-container { width: 100%; height: 100%; }
.result-modal-player iframe { width: 100%; height: 100%; }

/* Stats */
.result-modal-stats {
  display: flex; gap: 14px; margin-top: 24px;
}
.result-modal-stat {
  flex: 1; padding: 14px 16px;
  background: linear-gradient(135deg, rgba(255,255,255,0.7) 0%, rgba(255,255,255,0.3) 100%);
  backdrop-filter: blur(24px) saturate(200%);
  -webkit-backdrop-filter: blur(24px) saturate(200%);
  border: 1px solid rgba(255,255,255,0.6);
  border-radius: 12px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.4), 0 8px 20px -6px rgba(0,0,0,0.08);
  display: flex; flex-direction: column; gap: 4px;
}
.result-modal-stat-label {
  font-family: var(--mono); font-size: .58rem;
  color: #64748b; letter-spacing: .08em; text-transform: uppercase;
}
.result-modal-stat-value {
  font-family: var(--mono); font-size: .86rem;
  color: #1a1a2e; font-weight: 600;
}

/* Transcript collapsible */
.result-modal-transcript {
  margin-top: 12px;
  background: linear-gradient(135deg, rgba(255,255,255,0.7) 0%, rgba(255,255,255,0.3) 100%);
  backdrop-filter: blur(24px) saturate(200%);
  -webkit-backdrop-filter: blur(24px) saturate(200%);
  border: 1px solid rgba(255,255,255,0.6);
  border-radius: 12px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.4), 0 8px 20px -6px rgba(0,0,0,0.08);
  overflow: hidden;
}
.result-modal-transcript-header {
  padding: 14px 16px;
  display: flex; align-items: center; justify-content: space-between;
  cursor: pointer;
  font-family: var(--mono); font-size: .72rem;
  color: #a07830; letter-spacing: .05em;
  transition: background .2s;
}
.result-modal-transcript-header:hover { background: rgba(160,120,48,0.06); }
.result-modal-transcript-header svg { transition: transform .3s; color: #a07830; }
.result-modal-transcript-header.open svg { transform: rotate(180deg); }
.result-modal-transcript-body {
  padding: 0 16px;
  max-height: 0; overflow: hidden;
  transition: max-height .4s ease, padding .3s ease;
  font-size: .85rem; color: #334155;
  line-height: 1.7; white-space: pre-wrap;
}
.result-modal-transcript-body.open {
  max-height: 300px; overflow-y: auto;
  padding: 0 16px 16px;
}

/* Action buttons */
.result-modal-actions {
  display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap;
}
.result-modal-btn {
  flex: 1; min-width: 140px;
  padding: 14px 18px; border-radius: 12px;
  font-family: var(--sans); font-size: .88rem; font-weight: 600;
  cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px;
  transition: all .2s; text-decoration: none; border: none;
}
.result-modal-btn.primary {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
  box-shadow: 0 0 20px rgba(16,185,129,0.3);
}
.result-modal-btn.primary:hover { transform: translateY(-1px); box-shadow: 0 0 30px rgba(16,185,129,0.5); }
.result-modal-btn.secondary {
  background: rgba(160,120,48,0.08);
  border: 1px solid rgba(160,120,48,0.2);
  color: #a07830;
}
.result-modal-btn.secondary:hover { background: rgba(160,120,48,0.15); }
.result-modal-btn.ghost {
  background: rgba(0,0,0,0.04);
  border: 1px solid rgba(0,0,0,0.1);
  color: #475569;
}
.result-modal-btn.ghost:hover { background: rgba(0,0,0,0.08); color: #1a1a2e; }

/* Result banner elements */
.live-dot { width:8px; height:8px; background:var(--green); border-radius:50%; box-shadow:0 0 8px rgba(34,197,94,.7); animation:pulse 1.8s ease-in-out infinite; flex-shrink:0; }
.result-banner-text { font-family:var(--mono); font-size:.72rem; color:var(--text); flex:1; }
.result-badge { font-family:var(--mono); font-size:.62rem; padding:3px 9px; border-radius:20px; color:var(--green); border:1px solid rgba(34,197,94,.3); background:rgba(34,197,94,.06); }
.result-close-btn { background:none; border:none; cursor:pointer; color:rgba(255,255,255,0.5); padding:4px; margin-left:8px; border-radius:6px; transition:all 0.2s; display:flex; align-items:center; }
.result-close-btn:hover { color:#fff; background:rgba(255,255,255,0.1); }

/* ── Mobile Result Overlay ──────────────────────── */
#mobile-result-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: #0a0810;
  flex-direction: column;
  overflow-y: auto;
}
#mobile-result-overlay.open { display: flex; }
@media (min-width: 601px) { #mobile-result-overlay { display: none !important; } }

.mob-result-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px;
  background: #0d0b14;
  border-bottom: 1px solid rgba(200,165,80,0.35);
  flex-shrink: 0;
}
.mob-result-back {
  background: none; border: none; color: var(--accent);
  font-family: var(--mono); font-size: 0.8rem;
  cursor: pointer; display: flex; align-items: center; gap: 6px; padding: 0;
}
.mob-result-badge {
  font-family: var(--mono); font-size: 0.6rem; color: #4ade80;
  border: 1px solid rgba(74,222,128,.5); background: rgba(74,222,128,.12);
  border-radius: 20px; padding: 3px 9px;
}
.mob-video-title {
  padding: 14px 16px 8px;
  font-family: var(--sans); font-size: 0.95rem; font-weight: 700;
  color: #ffffff; line-height: 1.4; background: #000; flex-shrink: 0;
}
.mob-player-wrap { width: 100%; aspect-ratio: 16/9; background: #000; flex-shrink: 0; }
.mob-lang-row { display: flex; gap: 8px; padding: 14px 16px 0; }
.mob-lang-btn {
  flex: 1; padding: 10px; border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.2); background: rgba(255,255,255,0.07);
  color: rgba(255,255,255,0.75); font-family: var(--mono); font-size: 0.75rem;
  cursor: pointer; text-align: center; transition: all .2s;
}
.mob-lang-btn.active { border-color: var(--accent); color: #fff; background: rgba(200,165,80,0.25); }
.mob-controls { padding: 14px 16px; background: #0d0b14; flex-shrink: 0; }
.mob-progress-track {
  width: 100%; height: 4px; background: rgba(255,255,255,0.15);
  border-radius: 2px; margin-bottom: 14px; cursor: pointer; position: relative;
}
.mob-progress-fill {
  height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent2));
  border-radius: 2px; width: 0%;
}
.mob-btn-row { display: flex; align-items: center; gap: 16px; }
.mob-play-btn {
  width: 54px; height: 54px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border: none; display: flex; align-items: center; justify-content: center;
  cursor: pointer; flex-shrink: 0; box-shadow: 0 0 24px rgba(200,165,80,0.5);
}
.mob-seek-btn {
  background: none; border: none; color: rgba(255,255,255,0.8);
  cursor: pointer; padding: 8px; display: flex; align-items: center;
}
.mob-times { font-family: var(--mono); font-size: 0.85rem; color: #ffffff; }
.mob-actions { display: flex; gap: 10px; padding: 0 16px 16px; }
.mob-action-btn {
  flex: 1; padding: 13px; border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.2); background: rgba(255,255,255,0.08);
  color: #ffffff; font-family: var(--sans); font-size: 0.85rem; font-weight: 600;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  gap: 8px; text-decoration: none;
}
.mob-action-btn.primary {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #000; border: none;
}
.mob-yt-link {
  margin: 0 16px 14px;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 12px; border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.15); background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.8); font-family: var(--mono); font-size: 0.78rem;
  text-decoration: none;
}
.mob-stats {
  display: flex; gap: 1px; background: rgba(255,255,255,0.08);
  border-top: 1px solid rgba(255,255,255,0.1);
}
.mob-stat { flex: 1; background: #0d0b14; padding: 12px 10px; display: flex; flex-direction: column; gap: 3px; }
.mob-stat-label { font-family: var(--mono); font-size: 0.6rem; color: rgba(255,255,255,0.55); text-transform: uppercase; letter-spacing: 1px; }
.mob-stat-value { font-family: var(--mono); font-size: 0.85rem; color: #ffffff; font-weight: 600; }

/* ── Extras Section ───────────────────────── */
#extras-section { display:none; animation:fadeUp .5s ease both; }
.extras-card {
  background:linear-gradient(160deg, rgba(28,18,45,0.98) 0%, rgba(10,8,16,0.99) 100%); border:1px solid rgba(200,165,80,0.18);
  border-top:1px solid rgba(200,165,80,0.4); border-radius: 10px; box-shadow:0 2px 0 rgba(200,165,80,0.12), 0 8px 32px rgba(0,0,0,0.55), inset 0 1px 0 rgba(255,255,255,0.03); overflow: hidden; margin-bottom: 20px;
}
.extras-header {
  display: flex; align-items: center;
  padding: 14px 20px; border-bottom: 1px solid var(--border);
  background: var(--surface2);
}
.extras-header-title {
  font-family: var(--mono); font-size: .68rem;
  color: var(--muted); letter-spacing: .12em; text-transform: uppercase;
}
.transcript-box {
  padding: 20px; max-height: 220px; overflow-y: auto;
  font-family: var(--mono); font-size: .82rem; line-height: 1.7;
  color: var(--text); white-space: pre-wrap;
  border-bottom: 1px solid var(--border);
}
.transcript-box::-webkit-scrollbar { width: 4px; }
.transcript-box::-webkit-scrollbar-track { background: var(--surface2); }
.transcript-box::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 4px; }
.download-row { display: flex; gap: 12px; padding: 16px 20px; flex-wrap: wrap; }
.dl-btn {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 18px; border-radius: var(--r); cursor: pointer;
  font-family: var(--mono); font-size: .75rem; font-weight: 500;
  text-decoration: none; transition: opacity .2s, transform .1s; border: none;
}
.dl-btn:hover { opacity: .85; transform: translateY(-1px); }
.dl-btn-audio { background: var(--accent); color: #000; }
.dl-btn-txt { background: var(--surface2); color: var(--text); border: 1px solid var(--border2); }

/* ── Summary report card (legacy inline, nascosto) ─── */
.summary-report-card { display: none !important; }

/* ── Summary Modal ────────────────────────────── */
#summary-modal-overlay {
  display: none; position: fixed; inset: 0; z-index: 9999;
  background: rgba(255,255,255,0.82);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  align-items: flex-start; justify-content: center;
  padding: 40px 24px;
  overflow-y: auto;
}
#summary-modal-overlay.open { display: flex; }

/* ── Study PDF Modal ──────────────────────────── */
#study-modal-overlay {
  display: none; position: fixed; inset: 0; z-index: 9999;
  background: rgba(255,255,255,0.82);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  align-items: flex-start; justify-content: center;
  padding: 40px 24px;
  overflow-y: auto;
}
#study-modal-overlay.open { display: flex; }
@media (max-width: 600px) {
  #study-modal-overlay { padding: 16px 12px; }
  #study-modal-preview iframe { height: 70vh !important; }
}

.summary-modal-header {
  text-align: center; margin-bottom: 24px;
}
.summary-modal-icon {
  font-size: 2.5rem; margin-bottom: 8px;
}
.summary-modal-title {
  font-family: var(--sans); font-size: 1.4rem; font-weight: 700;
  color: #1a1a2e; margin: 0;
}
.summary-modal-body {
  background: linear-gradient(135deg, rgba(255,255,255,0.7) 0%, rgba(255,255,255,0.3) 100%);
  backdrop-filter: blur(24px) saturate(200%);
  -webkit-backdrop-filter: blur(24px) saturate(200%);
  border: 1px solid rgba(255,255,255,0.6);
  border-radius: 16px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.4), 0 8px 20px -6px rgba(0,0,0,0.08);
  padding: 24px 28px;
  color: #334155; font-size: 0.9rem; line-height: 1.8;
  max-height: 50vh; overflow-y: auto;
}
.summary-modal-body h2 { font-size: 1.15rem; color: #1a1a2e; margin: 0 0 14px; font-weight: 700; }
.summary-modal-body h3 { font-size: 1rem; color: #a07830; margin: 16px 0 8px; font-weight: 600; }
.summary-modal-body ul { padding-left: 20px; margin: 8px 0; }
.summary-modal-body li { margin-bottom: 6px; }
.summary-modal-body p { margin: 8px 0; }
.summary-modal-body strong { color: #1a1a2e; }

.summary-modal-audio-btn {
  width: 100%; display: flex; align-items: center; gap: 12px;
  padding: 14px 18px; margin-top: 16px;
  background: linear-gradient(135deg, rgba(160,120,48,0.08) 0%, rgba(200,165,80,0.05) 100%);
  border: 1px solid rgba(160,120,48,0.2);
  border-radius: 12px; cursor: pointer; transition: all 0.2s;
  color: #a07830; font-family: var(--sans); font-size: 0.88rem; font-weight: 600;
}
.summary-modal-audio-btn:hover { background: rgba(160,120,48,0.15); }

/* ── Mobile result modal responsive ──────────── */
@media (max-width: 600px) {
  #result-modal-overlay { padding: 16px 12px; }
  .result-modal { max-width: 100%; }
  .result-modal-close { top: 12px; right: 12px; width: 36px; height: 36px; }
  .result-modal-stats { flex-wrap: wrap; }
  .result-modal-stat { flex: 1 0 45%; }
  .result-modal-actions { flex-direction: column; }
  .result-modal-btn { min-width: 100%; }
  #summary-modal-overlay { padding: 16px 12px; }
  .summary-modal-body { padding: 16px 18px; max-height: 60vh; }
  .summary-modal-title { font-size: 1.1rem; }

  /* Result card */
  .result-card {
    border-radius: 0 !important;
    border-left: none !important;
    border-right: none !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    margin-bottom: 12px !important;
  }

  /* Download buttons */
  .download-row { padding: 12px 16px !important; }
}
