/* pricing.css - Secure Academic Utilities (CSP Compliant & Gold Standard) */

/* ==========================================================================
   1. LOCAL FONTS (ZERO TRACKING)
   ========================================================================== */
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 300; font-display: swap; src: url('/fonts/inter-regular.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 400; font-display: swap; src: url('/fonts/inter-regular.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 500; font-display: swap; src: url('/fonts/inter-500.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 600; font-display: swap; src: url('/fonts/inter-600.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 700; font-display: swap; src: url('/fonts/inter-700.woff2') format('woff2'); }

/* ==========================================================================
   2. THEME VARIABLES (LIGHT & DARK)
   ========================================================================== */
:root {
  color-scheme: light;
  --bg-main: #f8fafc;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-subtle: #94a3b8;
  
  --card-bg: #ffffff;
  --card-border: #e2e8f0;
  
  --select-bg: #ffffff;
  --select-border: #cbd5e1;
  --select-text: #1e293b;
  
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  /* Cookie Banner Light */
  --banner-bg: rgba(255, 255, 255, 0.85);
  --banner-border: rgba(15, 23, 42, 0.1);
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg-main: #0f172a;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-subtle: #64748b;
  
  --card-bg: #1e293b;
  --card-border: #334155;
  
  --select-bg: #1e293b;
  --select-border: #475569;
  --select-text: #f8fafc;
  
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.5);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.4), 0 2px 4px -2px rgb(0 0 0 / 0.4);

  /* Cookie Banner Dark */
  --banner-bg: rgba(30, 41, 59, 0.85);
  --banner-border: rgba(255, 255, 255, 0.1);
}

/* ==========================================================================
   3. BASE STYLES
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
}

body {
  background-color: var(--bg-main);
  color: var(--text-main);
  font-family: 'Inter', system-ui, sans-serif;
  transition: background-color 0.3s ease, color 0.3s ease;
  line-height: 1.7;
}

/* Hardware accelerated glow effect to replace CPU-heavy blur */
.bg-glow-effect {
  background: radial-gradient(circle, rgba(59, 130, 246, 0.08) 0%, rgba(59, 130, 246, 0) 70%);
  transform: translateZ(0);
}

/* ==========================================================================
   4. UI COMPONENTS (TOOLBAR & INPUTS)
   ========================================================================== */
