/* ==========================================================================
   PDF Imposition Web App Styles
   Modern, responsive, clean aesthetic with smooth micro-interactions
   ========================================================================== */

/* Custom Title Web Font */
@font-face {
  font-family: 'NexaRustSlab';
  src: url('font/NexaRustSlab-Trial-Black3.woff2') format('woff2'),
       url('font/NexaRustSlab-Trial-Black3.woff') format('woff');
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg-color: #0b0f19;
  --card-bg: rgba(23, 32, 54, 0.88);
  --card-border: rgba(56, 189, 248, 0.15);
  --card-hover-border: rgba(56, 189, 248, 0.35);
  
  --primary-accent: #0284c7;
  --primary-hover: #0369a1;
  --primary-glow: rgba(2, 132, 199, 0.3);

  --success-color: #10b981;
  --success-hover: #059669;
  --success-bg: rgba(16, 185, 129, 0.12);
  --success-border: rgba(16, 185, 129, 0.3);

  --error-color: #ef4444;
  --error-bg: rgba(239, 68, 68, 0.12);
  --error-border: rgba(239, 68, 68, 0.35);

  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;

  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --shadow-lg: 0 16px 36px -8px rgba(0, 0, 0, 0.5);
  --transition-fast: 0.18s ease;
}

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

html {
  min-height: 100%;
}

body {
  min-height: 100vh;
  position: relative;
  background-color: var(--bg-color);
  color: var(--text-primary);
  font-family: var(--font-family);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Fixed Background Image with Deep Vignette Shading */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: url('media/background.jpg') no-repeat center center;
  background-size: cover;
  background-attachment: fixed;
  box-shadow: inset 0 0 150px rgba(0, 0, 0, 0.7);
  z-index: -1;
  pointer-events: none;
}

/* ==========================================================================
   TheHelpful Network Global Navigation Bar (#menu)
   ========================================================================== */
.global-nav-container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 16px 20px 0 20px;
}

#menu {
  background: #003469;
  height: 45px;
  padding-left: 18px;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  position: relative;
  z-index: 100;
}

#menu ul, #menu li {
  margin: 0;
  padding: 0;
  list-style: none;
}

#menu ul {
  width: 100%;
  text-align: left;
}

#menu li {
  display: inline-block;
  position: relative;
}

#menu a {
  display: block;
  line-height: 45px;
  padding: 0 14px;
  text-decoration: none;
  color: #FFFFFF;
  font-size: 15px;
  font-weight: 700;
  transition: background var(--transition-fast), color var(--transition-fast);
}

#menu a.dropdown-arrow:after {
  content: " \25BE";
  margin-left: 5px;
}

#menu li a:hover {
  color: #FFFFFF;
  background: #005DBD;
}

#menu input {
  display: none;
  margin: 0;
  padding: 0;
  height: 45px;
  width: 100%;
  opacity: 0;
  cursor: pointer;
}

#menu label {
  display: none;
  line-height: 45px;
  text-align: center;
  position: absolute;
  left: 20px;
  cursor: pointer;
}

#menu label:before {
  font-size: 1.6em;
  color: #FFFFFF;
  content: "\2261";
}

#menu ul.sub-menus {
  height: auto;
  overflow: hidden;
  width: 250px;
  background: #003469;
  position: absolute;
  top: 45px;
  left: 0;
  z-index: 101;
  display: none;
  border-radius: 0 0 10px 10px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-top: none;
}

#menu ul.sub-menus li {
  display: block;
  text-align: left;
  width: 100%;
}

#menu ul.sub-menus a {
  color: #FFFFFF;
  font-size: 14px;
  padding: 0 18px;
  line-height: 38px;
}

#menu li:hover ul.sub-menus {
  display: block;
}

#menu ul.sub-menus a:hover {
  background: #005DBD;
  color: #FFFFFF;
}

@media screen and (max-width: 800px) {
  #menu {
    position: relative;
    border-radius: 10px;
    padding-left: 0;
  }
  #menu ul {
    background: #003469;
    position: absolute;
    top: 100%;
    right: 0;
    left: 0;
    z-index: 102;
    height: auto;
    display: none;
    text-align: left;
    border-radius: 0 0 10px 10px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-top: none;
  }
  #menu ul.sub-menus {
    width: 100%;
    position: static;
    border: none;
    box-shadow: none;
    background: rgba(0, 36, 75, 0.95);
  }
  #menu ul.sub-menus a {
    padding-left: 32px;
  }
  #menu li {
    display: block;
    float: none;
    width: auto;
  }
  #menu input, #menu label {
    position: absolute;
    top: 0;
    left: 0;
    display: block;
  }
  #menu input {
    z-index: 104;
  }
  #menu label {
    z-index: 103;
  }
  #menu input:checked + label {
    color: #FFFFFF;
  }
  #menu input:checked + label:before {
    content: "\00d7";
  }
  #menu input:checked ~ ul {
    display: block;
  }
}

