/* === MODAL CSS === */

/* SVC MODAL (Telegram mini app style) */
.svc-modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  z-index: 700; opacity: 0; pointer-events: none;
  transition: opacity 0.25s;
}
.svc-modal-overlay.open { opacity: 1; pointer-events: all; }
.svc-modal {
  position: fixed;
  bottom: 0; left: 50%; transform: translateX(-50%) translateY(100%);
  width: 100%; max-width: 520px;
  height: 85vh;
  background: var(--c-surface);
  border-radius: 18px 18px 0 0;
  z-index: 701;
  display: flex; flex-direction: column;
  transition: transform 0.3s cubic-bezier(0.34,1.56,0.64,1);
  overflow: hidden;
  box-shadow: 0 -8px 40px rgba(0,0,0,0.3);
}
.svc-modal.open { transform: translateX(-50%) translateY(0); }
.svc-modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px 10px;
  border-bottom: 1px solid var(--c-border);
  flex-shrink: 0;
}
.svc-modal-header span { font-weight: 600; font-size: 0.95rem; }
.svc-close-btn {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--c-bg);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.85rem; color: var(--c-text-muted);
  transition: background 0.2s;
}
.svc-close-btn:hover { background: var(--c-border); }
.svc-modal-body { flex: 1; position: relative; overflow: hidden; }
.svc-modal-body iframe {
  width: 100%; height: 100%;
  display: block; border: none;
}
.svc-premium-blur {
  position: absolute; inset: 0;
  backdrop-filter: blur(12px);
  background: rgba(255,255,255,0.1);
  display: flex; align-items: center; justify-content: center;
  z-index: 10;
}
.blur-content {
  text-align: center; padding: 30px;
  background: var(--c-surface);
  border-radius: var(--radius);
  box-shadow: 0 8px 32px var(--c-shadow-lg);
  max-width: 280px;
}
.blur-content span { font-size: 2.5rem; display: block; margin-bottom: 10px; }
.blur-content h3 { font-size: 1.1rem; margin-bottom: 6px; }
.blur-content p { font-size: 0.85rem; color: var(--c-text-muted); margin-bottom: 16px; }
.blur-content button {
  background: linear-gradient(135deg, #ff6b35, #f7c948);
  color: white; border-radius: var(--radius-sm);
  padding: 10px 20px; font-weight: 600;
}
.svc-protected-error {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 12px; background: var(--c-surface);
  z-index: 10;
}
.svc-protected-error span { font-size: 2.5rem; }
.svc-protected-error p { color: var(--c-text-muted); font-size: 0.9rem; }

/* VIDEO MODAL */
.video-modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.85);
  z-index: 750; opacity: 0; pointer-events: none;
  transition: opacity 0.25s;
}
.video-modal-overlay.open { opacity: 1; pointer-events: all; }
.video-modal {
  position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%) scale(0.92);
  width: 90%; max-width: 880px;
  background: #000;
  border-radius: var(--radius);
  z-index: 751;
  overflow: hidden;
  opacity: 0; pointer-events: none;
  transition: transform 0.25s, opacity 0.25s;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6);
}
.video-modal.open {
  transform: translate(-50%, -50%) scale(1);
  opacity: 1; pointer-events: all;
}
.video-modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px;
  background: rgba(255,255,255,0.05);
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.video-modal-header span { color: white; font-weight: 600; font-size: 0.9rem; }
.video-modal-header button {
  color: rgba(255,255,255,0.7); font-size: 1.1rem;
  padding: 4px 8px;
}
.video-modal-player { aspect-ratio: 16/9; width: 100%; }
.video-modal-player iframe { width: 100%; height: 100%; display: block; }
.video-modal-info { padding: 12px 16px; background: rgba(255,255,255,0.03); }
.video-modal-info p { color: rgba(255,255,255,0.6); font-size: 0.85rem; }

