/* ==========================================================================
   PAGLA TOOL - PRODUCTION DESIGN SYSTEM & CORE STYLES
   Domain: https://paglatool.com | Privacy First, 100% Client-Side Suite
   ========================================================================== */

:root {
  /* Color Palette - Vibrant Indigo & Cyan Accent */
  --primary: #6c5ce7;
  --primary-hover: #5644d8;
  --primary-rgb: 108, 92, 231;
  --accent: #00d4ff;
  --accent-hover: #00b4d8;
  --accent-rgb: 0, 212, 255;
  --secondary: #ff7675;
  --success: #00b894;
  --warning: #fdcb6e;
  --danger: #d63031;

  /* Light Theme (Default fallback) */
  --bg-page: #f8fafc;
  --bg-surface: #ffffff;
  --bg-surface-elevated: #ffffff;
  --bg-subtle: #f1f5f9;
  --border-subtle: rgba(148, 163, 184, 0.25);
  --border-focus: rgba(108, 92, 231, 0.5);
  --text-main: #0f172a;
  --text-muted: #475569;
  --text-dim: #94a3b8;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 20px -2px rgba(108, 92, 231, 0.08), 0 2px 6px -1px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 12px 32px -4px rgba(108, 92, 231, 0.14), 0 4px 12px -2px rgba(0, 0, 0, 0.05);
  --shadow-glow: 0 0 25px rgba(108, 92, 231, 0.25);
  --glass-bg: rgba(255, 255, 255, 0.85);
  --glass-border: rgba(255, 255, 255, 0.6);
  --header-bg: rgba(248, 250, 252, 0.9);

  /* Typography & Layout */
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;
  --container-max: 1240px;
  --transition-fast: 150ms ease;
  --transition-normal: 250ms ease;
  --transition-smooth: 350ms cubic-bezier(0.16, 1, 0.3, 1);
}

/* Dark Theme Overrides */
[data-theme="dark"] {
  --bg-page: #0b0e17;
  --bg-surface: #141829;
  --bg-surface-elevated: #1a2035;
  --bg-subtle: #1c223a;
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(0, 212, 255, 0.5);
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 24px -2px rgba(0, 0, 0, 0.5), 0 0 1px rgba(255, 255, 255, 0.1);
  --shadow-lg: 0 14px 40px -4px rgba(0, 0, 0, 0.7), 0 0 2px rgba(255, 255, 255, 0.15);
  --shadow-glow: 0 0 30px rgba(108, 92, 231, 0.4);
  --glass-bg: rgba(20, 24, 41, 0.82);
  --glass-border: rgba(255, 255, 255, 0.08);
  --header-bg: rgba(11, 14, 23, 0.9);
}

/* System Theme Preference Detection */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg-page: #0b0e17;
    --bg-surface: #141829;
    --bg-surface-elevated: #1a2035;
    --bg-subtle: #1c223a;
    --border-subtle: rgba(255, 255, 255, 0.08);
    --border-focus: rgba(0, 212, 255, 0.5);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --text-dim: #64748b;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 24px -2px rgba(0, 0, 0, 0.5), 0 0 1px rgba(255, 255, 255, 0.1);
    --shadow-lg: 0 14px 40px -4px rgba(0, 0, 0, 0.7), 0 0 2px rgba(255, 255, 255, 0.15);
    --shadow-glow: 0 0 30px rgba(108, 92, 231, 0.4);
    --glass-bg: rgba(20, 24, 41, 0.82);
    --glass-border: rgba(255, 255, 255, 0.08);
    --header-bg: rgba(11, 14, 23, 0.9);
  }
}

/* Base Reset & Smoothness */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-page);
  color: var(--text-main);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  transition: background-color var(--transition-normal), color var(--transition-normal);
}

/* Accessibility Skip Link */
.skip-link {
  position: absolute;
  top: -60px;
  left: 20px;
  background: var(--primary);
  color: #ffffff;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  z-index: 10000;
  text-decoration: none;
  transition: top var(--transition-fast);
}
.skip-link:focus {
  top: 15px;
  outline: 3px solid var(--accent);
}

/* Typography Defaults */
h1, h2, h3, h4, h5, h6 {
  color: var(--text-main);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.025em;
}