/* App Wrapper */
.app-wrapper {
  max-width: 1080px;
  margin: 0 auto;
  padding: 30px 20px 60px 20px;
}

/* Header */
.app-header {
  text-align: center;
  margin-bottom: 36px;
}

.brand-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(56, 189, 248, 0.1);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.25);
  padding: 6px 16px;
  border-radius: 9999px;
  font-size: 0.88rem;
  font-weight: 600;
  margin-bottom: 16px;
  letter-spacing: 0.02em;
}

.app-title {
  font-family: 'NexaRustSlab', 'Rockwell', 'Courier New', serif, sans-serif;
  font-size: 2.6rem;
  font-weight: 900;
  line-height: 0.9;
  color: #ffffff;
  letter-spacing: 0.01em;
  margin-bottom: 12px;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.app-subtitle {
  font-size: 1.05rem;
  color: var(--text-secondary);
  max-width: 650px;
  margin: 0 auto;
}

/* ==========================================================================
   Landing Page Components
   ========================================================================== */
.hero-card {
  text-align: center;
  padding: 44px 32px;
  margin-bottom: 24px;
}

.hero-cta-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff !important;
  font-size: 1.25rem;
  font-weight: 800;
  padding: 16px 38px;
  border-radius: var(--radius-md);
  text-decoration: none;
  box-shadow: 0 10px 25px -5px rgba(16, 185, 129, 0.5);
  transition: all var(--transition-fast);
  margin-top: 24px;
  border: 1px solid rgba(255, 255, 255, 0.25);
}

.hero-cta-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 32px -4px rgba(0, 255, 129, 0.65);
  background: linear-gradient(135deg, #05c800 0%, #05af55 100%);
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
  margin-top: 18px;
}

.feature-item {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.feature-icon {
  font-size: 1.8rem;
  margin-bottom: 4px;
}

.feature-item h3 {
  color: #ffffff;
  font-size: 1.1rem;
}

.feature-item p {
  color: var(--text-secondary);
  font-size: 0.92rem;
  line-height: 1.5;
}

.bottom-cta-card {
  text-align: center;
  padding: 38px 24px;
  background: linear-gradient(180deg, rgba(23, 32, 54, 0.95) 0%, rgba(15, 23, 42, 0.95) 100%);
  border: 1px solid rgba(56, 189, 248, 0.3);
  margin-top: 16px;
}

.bottom-cta-card h2 {
  font-size: 1.8rem;
  color: #ffffff;
  margin-bottom: 8px;
}

.bottom-cta-card p {
  color: var(--text-secondary);
  margin-bottom: 18px;
}

/* Workspace Grid */
.workspace-grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 24px;
}

/* Reusable Card */
.card {
  background: var(--card-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-lg);
  transition: border-color var(--transition-fast);
}

.tool-card {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Drop Zone */
.drop-zone {
  border: 2px dashed rgba(56, 189, 248, 0.35);
  background: rgba(15, 23, 42, 0.6);
  border-radius: var(--radius-md);
  padding: 40px 24px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.drop-zone:hover, .drop-zone:focus {
  border-color: #38bdf8;
  background: rgba(56, 189, 248, 0.04);
  outline: none;
}

.drop-zone.drag-over {
  border-color: #38bdf8;
  background: rgba(56, 189, 248, 0.12);
  transform: scale(1.01);
}

.drop-zone.has-file {
  padding: 20px;
  border-style: solid;
  border-color: rgba(56, 189, 248, 0.2);
}

.upload-icon {
  font-size: 2.8rem;
  margin-bottom: 12px;
}

.drop-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 6px;
}

.drop-subtext {
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin-bottom: 18px;
}

.drop-hint {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 14px;
}

.hidden-input {
  display: none;
}

/* Option Checkbox Container */
.option-container {
  background: rgba(15, 23, 42, 0.45);
  border: 1px solid rgba(56, 189, 248, 0.15);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: border-color var(--transition-fast), background var(--transition-fast);
}

.option-container:hover {
  border-color: rgba(56, 189, 248, 0.35);
  background: rgba(15, 23, 42, 0.65);
}

.checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
  font-weight: 600;
  font-size: 0.95rem;
  color: #ffffff;
}