/* PROFILE MODAL */
.profile-modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(3px);
  z-index: 800; opacity: 0; pointer-events: none;
  transition: opacity 0.25s;
}
.profile-modal-overlay.open { opacity: 1; pointer-events: all; }
.profile-modal {
  position: fixed;
  top: 0; right: -420px;
  width: 400px; height: 100vh;
  background: var(--c-surface);
  z-index: 801;
  display: flex; flex-direction: column;
  transition: right 0.3s cubic-bezier(0.34,1.56,0.64,1);
  box-shadow: -8px 0 40px rgba(0,0,0,0.2);
  overflow: hidden;
}
.profile-modal.open { right: 0; }
.profile-header {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  color: white; padding: 20px;
  text-align: center; position: relative;
  flex-shrink: 0;
}
.profile-close {
  position: absolute; top: 12px; right: 12px;
  color: rgba(255,255,255,0.6); font-size: 1rem;
  padding: 6px;
}
.profile-avatar-wrap { margin-bottom: 12px; }
.profile-avatar {
  width: 80px; height: 80px; border-radius: 50%;
  background: linear-gradient(135deg, #ff6b35, #f7c948);
  margin: 0 auto; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 2rem; font-weight: 700; color: white;
  position: relative; overflow: hidden;
  border: 3px solid rgba(255,255,255,0.3);
  transition: transform 0.2s;
}
.profile-avatar:hover { transform: scale(1.05); }
.profile-avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-upload-hint {
  position: absolute; bottom: 0; left: 0; right: 0;
  background: rgba(0,0,0,0.5);
  text-align: center; font-size: 1.1rem;
  padding: 4px; opacity: 0;
  transition: opacity 0.2s;
}
.profile-avatar:hover .avatar-upload-hint { opacity: 1; }
.profile-modal h2 { font-size: 1.1rem; font-weight: 700; margin-bottom: 4px; }
.oink-id { font-size: 0.78rem; opacity: 0.6; margin-bottom: 10px; font-family: monospace; }
.profile-stars {
  display: flex; align-items: center; justify-content: center;
  gap: 6px; font-size: 0.9rem;
}
.premium-badge {
  display: inline-block; margin-top: 8px;
  background: linear-gradient(90deg, #ff6b35, #f7c948);
  color: white; border-radius: 20px;
  padding: 4px 14px; font-size: 0.8rem; font-weight: 600;
}
.profile-tabs {
  display: flex; border-bottom: 1px solid var(--c-border);
  flex-shrink: 0;
}
.ptab {
  flex: 1; padding: 12px 8px; font-size: 0.8rem;
  color: var(--c-text-muted); border-bottom: 2px solid transparent;
  transition: var(--transition); margin-bottom: -1px;
}
.ptab.active { color: var(--c-primary); border-bottom-color: var(--c-primary); font-weight: 600; }
.profile-content {
  flex: 1; overflow-y: auto; padding: 16px;
}

/* PROFILE TAB CONTENT */
.profile-info-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 0; border-bottom: 1px solid var(--c-border);
  font-size: 0.875rem;
}
.profile-info-row label { color: var(--c-text-muted); }
.profile-info-row input {
  border: 1px solid var(--c-border); border-radius: var(--radius-sm);
  padding: 4px 8px; font-size: 0.875rem;
  font-family: var(--font-body); background: var(--c-bg); color: var(--c-text);
  width: 180px;
}
.save-profile-btn {
  width: 100%; margin-top: 16px;
  background: var(--c-primary); color: white;
  border-radius: var(--radius-sm); padding: 10px;
  font-weight: 600;
}
.history-item {
  padding: 8px 0; border-bottom: 1px solid var(--c-border);
  font-size: 0.875rem; cursor: pointer;
  display: flex; align-items: center; gap: 8px;
  color: var(--c-link);
}
.history-item:hover { color: var(--c-primary); }
.history-empty { text-align: center; padding: 30px; color: var(--c-text-muted); font-size: 0.9rem; }
.ref-link-box {
  background: var(--c-bg); border-radius: var(--radius-sm);
  border: 1px solid var(--c-border);
  padding: 10px 12px; margin-bottom: 10px;
  font-size: 0.8rem; font-family: monospace;
  word-break: break-all;
}
.ref-copy-btn {
  width: 100%;
  background: var(--c-primary); color: white;
  border-radius: var(--radius-sm); padding: 10px;
  font-weight: 600; margin-bottom: 16px;
}
.ref-section-title { font-weight: 600; margin: 12px 0 6px; font-size: 0.9rem; }
.ref-stats { display: flex; gap: 10px; margin-bottom: 16px; }
.ref-stat {
  flex: 1; background: var(--c-bg);
  border-radius: var(--radius-sm); padding: 10px;
  text-align: center;
}
.ref-stat strong { display: block; font-size: 1.3rem; }
.ref-stat span { font-size: 0.75rem; color: var(--c-text-muted); }
.ref-company-form input {
  width: 100%; border: 1px solid var(--c-border);
  border-radius: var(--radius-sm); padding: 8px 12px;
  font-size: 0.875rem; margin-bottom: 8px;
  font-family: var(--font-body); background: var(--c-bg); color: var(--c-text);
}
.ref-company-form button {
  width: 100%; background: var(--c-primary); color: white;
  border-radius: var(--radius-sm); padding: 10px;
  font-weight: 600;
}
.sub-status {
  background: var(--c-bg); border-radius: var(--radius);
  padding: 16px; text-align: center; margin-bottom: 16px;
}
.sub-status h3 { font-size: 1rem; margin-bottom: 4px; }
.sub-status p { font-size: 0.85rem; color: var(--c-text-muted); }
.sub-get-btn {
  width: 100%;
  background: linear-gradient(135deg, #ff6b35, #f7c948);
  color: white; border-radius: var(--radius-sm);
  padding: 12px; font-weight: 700;
}

/* PREMIUM MODAL */
.premium-modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(6px);
  z-index: 900; opacity: 0; pointer-events: none;
  transition: opacity 0.25s;
}
.premium-modal-overlay.open { opacity: 1; pointer-events: all; }
.premium-modal {
  position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%, -48%) scale(0.95);
  width: 92%; max-width: 680px;
  max-height: 90vh; overflow-y: auto;
  background: var(--c-surface);
  border-radius: 20px;
  z-index: 901; opacity: 0; pointer-events: none;
  transition: transform 0.3s, opacity 0.3s;
  box-shadow: 0 20px 60px rgba(0,0,0,0.4);
  padding: 28px;
}
.premium-modal.open {
  transform: translate(-50%, -50%) scale(1);
  opacity: 1; pointer-events: all;
}
.premium-close {
  position: absolute; top: 14px; right: 14px;
  color: var(--c-text-muted); font-size: 1.1rem;
  padding: 6px 10px;
}
.premium-hero { text-align: center; margin-bottom: 24px; }
.premium-star { font-size: 2.5rem; margin-bottom: 8px; }
.premium-hero h2 {
  font-family: var(--font-head); font-size: 1.5rem;
  background: linear-gradient(90deg, #ff6b35, #f7c948);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.premium-hero p { color: var(--c-text-muted); margin-top: 6px; }
.premium-plans { display: flex; gap: 14px; flex-wrap: wrap; }
.plan-card {
  flex: 1; min-width: 180px;
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  padding: 18px 16px;
  position: relative;
  transition: transform 0.2s, box-shadow 0.2s;
}
.plan-card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px var(--c-shadow); }
.plan-card.featured {
  border-color: var(--c-primary);
  box-shadow: 0 0 0 2px rgba(255,107,53,0.2);
}
.plan-badge {
  position: absolute; top: -10px; left: 50%; transform: translateX(-50%);
  background: linear-gradient(90deg, #ff6b35, #f7c948);
  color: white; font-size: 0.72rem; font-weight: 700;
  padding: 3px 12px; border-radius: 20px; white-space: nowrap;
}
.plan-card h3 { font-size: 0.9rem; font-weight: 700; margin-bottom: 8px; }
.plan-price { font-size: 1.3rem; font-weight: 700; color: var(--c-primary); margin-bottom: 12px; }
.plan-price small { font-size: 0.78rem; color: var(--c-text-muted); font-weight: 400; }
.plan-card ul { list-style: none; font-size: 0.82rem; color: var(--c-text-muted); margin-bottom: 14px; }
.plan-card li { padding: 3px 0; }
.plan-card button {
  width: 100%; background: var(--c-primary); color: white;
  border-radius: var(--radius-sm); padding: 10px;
  font-weight: 600; font-size: 0.875rem;
}
.plan-card.featured button {
  background: linear-gradient(90deg, #ff6b35, #f7c948);
}
.oink-plan { background: linear-gradient(135deg, #fff8f0, #fffbf0); }

/* PIN MODAL */
.pin-modal {
  max-width: 320px; width: 90%;
  position: fixed; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  background: var(--c-surface);
  border-radius: 20px;
  padding: 28px 24px;
  z-index: 1001;
  box-shadow: 0 20px 60px rgba(0,0,0,0.4);
  text-align: center;
}
.modal-overlay.pin-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.8);
  z-index: 1000;
}
.pin-logo { font-size: 2.5rem; margin-bottom: 12px; }
.pin-modal h2 { font-size: 1.1rem; margin-bottom: 6px; }
.pin-modal p { font-size: 0.85rem; color: var(--c-text-muted); margin-bottom: 20px; }
.pin-dots {
  display: flex; justify-content: center; gap: 12px; margin-bottom: 24px;
}
.pin-dots span {
  width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid var(--c-border);
  transition: background 0.2s, border-color 0.2s;
}
.pin-dots span.filled { background: var(--c-primary); border-color: var(--c-primary); }
.pin-pad {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 10px; margin-bottom: 12px;
}
.pin-pad button {
  padding: 14px; border-radius: 50%;
  font-size: 1.2rem; font-weight: 600;
  font-family: var(--font-head);
  background: var(--c-bg);
  color: var(--c-text);
  transition: background 0.15s;
}
.pin-pad button:active { background: var(--c-border); }
.pin-empty { background: transparent !important; }
.pin-error { color: #e53935; font-size: 0.82rem; min-height: 1rem; }
