/* cookie-policy.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'); }

@font-face { font-family: 'Lora'; font-style: normal; font-weight: 400; font-display: swap; src: url('../fonts/lora-regular.woff2') format('woff2'); }
@font-face { font-family: 'Lora'; font-style: normal; font-weight: 500; font-display: swap; src: url('../fonts/lora-500.woff2') format('woff2'); }
@font-face { font-family: 'Lora'; font-style: normal; font-weight: 600; font-display: swap; src: url('../fonts/lora-600.woff2') format('woff2'); }

/* ==========================================================================
   2. THEME VARIABLES (LIGHT & DARK)
   ========================================================================== */
:root {
  color-scheme: light;
  --bg-main: #f8fafc;
  --text-main: #1e293b;
  --text-muted: #475569;
  --text-subtle: #64748b;
  
  --card-bg: #ffffff;
  --card-border: #cbd5e1;
  
  --select-bg: #ffffff;
  --select-border: #94a3b8;
  --select-text: #1e293b;
  
  --icon-color: #3b82f6;
  --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.1);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);

  --table-border: #e2e8f0;
  --table-header: #f1f5f9;
  --toc-bg: rgba(59, 130, 246, 0.05);

  /* 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;
  
  --icon-color: #60a5fa;
  --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);

  --table-border: #334155;
  --table-header: rgba(255, 255, 255, 0.05);
  --toc-bg: rgba(59, 130, 246, 0.05);

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

/* ==========================================================================
   3. BASE STYLES & TYPOGRAPHY
   ========================================================================== */
*, *::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;
}

/* ==========================================================================
   4. UI COMPONENTS (TOOLBAR, BUTTONS, 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); }

/* Primary Button */
.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; }

/* Secondary Button */
.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; }

/* 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); }

/* ==========================================================================
   5. LEGAL CONTENT TYPOGRAPHY (PRIVACY POLICY SPECIFIC)
   ========================================================================== */
.legal-content h1 { 
  font-family: 'Lora', serif; font-size: 2.5rem; font-weight: 600; 
  margin-bottom: 1rem; line-height: 1.2; color: var(--text-main); 
}

.legal-content .meta { 
  font-size: 0.875rem; color: var(--text-muted); 
  margin-bottom: 2.5rem; padding-bottom: 1.5rem; 
  border-bottom: 1px solid var(--card-border); 
}

.legal-content h2 { 
  font-family: 'Lora', serif; font-size: 1.75rem; font-weight: 600; 
  margin-top: 3rem; margin-bottom: 1.25rem; color: var(--text-main); 
  scroll-margin-top: 100px; /* Offset for sticky header */
  border-bottom: 1px solid var(--card-border); padding-bottom: 0.5rem; 
}

.legal-content h3 { 
  font-size: 1.125rem; font-weight: 600; 
  margin-top: 2rem; margin-bottom: 1rem; color: var(--text-main); 
}

.legal-content h4 { 
  font-size: 1rem; font-weight: 600; 
  margin-top: 1.5rem; margin-bottom: 0.75rem; color: var(--text-main); 
}

.legal-content p { 
  margin-bottom: 1.25rem; color: var(--text-muted); 
}

.legal-content ul { 
  list-style-type: disc; padding-left: 1.5rem; margin-bottom: 1.5rem; color: var(--text-muted); 
}

.legal-content li { 
  margin-bottom: 0.5rem; 
}

.legal-content strong { 
  color: var(--text-main); font-weight: 600; 
}

.legal-content a { 
  color: var(--icon-color); text-decoration: underline; 
  text-underline-offset: 2px; transition: opacity 0.2s; 
}
.legal-content a:hover { opacity: 0.8; }

/* Table of Contents Box */
.toc-box {
  background: var(--toc-bg);
  border: 1px solid var(--card-border);
  border-radius: 1rem;
  padding: 1.75rem;
  margin-bottom: 3rem;
}
.toc-box h3 { 
  margin-top: 0; margin-bottom: 1rem; font-size: 1.125rem; 
  font-weight: 700; display: flex; align-items: center; gap: 0.5rem; color: var(--text-main); 
}
.toc-list { list-style: none !important; padding: 0 !important; margin: 0 !important; }
.toc-list li { margin-bottom: 0.6rem !important; }
.toc-list a { 
  text-decoration: none !important; color: var(--icon-color) !important; 
  font-weight: 500; display: block; transition: opacity 0.2s;
}

/* Legal Tables */
.table-wrapper { 
  overflow-x: auto; margin: 2rem 0; border: 1px solid var(--table-border); 
  border-radius: 0.75rem; 
}
table { width: 100%; border-collapse: collapse; text-align: left; font-size: 0.875rem; }
th, td { padding: 1rem; border-bottom: 1px solid var(--table-border); color: var(--text-muted); }
th { background-color: var(--table-header); font-weight: 600; color: var(--text-main); }
tr:last-child td { border-bottom: none; }

/* ==========================================================================
   6. 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%); }

/* Animations */
.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); }