h1 { font-size: clamp(2rem, 4.5vw, 3.25rem); }
h2 { font-size: clamp(1.6rem, 3.2vw, 2.35rem); }
h3 { font-size: clamp(1.25rem, 2.4vw, 1.65rem); }
h4 { font-size: 1.2rem; }

p {
  color: var(--text-muted);
  margin-bottom: 1.15rem;
}

p:last-child {
  margin-bottom: 0;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--accent);
}

img, svg {
  display: block;
  max-width: 100%;
  height: auto;
}

button, input, select, textarea {
  font: inherit;
  color: inherit;
}

/* Focus Visible Accessibility */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* Containers */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: 20px;
  padding-right: 20px;
}

.container-narrow {
  max-width: 860px;
}

/* Responsive Grid System */
.grid {
  display: grid;
  gap: 24px;
}

.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid-cols-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 1024px) {
  .grid-cols-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-cols-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  .grid-cols-4, .grid-cols-3, .grid-cols-2 { grid-template-columns: 1fr; }
}

/* Section Spacing */
.section {
  padding: 70px 0;
  position: relative;
}

.section-hero {
  padding: 40px 0 80px;
  position: relative;
  overflow: hidden;
}

.section-header {
  text-align: center;
  max-width: 720px;
  margin: 0 auto 50px;
}

.section-subtitle {
  display: inline-block;
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--primary);
  background: rgba(var(--primary-rgb), 0.1);
  padding: 6px 14px;
  border-radius: var(--radius-full);
  margin-bottom: 14px;
  border: 1px solid rgba(var(--primary-rgb), 0.2);
}

[data-theme="dark"] .section-subtitle {
  color: var(--accent);
  background: rgba(var(--accent-rgb), 0.12);
  border-color: rgba(var(--accent-rgb), 0.25);
}

.section-title {
  margin-bottom: 16px;
}

.section-desc {
  font-size: 1.1rem;
  color: var(--text-muted);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 13px 26px;
  font-size: 1rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: all var(--transition-normal);
  min-height: 48px; /* Touch friendly requirement */
  touch-action: manipulation;
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, #4f46e5 100%);
  color: #ffffff;
  box-shadow: 0 4px 18px rgba(var(--primary-rgb), 0.35);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #7c6df7 0%, var(--primary) 100%);
  color: #ffffff;
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(var(--primary-rgb), 0.5);
}

.btn-accent {
  background: linear-gradient(135deg, var(--accent) 0%, #00a8ff 100%);
  color: #0b0e17;
  font-weight: 700;
  box-shadow: 0 4px 18px rgba(var(--accent-rgb), 0.35);
}

.btn-accent:hover {
  background: linear-gradient(135deg, #38e1ff 0%, var(--accent) 100%);
  color: #0b0e17;
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(var(--accent-rgb), 0.5);
}

.btn-secondary {
  background: var(--bg-surface);
  color: var(--text-main);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-sm);
}

.btn-secondary:hover {
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-2px);
}

.btn-sm {
  padding: 8px 16px;
  font-size: 0.875rem;
  min-height: 38px;
}

.btn-lg {
  padding: 16px 34px;
  font-size: 1.1rem;
  min-height: 54px;
}

/* Glass Card */
.glass-card {
  background: var(--glass-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 30px;
  box-shadow: var(--shadow-md);
  transition: transform var(--transition-smooth), box-shadow var(--transition-smooth), border-color var(--transition-smooth);
}

.glass-card:hover {
  border-color: rgba(var(--primary-rgb), 0.35);
  box-shadow: var(--shadow-lg);
}

/* Privacy Badge */
.privacy-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: rgba(0, 184, 148, 0.12);
  border: 1px solid rgba(0, 184, 148, 0.3);
  color: var(--success);
  border-radius: var(--radius-full);
  font-size: 0.875rem;
  font-weight: 600;
}

.privacy-badge svg {
  width: 18px;
  height: 18px;
}

/* Urdu / Regional Hint Pill */
.hint-urdu {
  display: inline-block;
  font-size: 0.82rem;
  font-weight: 500;
  color: #ff9f43;
  background: rgba(255, 159, 67, 0.1);
  border: 1px solid rgba(255, 159, 67, 0.25);
  padding: 3px 10px;
  border-radius: var(--radius-full);
  margin-top: 6px;
}

/* AdSense Placeholder Slots (CLS-safe reserved min-height) */
.ad-slot-container {
  width: 100%;
  margin: 35px auto;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--bg-subtle);
  border: 1px dashed var(--border-subtle);
  border-radius: var(--radius-md);
  position: relative;
  overflow: hidden;
}

.ad-slot-label {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 4px;
}

.ad-slot-horizontal {
  min-height: 100px;
  max-width: 970px;
  padding: 12px;
}

.ad-slot-rectangle {
  min-height: 280px;
  max-width: 336px;
  padding: 12px;
}

.ad-slot-sidebar {
  min-height: 600px;
  width: 100%;
  max-width: 300px;
  padding: 16px;
}

/* Screen reader utility */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Animation utilities */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 600ms cubic-bezier(0.16, 1, 0.3, 1), transform 600ms cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.active {
  opacity: 1;
  transform: translateY(0);
}

/* Breadcrumbs */
.breadcrumbs {
  padding: 16px 0;
  font-size: 0.875rem;
  color: var(--text-dim);
}

.breadcrumbs ol {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.breadcrumbs li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.breadcrumbs li:not(:last-child)::after {
  content: "/";
  color: var(--text-dim);
}

.breadcrumbs a {
  color: var(--text-muted);
}

.breadcrumbs a:hover {
  color: var(--primary);
}

.breadcrumbs [aria-current="page"] {
  color: var(--text-main);
  font-weight: 600;
}

/* FAQ Accordion */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 860px;
  margin: 0 auto;
}

.faq-item {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.faq-item[open] {
  border-color: rgba(var(--primary-rgb), 0.4);
  box-shadow: var(--shadow-md);
}

.faq-summary {
  padding: 20px 24px;
  font-weight: 600;
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  list-style: none;
  user-select: none;
}

.faq-summary::-webkit-details-marker {
  display: none;
}

.faq-summary::after {
  content: "+";
  font-size: 1.6rem;
  font-weight: 400;
  color: var(--primary);
  line-height: 1;
  transition: transform var(--transition-fast);
}

.faq-item[open] .faq-summary::after {
  transform: rotate(45deg);
}

.faq-answer {
  padding: 0 24px 22px;
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1.7;
}

/* Form Styles */
.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 8px;
  color: var(--text-main);
}

.form-control {
  width: 100%;
  padding: 13px 18px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-main);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(var(--primary-rgb), 0.15);
  outline: none;
}

textarea.form-control {
  min-height: 140px;
  resize: vertical;
}

.honeypot-field {
  display: none !important;
  visibility: hidden !important;
}

/* Footer layout */
.site-footer {
  background: var(--bg-surface);
  border-top: 1px solid var(--border-subtle);
  margin-top: auto;
  padding: 60px 0 30px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1.2fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 50px;
}

@media (max-width: 900px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 540px) {
  .footer-grid {
    grid-template-columns: 1fr;
  }
}

.footer-col h4 {
  font-size: 1.05rem;
  margin-bottom: 18px;
  color: var(--text-main);
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.footer-links a {
  color: var(--text-muted);
  font-size: 0.925rem;
}

.footer-links a:hover {
  color: var(--primary);
  padding-left: 4px;
}

.footer-bottom {
  border-top: 1px solid var(--border-subtle);
  padding-top: 25px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 0.875rem;
  color: var(--text-dim);
}

/* Cookie Banner */
.cookie-banner {
  position: fixed;
  bottom: 24px;
  right: 24px;
  max-width: 440px;
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-lg);
  z-index: 9999;
  display: none;
  animation: slideUp 350ms cubic-bezier(0.16, 1, 0.3, 1);
}

.cookie-banner.show {
  display: block;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.cookie-banner p {
  font-size: 0.9rem;
  margin-bottom: 18px;
  color: var(--text-muted);
}

.cookie-actions {
  display: flex;
  gap: 12px;
}

@media (max-width: 480px) {
  .cookie-banner {
    left: 16px;
    right: 16px;
    bottom: 16px;
  }
}