.checkbox-input {
  position: absolute;
  opacity: 0;
  cursor: pointer;
  height: 0;
  width: 0;
}

.checkbox-custom {
  width: 20px;
  height: 20px;
  min-width: 20px;
  background: rgba(15, 23, 42, 0.8);
  border: 2px solid rgba(56, 189, 248, 0.4);
  border-radius: 5px;
  position: relative;
  transition: all var(--transition-fast);
}

.checkbox-label:hover .checkbox-custom {
  border-color: #38bdf8;
  background: rgba(56, 189, 248, 0.1);
}

.checkbox-input:focus + .checkbox-custom {
  outline: 2px solid #38bdf8;
  outline-offset: 2px;
}

.checkbox-input:checked + .checkbox-custom {
  background: var(--primary-accent);
  border-color: var(--primary-accent);
}

.checkbox-input:checked + .checkbox-custom::after {
  content: '';
  position: absolute;
  left: 6px;
  top: 2px;
  width: 5px;
  height: 10px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.checkbox-text {
  color: #f8fafc;
}

.option-hint {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.45;
  margin-left: 30px;
}

/* Nested Option (e.g. Crop Marks under Print Margins) */
.nested-option {
  margin-top: 10px;
  margin-left: 20px;
  padding-left: 14px;
  border-left: 2px solid rgba(56, 189, 248, 0.3);
  display: flex;
  flex-direction: column;
  gap: 6px;
  animation: fadeIn 0.2s ease-in-out;
}

.nested-option.hidden {
  display: none;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* File Details Card */
.file-details-card {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 18px;
}

.file-info-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.file-icon {
  font-size: 1.6rem;
}

.file-meta {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.file-name {
  font-weight: 600;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 0.95rem;
}

.file-size {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.file-specs-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  background: rgba(0, 0, 0, 0.2);
  padding: 12px;
  border-radius: var(--radius-sm);
}

.spec-item {
  display: flex;
  flex-direction: column;
}

.spec-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.spec-val {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-primary);
}

/* Validation Alert */
.validation-alert {
  border-radius: var(--radius-md);
  padding: 16px;
  border: 1px solid transparent;
  transition: all var(--transition-fast);
}

.alert-title {
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 4px;
}

.alert-message {
  font-size: 0.9rem;
  line-height: 1.45;
}

.alert-success {
  background: var(--success-bg);
  border-color: var(--success-border);
  color: #34d399;
}

.alert-success .alert-message {
  color: #a7f3d0;
}

.alert-error {
  background: var(--error-bg);
  border-color: var(--error-border);
  color: #f87171;
}

.alert-error .alert-message {
  color: #fecaca;
}

/* Action Section */
.action-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: inherit;
  font-weight: 600;
  font-size: 1rem;
  padding: 12px 24px;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: all var(--transition-fast);
}

.btn-primary {
  background: var(--primary-accent);
  color: #ffffff;
  box-shadow: 0 4px 14px var(--primary-glow);
}

.btn-primary:hover:not(:disabled) {
  background: var(--primary-hover);
  transform: translateY(-1px);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.btn-secondary:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.14);
}

.btn-success {
  background: var(--success-color);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.3);
}

.btn-success:hover:not(:disabled) {
  background: linear-gradient(135deg, #05c800 0%, #05af55 100%);
  box-shadow: 0 14px 32px -4px rgba(0, 255, 129, 0.65);
  transform: translateY(-2px);
}

.btn-large {
  padding: 16px 28px;
  font-size: 1.1rem;
  width: 100%;
}

.btn-disabled, .btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

.btn-icon {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  line-height: 1;
}

.btn-icon:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.1);
}

/* Progress Indicator */
.progress-container {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(56, 189, 248, 0.2);
  border-radius: var(--radius-md);
  padding: 16px;
}

.progress-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.88rem;
  margin-bottom: 8px;
  color: var(--text-secondary);
}

.progress-percent {
  font-weight: 700;
  color: #38bdf8;
}