.toolbar-select {
  height: 36px; border-radius: 0.5rem; border: 1px solid var(--select-border); background: var(--select-bg);
  color: var(--select-text); padding: 0 2.1rem 0 2.2rem; font-size: 0.8125rem; font-weight: 500;
  appearance: none; cursor: pointer; transition: all 0.2s ease; width: 140px;
}
.toolbar-select:hover, .toolbar-select:focus { border-color: #3b82f6; outline: none; }
.toolbar-select option { background: var(--bg-main); color: var(--text-main); }

.select-wrap { position: relative; display: inline-flex; align-items: center; }
.sel-icon-l, .sel-icon-r { position: absolute; pointer-events: none; opacity: 0.65; color: var(--select-text); }
.sel-icon-l { left: 0.65rem; } 
.sel-icon-r { right: 0.65rem; }

.theme-toggle-btn { 
  background: none; border: none; cursor: pointer; color: var(--text-muted); 
  display: flex; align-items: center; justify-content: center; padding: 0.5rem; 
  border-radius: 0.5rem; transition: all 0.2s; 
}
.theme-toggle-btn:hover { background-color: var(--card-border); color: var(--text-main); }

/* Form Inputs */
.input-field { 
  width: 100%; padding: 0.75rem 1rem; border-radius: 0.5rem; border: 1px solid var(--select-border); 
  background: var(--bg-main); color: var(--text-main); font-size: 0.875rem; outline: none; 
  transition: border-color 0.2s; 
}
.input-field:focus { border-color: #3b82f6; box-shadow: 0 0 0 2px rgba(59,130,246,0.1); }

/* Pricing Credit Input (Monospace) */
.credit-input { 
  width: 100%; padding: 0.75rem 1rem; border-radius: 0.5rem; border: 1px solid var(--select-border); 
  background: var(--bg-main); color: var(--text-main); font-family: var(--font-mono); 
  font-size: 0.875rem; outline: none; transition: border-color 0.2s; letter-spacing: 0.5px; font-weight: 600; 
}
.credit-input:focus { border-color: #3b82f6; box-shadow: 0 0 0 2px rgba(59,130,246,0.1); }

/* ==========================================================================
   5. BUTTONS
   ========================================================================== */
.btn-util-primary { 
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; 
  padding: 0.75rem 1.5rem; border-radius: 0.5rem; font-weight: 600; font-size: 0.875rem; 
  transition: all 0.2s; cursor: pointer; border: none; width: 100%; 
  background: #3b82f6; color: white; 
}
.btn-util-primary:hover:not(:disabled) { background: #2563eb; }
.btn-util-primary:disabled { opacity: 0.6; cursor: not-allowed; }

.btn-secondary { 
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; 
  background: transparent; color: var(--text-main); border: 1px solid var(--card-border); 
  padding: 0.75rem 1.5rem; font-size: 0.875rem; font-weight: 600; border-radius: 0.5rem; 
  cursor: pointer; transition: all 0.2s; width: 100%; text-decoration: none; 
}
.btn-secondary:hover:not(:disabled) { background: rgba(59, 130, 246, 0.05); border-color: #3b82f6; }

/* Copy to Clipboard Button (New) */
.btn-copy-code {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; 
  padding: 0.6rem 1.2rem; border-radius: 0.5rem; font-weight: 600; font-size: 0.875rem; 
  transition: all 0.2s; cursor: pointer; border: none; width: 100%; 
  background: #3b82f6; color: white; 
}
.btn-copy-code:hover { background: #2563eb; }
.btn-copy-code.copied { background: #16a34a; } /* Zöld siker-állapot */

/* ==========================================================================
   6. CARDS (PRICING TIERS)
   ========================================================================== */
.glass-card { 
  background-color: var(--card-bg); border: 1px solid var(--card-border); 
  box-shadow: var(--shadow-sm); transition: all 0.3s ease; 
}
.glass-card:hover { box-shadow: var(--shadow-md); border-color: #3b82f6; }

.featured-card { 
  background: linear-gradient(145deg, var(--card-bg) 0%, rgba(59, 130, 246, 0.05) 100%); 
  border: 2px solid #3b82f6; 
}

/* ==========================================================================
   7. RESULT BOXES, TOKEN BOXES & NOTIFICATIONS (TOAST)
   ========================================================================== */
.res-box { 
  display: none; margin-top: 1rem; padding: 0.875rem; border-radius: 0.5rem; 
  font-size: 0.875rem; text-align: center; font-weight: 500; animation: fadeUp 0.3s ease; 
}
.res-success { background: #f0fdf4; border: 1px solid rgba(22,163,74,0.2); color: #166534; }
[data-theme="dark"] .res-success { background: rgba(22,163,74,0.1); color: #86efac; }

.res-error { background: #fef2f2; border: 1px solid rgba(220,38,38,0.2); color: #b91c1c; }
[data-theme="dark"] .res-error { background: rgba(220,38,38,0.1); color: #fca5a5; }

/* Code Display Box (New) */
.code-box { 
  background: rgba(59, 130, 246, 0.05); border: 2px dashed rgba(59, 130, 246, 0.3); 
  border-radius: 0.75rem; padding: 1rem; margin: 1rem 0; 
  font-family: var(--font-mono); font-size: 1.25rem; font-weight: 700; 
  color: #3b82f6; letter-spacing: 0.05em; word-break: break-all; text-align: center;
}
[data-theme="dark"] .code-box { 
  background: rgba(59, 130, 246, 0.08); border-color: rgba(59, 130, 246, 0.3); 
}

/* Toast */
.toast { 
  position: fixed; bottom: 2rem; right: 2rem; transform: translateY(100px); 
  background: #1e293b; color: #f8fafc; padding: 0.75rem 1.5rem; border-radius: 0.5rem; 
  font-size: 0.875rem; font-weight: 600; box-shadow: 0 10px 25px rgba(0,0,0,0.2); 
  opacity: 0; transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275); 
  z-index: 9999; display: flex; align-items: center; gap: 0.5rem; pointer-events: none; 
}
.toast.show { transform: translateY(0); opacity: 1; }
[data-theme="dark"] .toast { background: #f8fafc; color: #0f172a; }

/* ==========================================================================
   8. MODALS & COOKIE BANNER
   ========================================================================== */
.modal-overlay { 
  position: fixed; top: 0; left: 0; width: 100%; height: 100%; 
  background: rgba(15,23,42,0.7); backdrop-filter: blur(4px); z-index: 100; 
  display: flex; align-items: center; justify-content: center; 
  opacity: 1; transition: opacity 0.3s ease; 
}
.hidden-modal { opacity: 0; pointer-events: none; }

.modal-bg { position: absolute; inset: 0; }

.modal-box { 
  position: relative;
  background: var(--card-bg); border: 1px solid var(--card-border); 
  border-radius: 1rem; box-shadow: var(--shadow-md); 
  display: flex; flex-direction: column; 
  transform: translateY(0); transition: transform 0.3s ease; max-height: 90vh; 
}
.hidden-modal .modal-box { transform: translateY(20px); }

.modal-header { 
  padding: 1.25rem 1.5rem; border-bottom: 1px solid var(--card-border); 
  display: flex; align-items: center; justify-content: space-between; 
}
.modal-title { font-size: 1.125rem; font-weight: 700; display: flex; align-items: center; gap: 0.5rem; color: var(--text-main); }

.modal-close { 
  background: transparent; border: none; color: var(--text-main); opacity: 0.5; cursor: pointer; 
  width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; 
  border-radius: 0.375rem; transition: all 0.2s; 
}
.modal-close:hover { background: rgba(59, 130, 246, 0.1); opacity: 1; color: #3b82f6; }

.modal-body { padding: 1.5rem; overflow-y: auto; }

/* Cookie Banner Glassmorphism */
#cookie-banner { 
  background: var(--banner-bg);
  border-top: 1px solid var(--banner-border);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1); 
}
.cookie-banner-hidden { transform: translateY(100%); }

/* ==========================================================================
   9. ANIMATIONS & SCROLLBAR
   ========================================================================== */
@keyframes fadeUp { 
  from { opacity: 0; transform: translateY(5px); } 
  to { opacity: 1; transform: none; } 
}

.spinner { animation: spin 1s linear infinite; }
@keyframes spin { 100% { transform: rotate(360deg); } }

/* Scrollbar Customization */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg-main); }
::-webkit-scrollbar-thumb { background: var(--card-border); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }
