/* ==========================================================================
   SmartPrint Studio - Luxury Orange, Carbon Black & Crisp White Theme
   Path: public/css/style.css
   ========================================================================== */

:root {
  --primary: #f97316;
  --primary-hover: #ea580c;
  --primary-dark: #c2410c;
  --primary-light: #fff7ed;
  --primary-border: #fed7aa;
  --primary-glow: rgba(249, 115, 22, 0.28);
  --secondary: #090d16;
  --secondary-soft: #18181b;
  --accent: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  --bg-body: #fafafa;
  --bg-card: #ffffff;
  --bg-workspace: #f1f5f9;
  --text-main: #090d16;
  --text-muted: #52525b;
  --border-color: #e4e4e7;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --shadow-sm: 0 2px 5px rgba(9, 13, 22, 0.05);
  --shadow-md: 0 8px 20px rgba(9, 13, 22, 0.08);
  --shadow-lg: 0 16px 36px rgba(9, 13, 22, 0.12);
  --shadow-orange: 0 8px 22px rgba(249, 115, 22, 0.32);
  --shadow-paper: 0 14px 36px rgba(9, 13, 22, 0.18);
  --font-sans: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans Arabic', sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-body);
  color: var(--text-main);
  line-height: 1.65;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: all 0.2s ease;
}

a:hover {
  color: var(--primary-hover);
}

/* ==========================================================================
   Navigation Header (Glassmorphism + Carbon Black & Orange Accents)
   ========================================================================== */
.site-header {
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: var(--shadow-sm);
}

.header-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0.8rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  font-size: 1.3rem;
  font-weight: 900;
  color: var(--secondary);
  letter-spacing: -0.02em;
}

.brand-logo:hover {
  color: var(--primary);
}

.brand-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
  color: #ffffff;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px var(--primary-glow);
}

.brand-icon svg {
  width: 22px;
  height: 22px;
  stroke: #ffffff;
}

.brand-badge {
  font-size: 0.68rem;
  background: var(--secondary);
  color: #ffffff;
  padding: 3px 8px;
  border-radius: 999px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.nav-link {
  color: var(--text-muted);
  font-weight: 700;
  font-size: 0.9rem;
  padding: 0.5rem 0.9rem;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  border: 1px solid transparent;
}

.nav-link svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.nav-link:hover {
  background: var(--primary-light);
  color: var(--primary-hover);
  border-color: var(--primary-border);
}

.nav-link:hover svg {
  transform: scale(1.1);
}

.nav-link.active {
  background: var(--secondary);
  color: #ffffff;
  box-shadow: var(--shadow-sm);
}

.nav-link.active svg {
  stroke: var(--primary);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.lang-select {
  padding: 0.48rem 0.8rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: #ffffff;
  color: var(--secondary);
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  transition: border-color 0.2s;
}

.lang-select:hover,
.lang-select:focus {
  outline: none;
  border-color: var(--primary);
}

/* ==========================================================================
   Buttons & Inputs (Modern Orange & Carbon Black Styling)
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.7rem 1.35rem;
  font-size: 0.95rem;
  font-weight: 800;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.22s ease;
  font-family: inherit;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(249, 115, 22, 0.25);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--primary-hover) 0%, var(--primary-dark) 100%);
  color: #ffffff;
  transform: translateY(-2px);
  box-shadow: var(--shadow-orange);
}

.btn-accent {
  background: var(--secondary);
  color: #ffffff;
  border: 1px solid #27272a;
}

.btn-accent:hover {
  background: #27272a;
  color: var(--primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-outline {
  background: #ffffff;
  border-color: var(--border-color);
  color: var(--secondary);
}

.btn-outline:hover {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary-hover);
}

.btn-danger {
  background: var(--danger);
  color: #ffffff;
}

.btn-sm {
  padding: 0.42rem 0.85rem;
  font-size: 0.82rem;
}

.form-group {
  margin-bottom: 1rem;
}

.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--secondary);
  margin-bottom: 0.38rem;
}

.form-control {
  width: 100%;
  padding: 0.58rem 0.8rem;
  font-size: 0.92rem;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: #ffffff;
  color: var(--text-main);
  font-family: inherit;
  transition: all 0.2s;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.16);
}

input[type="range"] {
  accent-color: var(--primary);
}

input[type="checkbox"] {
  accent-color: var(--primary);
  width: 16px;
  height: 16px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

/* ==========================================================================
   Hero Section & Tool Cards (High-Conversion Carbon Black + Orange Glow)
   ========================================================================== */
.container {
  max-width: 1360px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem;
  width: 100%;
}

.hero-section {
  background-color: var(--secondary);
  background-image:
    radial-gradient(circle at 50% 0%, rgba(249, 115, 22, 0.26) 0%, transparent 65%),
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 100% 100%, 28px 28px, 28px 28px;
  color: #ffffff;
  border-radius: var(--radius-lg);
  padding: 3.5rem 2rem;
  text-align: center;
  margin-bottom: 2.25rem;
  box-shadow: var(--shadow-lg);
  border: 1px solid #27272a;
  position: relative;
  overflow: hidden;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(249, 115, 22, 0.14);
  color: #fb923c;
  border: 1px solid rgba(249, 115, 22, 0.35);
  padding: 0.4rem 1.1rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 800;
  margin-bottom: 1.2rem;
}

.hero-title {
  font-size: clamp(1.9rem, 4.2vw, 2.9rem);
  font-weight: 900;
  margin-bottom: 1rem;
  line-height: 1.22;
  letter-spacing: -0.02em;
  color: #ffffff;
}

.hero-subtitle {
  font-size: 1.1rem;
  color: #a1a1aa;
  max-width: 800px;
  margin: 0 auto 2rem;
}

.hero-features {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.85rem;
  margin-top: 2rem;
  font-size: 0.88rem;
  color: #e4e4e7;
}

.hero-feature-item {
  background: rgba(255, 255, 255, 0.05);
  padding: 0.45rem 1rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-weight: 600;
}

.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(295px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}

.tool-card {
  background: var(--bg-card);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.75rem 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.tool-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  opacity: 0;
  transition: opacity 0.25s ease;
}

.tool-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary);
}

.tool-card:hover::before {
  opacity: 1;
}

.tool-card-badge {
  position: absolute;
  top: 16px;
  inset-inline-end: 16px;
  background: var(--primary-light);
  color: var(--primary-hover);
  border: 1px solid var(--primary-border);
  font-size: 0.72rem;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 999px;
}

.tool-icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: var(--primary-light);
  border: 1px solid var(--primary-border);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.15rem;
  transition: all 0.25s ease;
}

.tool-icon svg {
  width: 28px;
  height: 28px;
  stroke: var(--primary);
  transition: all 0.25s ease;
}

.tool-card:hover .tool-icon {
  background: var(--secondary);
  border-color: var(--secondary);
  transform: scale(1.06);
}

.tool-card:hover .tool-icon svg {
  stroke: var(--primary);
}

.tool-title {
  font-size: 1.22rem;
  font-weight: 900;
  margin-bottom: 0.55rem;
  color: var(--secondary);
}

.tool-desc {
  font-size: 0.92rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
  flex-grow: 1;
}

.tool-perks {
  list-style: none;
  margin-bottom: 1.4rem;
  font-size: 0.85rem;
  color: var(--secondary);
  font-weight: 600;
}

.tool-perks li {
  margin-bottom: 0.4rem;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

/* ==========================================================================
   Studio Workspace Layout & Visual Catalog Chips
   ========================================================================== */
.studio-layout {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 1.5rem;
  align-items: start;
}

@media (max-width: 1024px) {
  .studio-layout {
    grid-template-columns: 1fr;
  }
}

.studio-sidebar {
  background: var(--bg-card);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.35rem;
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 78px;
  max-height: calc(100vh - 96px);
  overflow-y: auto;
}

.sidebar-section {
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 1rem;
  margin-bottom: 1rem;
}

.sidebar-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.sidebar-title {
  font-size: 0.96rem;
  font-weight: 900;
  color: var(--secondary);
  margin-bottom: 0.8rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-inline-start: 3.5px solid var(--primary);
  padding-inline-start: 0.55rem;
}

.studio-preview-area {
  background: var(--bg-workspace);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 750px;
}

.preview-toolbar {
  width: 100%;
  background: var(--bg-card);
  padding: 0.8rem 1.1rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
}

/* Catalog Chips & Hover Preview Orange Overrides */
.gp-cat-chip:hover,
.gp-cat-chip.active {
  border-color: var(--primary) !important;
  background: var(--primary-light) !important;
  color: var(--secondary) !important;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(249, 115, 22, 0.18) !important;
}

#gp-hover-preview-popup {
  border-color: var(--primary) !important;
}

/* Live A4 Paper Sheet on Screen */
.a4-sheet-preview {
  background: #ffffff;
  width: 210mm;
  min-height: 280mm;
  box-shadow: var(--shadow-paper);
  position: relative;
  transition: all 0.2s ease;
  transform-origin: top center;
  overflow: hidden;
}

@media (max-width: 900px) {
  .a4-sheet-preview {
    width: 100%;
    min-height: auto;
  }
}

/* Sticker Grid Cell & "Used Sticker Saver" Feature */
.sticker-grid {
  display: grid;
  width: 100%;
  height: 100%;
}

.sticker-cell {
  border: 1px dashed #cbd5e1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  background: #ffffff;
  transition: all 0.15s ease;
  text-align: center;
}

.sticker-cell:hover {
  border-color: var(--primary);
  background: var(--primary-light);
}

.sticker-cell.skipped-slot {
  background: repeating-linear-gradient(
    45deg,
    #f4f4f5,
    #f4f4f5 8px,
    #e4e4e7 8px,
    #e4e4e7 16px
  );
  opacity: 0.6;
}

.sticker-cell.skipped-slot::after {
  content: attr(data-skip-label);
  position: absolute;
  background: var(--secondary);
  color: var(--primary);
  font-size: 0.68rem;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 4px;
}

/* ==========================================================================
   Google AdSense Smart Containers
   ========================================================================== */
.ad-container {
  width: 100%;
  max-width: 100%;
  margin: 1.25rem auto;
  background: #ffffff;
  border: 1px dashed #d4d4d8;
  border-radius: var(--radius-sm);
  padding: 0.75rem;
  text-align: center;
  min-height: 95px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.ad-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #a1a1aa;
  margin-bottom: 0.25rem;
}

/* ==========================================================================
   SEO Content & Guide Section
   ========================================================================== */
.seo-article-box {
  background: var(--bg-card);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 2.25rem;
  margin-top: 2.5rem;
  box-shadow: var(--shadow-sm);
}

.seo-article-box h1,
.seo-article-box h2 {
  font-size: 1.5rem;
  color: var(--secondary);
  margin-bottom: 1rem;
  padding-bottom: 0.6rem;
  border-bottom: 2px solid var(--primary-light);
}

.seo-article-box h3 {
  font-size: 1.15rem;
  color: var(--secondary);
  margin: 1.25rem 0 0.5rem;
}

.seo-article-box p {
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.faq-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1rem;
  margin-top: 1.25rem;
}

.faq-item {
  background: var(--bg-body);
  padding: 1.15rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  border-top: 3px solid var(--primary);
}

.faq-item h4 {
  color: var(--secondary);
  margin-bottom: 0.45rem;
  font-size: 0.98rem;
  font-weight: 800;
}

/* ==========================================================================
   Footer & Toast Notification (Deep Carbon Black + Orange)
   ========================================================================== */
.site-footer {
  background: var(--secondary);
  color: #d4d4d8;
  margin-top: auto;
  padding: 2.75rem 1.25rem 1.5rem;
  border-top: 3px solid var(--primary);
}

.footer-inner {
  max-width: 1360px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 2rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 1.5rem;
}

.footer-links {
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.footer-links a {
  color: #d4d4d8;
  font-size: 0.9rem;
  font-weight: 600;
}

.footer-links a:hover {
  color: var(--primary);
}

.footer-copy {
  max-width: 1360px;
  margin: 1.2rem auto 0;
  font-size: 0.85rem;
  text-align: center;
  color: #71717a;
}

.toast-msg {
  position: fixed;
  bottom: 24px;
  inset-inline-end: 24px;
  background: var(--secondary);
  color: #ffffff;
  border-inline-start: 4px solid var(--primary);
  padding: 0.9rem 1.3rem;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  font-weight: 700;
  font-size: 0.9rem;
  z-index: 9999;
  opacity: 0;
  transform: translateY(15px);
  transition: all 0.25s ease;
  pointer-events: none;
}

.toast-msg.show {
  opacity: 1;
  transform: translateY(0);
}

/* ==========================================================================
   PRINT MEDIA ENGINE (@media print) - Locks Output to Exactly 1 Page!
   ========================================================================== */
@media print {
  @page {
    size: A4 portrait;
    margin: 0mm !important;
  }

  * {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  html,
  body {
    background: #ffffff !important;
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
  }

  .site-header,
  .site-footer,
  .studio-sidebar,
  .preview-toolbar,
  .ad-container,
  .seo-article-box,
  .no-print,
  .toast-msg {
    display: none !important;
  }

  .container,
  .studio-layout,
  .studio-preview-area {
    display: block !important;
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
    background: #ffffff !important;
    width: 100% !important;
    min-height: 0 !important;
  }

  .a4-sheet-preview {
    box-shadow: none !important;
    margin: 0 auto !important;
    width: 100% !important;
    max-width: 210mm !important;
    min-height: 0 !important;
    max-height: 274mm !important;
    overflow: hidden !important;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
    page-break-after: avoid !important;
    break-after: avoid !important;
  }

  .a4-sheet-preview svg {
    page-break-inside: avoid !important;
    break-inside: avoid !important;
    display: block !important;
  }

  .sticker-cell {
    border-color: transparent !important;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
  }

  .sticker-cell.show-cut-lines {
    border: 0.5pt dashed #cbd5e1 !important;
  }

  .sticker-cell.skipped-slot {
    background: transparent !important;
    opacity: 0 !important;
  }

  .sticker-cell.skipped-slot * {
    visibility: hidden !important;
  }

  .sticker-cell.skipped-slot::after {
    display: none !important;
  }
}