.progress-track {
  height: 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 9999px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #0284c7, #38bdf8);
  border-radius: 9999px;
  transition: width 0.15s ease-out;
}

/* Result Card */
.result-success {
  display: flex;
  align-items: center;
  gap: 16px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: var(--radius-md);
  padding: 16px;
}

.success-icon {
  font-size: 2rem;
}

.success-content h3 {
  color: #34d399;
  font-size: 1.1rem;
  margin-bottom: 4px;
}

.success-content p {
  color: var(--text-primary);
  font-size: 0.9rem;
}

/* Monetization Safe Space / Ad Card */
.ad-card,
.adsense-slot-sidebar {
  min-height: 280px;
  width: 100%;
  min-width: 280px;
  display: flex;
  flex-direction: column;
}

.ad-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  min-width: 100%;
  height: 100%;
}

.ad-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
  align-self: flex-start;
}

.ad-box {
  width: 100%;
  min-width: 250px;
  min-height: 250px;
  background: rgba(15, 23, 42, 0.4);
  border: 1px dashed rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
  display: block;
  position: relative;
  overflow: hidden;
}

.ad-box .adsbygoogle {
  display: block !important;
  width: 100% !important;
  min-width: 250px;
  min-height: 250px;
}

/* Educational Guide Card */
.guide-card {
  grid-column: 1 / -1;
  margin-top: 10px;
}

.guide-title {
  font-size: 1.4rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 24px;
  letter-spacing: -0.02em;
}

.guide-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin-bottom: 28px;
}

.guide-step {
  display: flex;
  gap: 14px;
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-md);
  padding: 18px;
}

.step-num {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  min-width: 32px;
  background: var(--primary-accent);
  color: #ffffff;
  font-weight: 700;
  border-radius: 50%;
  font-size: 0.9rem;
}

.step-content h3 {
  font-size: 1rem;
  font-weight: 600;
  color: #ffffff;
  margin-bottom: 6px;
}

.step-content p {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.45;
}

/* Formula / Mathematical Box */
.formula-box {
  background: rgba(15, 23, 42, 0.8);
  border-left: 3px solid #38bdf8;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  padding: 16px 20px;
}

.formula-box h3 {
  font-size: 0.95rem;
  font-weight: 700;
  color: #38bdf8;
  margin-bottom: 6px;
}

.formula-box p {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* App Footer */
.app-footer {
  text-align: center;
  margin-top: 48px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ==========================================================================
   TheHelpful Network Footer
   ========================================================================== */
.th-footer {
  margin-top: 4rem;
  padding: 2.5rem 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-secondary);
}

.th-container {
  max-width: 800px;
  margin: 0 auto;
  text-align: center;
}

.th-brand a {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: bold;
  color: #ffffff;
  font-size: 1.1rem;
}

.th-tagline {
  margin-top: 0.35rem;
  font-size: 0.9em;
  color: var(--text-muted);
}

.th-network-links ul {
  list-style: none;
  padding: 0;
  margin: 1.5rem 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem 1.2rem;
}

.th-network-links li {
  display: inline-block;
}

.th-network-links a {
  color: #38bdf8;
  font-weight: 600;
  text-decoration: underline;
  text-decoration-thickness: 1px;
}

.th-network-links a:hover {
  color: #ffffff;
}

.th-legal p {
  font-size: 0.85em;
  line-height: 1.6;
  color: var(--text-muted);
}

.th-legal a {
  color: var(--text-secondary);
  text-decoration: none;
}

.th-legal a:hover {
  text-decoration: underline;
}

/* Utility */
.hidden {
  display: none !important;
}

/* Responsive Media Queries */
@media (max-width: 860px) {
  .workspace-grid {
    grid-template-columns: 1fr;
  }
  
  .ad-card,
  .adsense-slot-sidebar {
    min-width: 0;
    width: 100%;
    min-height: 280px;
  }

  .ad-box {
    min-width: 0;
    width: 100%;
    min-height: 250px;
  }

  .ad-box .adsbygoogle {
    min-width: 0;
    width: 100% !important;
    min-height: 250px;
  }
}

@media (max-width: 600px) {
  .app-wrapper {
    padding: 20px 14px 40px 14px;
  }

  .app-title {
    font-size: 1.9rem;
  }

  .card {
    padding: 18px;
  }

  .drop-zone {
    padding: 30px 16px;
  }

  .file-specs-grid {
    grid-template-columns: 1fr;
  }
}
