/* =============================================
   EYprime PDF Tools – Main Stylesheet
   ============================================= */

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

:root {
  --primary:   #2563EB;
  --primary-dark: #1D4ED8;
  --primary-light: #EFF6FF;
  --secondary: #F3F4F6;
  --accent:    #111827;
  --text:      #374151;
  --text-muted:#6B7280;
  --white:     #ffffff;
  --border:    #E5E7EB;
  --success:   #10B981;
  --warning:   #F59E0B;
  --danger:    #EF4444;
  --radius:    12px;
  --radius-sm: 8px;
  --shadow:    0 4px 6px -1px rgba(0,0,0,.08), 0 2px 4px -1px rgba(0,0,0,.04);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,.10), 0 4px 6px -2px rgba(0,0,0,.05);
  --transition: 0.2s ease;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--white);
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
ul { list-style: none; }

/* --- Typography --- */
h1, h2, h3, h4 { color: var(--accent); font-weight: 700; line-height: 1.25; }
h1 { font-size: clamp(1.75rem, 4vw, 2.75rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); }
h3 { font-size: 1.25rem; }
h4 { font-size: 1rem; }
p  { color: var(--text); }

/* --- Layout --- */
.container { max-width: 1200px; margin: 0 auto; padding: 0 1.5rem; }
.section    { padding: 5rem 0; }
.section-sm { padding: 3rem 0; }

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .75rem 1.75rem;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  border: 2px solid transparent;
  transition: background var(--transition), color var(--transition), border-color var(--transition), transform var(--transition), box-shadow var(--transition);
  text-decoration: none;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--primary);
  color: var(--white);
  border-color: var(--primary);
}
.btn-primary:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
  box-shadow: 0 4px 12px rgba(37,99,235,.35);
}

.btn-outline {
  background: transparent;
  color: var(--primary);
  border-color: var(--primary);
}
.btn-outline:hover {
  background: var(--primary);
  color: var(--white);
}

.btn-white {
  background: var(--white);
  color: var(--primary);
  border-color: var(--white);
}
.btn-white:hover {
  background: var(--primary-light);
}

.btn-lg { padding: 1rem 2.25rem; font-size: 1.1rem; }
.btn-sm { padding: .5rem 1.1rem; font-size: .875rem; }

/* --- Navbar --- */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 1rem 0;
}

.navbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: .6rem;
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--accent);
}

.navbar-brand .brand-icon {
  width: 36px;
  height: 36px;
  background: var(--primary);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1rem;
}

.navbar-brand span.highlight { color: var(--primary); }

.navbar-nav {
  display: flex;
  align-items: center;
  gap: .25rem;
}

.navbar-nav a {
  padding: .5rem .875rem;
  border-radius: 6px;
  font-size: .9rem;
  font-weight: 500;
  color: var(--text);
  transition: background var(--transition), color var(--transition);
}
.navbar-nav a:hover { background: var(--secondary); color: var(--accent); }
.navbar-nav a.active { color: var(--primary); background: var(--primary-light); }

.navbar-actions { display: flex; align-items: center; gap: .75rem; }

.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 4px;
}
.hamburger span {
  width: 24px;
  height: 2px;
  background: var(--accent);
  border-radius: 2px;
  transition: transform var(--transition), opacity var(--transition);
}

/* --- Hero --- */
.hero {
  background: linear-gradient(135deg, #EFF6FF 0%, #DBEAFE 50%, #EDE9FE 100%);
  padding: 5rem 0 4rem;
  text-align: center;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  background: var(--primary-light);
  color: var(--primary);
  padding: .35rem .9rem;
  border-radius: 999px;
  font-size: .8rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  border: 1px solid #BFDBFE;
}

.hero h1 { margin-bottom: 1.25rem; }

.hero p.hero-sub {
  font-size: 1.2rem;
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto 2rem;
}

.hero-actions { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

.hero-stats {
  display: flex;
  gap: 2.5rem;
  justify-content: center;
  margin-top: 3rem;
  flex-wrap: wrap;
}

.hero-stats .stat { text-align: center; }
.hero-stats .stat-num { font-size: 1.5rem; font-weight: 800; color: var(--accent); }
.hero-stats .stat-label { font-size: .8rem; color: var(--text-muted); font-weight: 500; }

/* --- Section Headers --- */
.section-header { text-align: center; margin-bottom: 3rem; }
.section-header p { font-size: 1.1rem; color: var(--text-muted); margin-top: .5rem; }
.section-tag {
  display: inline-block;
  background: var(--primary-light);
  color: var(--primary);
  padding: .25rem .75rem;
  border-radius: 999px;
  font-size: .8rem;
  font-weight: 600;
  margin-bottom: .75rem;
}

/* --- Tools Grid --- */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1.25rem;
}

.tool-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-align: center;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .75rem;
}

.tool-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary);
}

.tool-card .tool-icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  flex-shrink: 0;
}

.tool-card h3 { font-size: 1rem; color: var(--accent); }
.tool-card p  { font-size: .8rem; color: var(--text-muted); line-height: 1.4; }

.tool-card .btn { margin-top: auto; width: 100%; justify-content: center; }

/* Tool icon color themes */
.icon-blue   { background: #EFF6FF; color: #2563EB; }
.icon-red    { background: #FEF2F2; color: #EF4444; }
.icon-green  { background: #ECFDF5; color: #10B981; }
.icon-purple { background: #F5F3FF; color: #7C3AED; }
.icon-orange { background: #FFF7ED; color: #F97316; }
.icon-pink   { background: #FDF2F8; color: #EC4899; }
.icon-teal   { background: #F0FDFA; color: #14B8A6; }
.icon-yellow { background: #FEFCE8; color: #EAB308; }

/* --- How It Works --- */
.how-section { background: var(--secondary); }

.steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 2rem;
}

.step-card {
  text-align: center;
  padding: 2rem 1.5rem;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  position: relative;
}

.step-num {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--primary);
  color: var(--white);
  font-size: 1.25rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
}

.step-card h3 { margin-bottom: .5rem; }
.step-card p  { font-size: .9rem; color: var(--text-muted); }

/* --- Popular Tools --- */
.popular-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.popular-card {
  display: flex;
  align-items: flex-start;
  gap: 1.25rem;
  padding: 1.5rem;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: transform var(--transition), box-shadow var(--transition);
  text-decoration: none;
}

.popular-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary);
}

.popular-card .tool-icon {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}

.popular-card-body h3 { font-size: 1.05rem; margin-bottom: .3rem; }
.popular-card-body p  { font-size: .85rem; color: var(--text-muted); }
.popular-card-body .try-link {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  color: var(--primary);
  font-size: .85rem;
  font-weight: 600;
  margin-top: .5rem;
}

/* --- CTA Banner --- */
.cta-section {
  background: linear-gradient(135deg, var(--primary) 0%, #1E40AF 100%);
  padding: 4rem 0;
  text-align: center;
  color: var(--white);
}

.cta-section h2 { color: var(--white); margin-bottom: 1rem; }
.cta-section p  { color: rgba(255,255,255,.8); font-size: 1.1rem; max-width: 520px; margin: 0 auto 2rem; }

/* --- Footer --- */
.footer {
  background: var(--accent);
  color: rgba(255,255,255,.75);
  padding: 3.5rem 0 2rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 2.5rem;
  padding-bottom: 2.5rem;
  border-bottom: 1px solid rgba(255,255,255,.1);
  margin-bottom: 2rem;
}

.footer-brand { display: flex; align-items: center; gap: .6rem; margin-bottom: 1rem; }
.footer-brand-name { font-size: 1.1rem; font-weight: 800; color: var(--white); }
.footer-brand-icon {
  width: 32px; height: 32px;
  background: var(--primary);
  border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  color: white; font-size: .9rem;
}

.footer-desc { font-size: .875rem; line-height: 1.6; max-width: 260px; }

.footer-col h4 { color: var(--white); font-size: .9rem; margin-bottom: 1rem; text-transform: uppercase; letter-spacing: .5px; }

.footer-col ul { display: flex; flex-direction: column; gap: .5rem; }
.footer-col ul a {
  font-size: .875rem;
  color: rgba(255,255,255,.65);
  transition: color var(--transition);
}
.footer-col ul a:hover { color: var(--white); }

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: .8rem;
}

.footer-bottom a { color: rgba(255,255,255,.55); transition: color var(--transition); }
.footer-bottom a:hover { color: var(--white); }

/* =============================================
   TOOL PAGE STYLES
   ============================================= */

/* --- Tool Hero --- */
.tool-hero {
  background: linear-gradient(135deg, #EFF6FF 0%, #DBEAFE 100%);
  padding: 3rem 0;
  text-align: center;
}

.tool-hero .tool-hero-icon {
  width: 72px;
  height: 72px;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  margin: 0 auto 1.25rem;
}

.tool-hero h1 { font-size: clamp(1.5rem, 3vw, 2.25rem); margin-bottom: .75rem; }
.tool-hero p  { font-size: 1.05rem; color: var(--text-muted); max-width: 520px; margin: 0 auto; }

/* --- Upload Area --- */
.tool-workspace { padding: 3rem 0 4rem; }

.upload-area {
  background: var(--white);
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 3.5rem 2rem;
  text-align: center;
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
  position: relative;
}

.upload-area:hover, .upload-area.dragover {
  border-color: var(--primary);
  background: var(--primary-light);
}

.upload-area input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}

.upload-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: .5;
}

.upload-area h3 { margin-bottom: .5rem; }
.upload-area p  { font-size: .9rem; color: var(--text-muted); }

.upload-area .btn { margin-top: 1.25rem; pointer-events: none; }

/* --- File List --- */
.file-list { margin-top: 1.5rem; display: flex; flex-direction: column; gap: .75rem; }

.file-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: .875rem 1.25rem;
  background: var(--secondary);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.file-item .file-icon { font-size: 1.5rem; flex-shrink: 0; }
.file-item .file-info { flex: 1; min-width: 0; }
.file-item .file-name { font-weight: 600; font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-item .file-size { font-size: .8rem; color: var(--text-muted); }
.file-item .file-remove { cursor: pointer; color: var(--danger); font-size: 1.2rem; padding: .25rem; border: none; background: none; }

/* --- Tool Controls --- */
.tool-controls {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  margin-top: 1.5rem;
}

.tool-controls h3 { margin-bottom: 1.25rem; font-size: 1rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .5px; }

.form-group { margin-bottom: 1.25rem; }
.form-group:last-child { margin-bottom: 0; }
.form-label { display: block; font-size: .875rem; font-weight: 600; margin-bottom: .4rem; color: var(--accent); }

.form-input, .form-select {
  width: 100%;
  padding: .625rem .9rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: .9rem;
  color: var(--text);
  background: var(--white);
  transition: border-color var(--transition), box-shadow var(--transition);
  -webkit-appearance: none;
}

.form-input:focus, .form-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,.15);
}

.form-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M6 8L1 3h10z' fill='%236B7280'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right .75rem center;
  padding-right: 2.5rem;
}

/* --- Progress --- */
.progress-wrapper { margin-top: 1.5rem; display: none; }
.progress-wrapper.active { display: block; }

.progress-label {
  display: flex;
  justify-content: space-between;
  font-size: .875rem;
  margin-bottom: .4rem;
}

.progress-bar-track {
  height: 8px;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 999px;
  width: 0%;
  transition: width .3s ease;
}

/* --- Result Card --- */
.result-card {
  background: #ECFDF5;
  border: 1px solid #6EE7B7;
  border-radius: var(--radius);
  padding: 2rem;
  text-align: center;
  margin-top: 1.5rem;
  display: none;
}

.result-card.active { display: block; }

.result-icon { font-size: 3rem; margin-bottom: 1rem; }
.result-card h3 { color: #065F46; margin-bottom: .5rem; }
.result-card p  { color: #047857; font-size: .9rem; margin-bottom: 1.5rem; }

.result-actions { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

/* --- Tool Action Bar --- */
.tool-action-bar {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-top: 2rem;
  flex-wrap: wrap;
}

/* --- Page Info Sections --- */
.info-section { background: var(--secondary); padding: 4rem 0; }
.info-grid    { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 1.5rem; }

.info-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
}

.info-card .info-icon { font-size: 1.75rem; margin-bottom: .75rem; }
.info-card h3 { font-size: 1rem; margin-bottom: .5rem; }
.info-card p  { font-size: .875rem; color: var(--text-muted); }

/* --- FAQ --- */
.faq-section { padding: 4rem 0; }
.faq-list { max-width: 720px; margin: 0 auto; }

.faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: .75rem;
  overflow: hidden;
}

.faq-question {
  padding: 1.1rem 1.25rem;
  font-weight: 600;
  font-size: .95rem;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .5rem;
  background: var(--white);
  transition: background var(--transition);
}

.faq-question:hover { background: var(--secondary); }

.faq-question .faq-icon {
  font-size: 1.1rem;
  color: var(--primary);
  font-style: normal;
  transition: transform var(--transition);
  flex-shrink: 0;
}

.faq-item.open .faq-question .faq-icon { transform: rotate(45deg); }

.faq-answer {
  padding: 0 1.25rem;
  max-height: 0;
  overflow: hidden;
  transition: max-height .3s ease, padding .3s ease;
  font-size: .9rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.faq-item.open .faq-answer { max-height: 400px; padding: .75rem 1.25rem 1.25rem; }

/* --- Instructions Steps --- */
.instructions { padding: 4rem 0; background: var(--secondary); }
.instruction-steps { display: flex; flex-direction: column; gap: 1rem; max-width: 640px; margin: 0 auto; }

.instruction-step {
  display: flex;
  gap: 1.25rem;
  align-items: flex-start;
  background: var(--white);
  padding: 1.25rem;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
}

.instruction-step .step-num {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--primary);
  color: var(--white);
  font-weight: 700;
  font-size: .9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.instruction-step-body h4 { margin-bottom: .25rem; }
.instruction-step-body p  { font-size: .875rem; color: var(--text-muted); }

/* --- Breadcrumb --- */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: .85rem;
  color: var(--text-muted);
  padding: .75rem 0;
}

.breadcrumb a { color: var(--primary); }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb .sep { opacity: .4; }

/* --- Page hero for static pages --- */
.page-hero {
  background: var(--secondary);
  padding: 3rem 0;
  text-align: center;
}

.page-hero h1 { margin-bottom: .75rem; }
.page-hero p  { font-size: 1.05rem; color: var(--text-muted); max-width: 520px; margin: 0 auto; }

/* --- Static content --- */
.content-body {
  max-width: 800px;
  margin: 0 auto;
  padding: 3rem 1.5rem 5rem;
}

.content-body h2 { margin: 2rem 0 .75rem; }
.content-body h3 { margin: 1.5rem 0 .5rem; }
.content-body p  { margin-bottom: 1rem; color: var(--text); }
.content-body ul { padding-left: 1.5rem; list-style: disc; margin-bottom: 1rem; }
.content-body ul li { margin-bottom: .4rem; font-size: .95rem; }

/* --- Thumbnail preview grid (rotate/rearrange) --- */
.page-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}

.page-thumb {
  background: var(--secondary);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  text-align: center;
  cursor: grab;
  transition: border-color var(--transition);
}

.page-thumb:hover { border-color: var(--primary); }
.page-thumb.selected { border-color: var(--primary); background: var(--primary-light); }

.page-thumb canvas { width: 100%; height: auto; display: block; }
.page-thumb-label {
  font-size: .75rem;
  padding: .4rem;
  color: var(--text-muted);
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .25rem;
}

.page-thumb-label button {
  background: none;
  border: none;
  cursor: pointer;
  padding: 2px;
  font-size: .9rem;
  line-height: 1;
  color: var(--text-muted);
}

.page-thumb-label button:hover { color: var(--primary); }

/* === Responsive === */
@media (max-width: 1024px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  .navbar-nav { display: none; }
  .hamburger { display: flex; }

  .navbar-nav.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--white);
    border-bottom: 1px solid var(--border);
    padding: 1rem 1.5rem;
    gap: .25rem;
    z-index: 99;
  }

  .tools-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }

  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-col:first-child { grid-column: 1 / -1; }

  .tool-action-bar { flex-direction: column; align-items: center; }
  .result-actions { flex-direction: column; align-items: center; }
}

@media (max-width: 480px) {
  .section { padding: 3rem 0; }
  .hero    { padding: 3rem 0 2.5rem; }
  .hero-stats { gap: 1.5rem; }
  .footer-grid { grid-template-columns: 1fr; }
  .tools-grid  { grid-template-columns: 1fr 1fr; }
  .popular-grid { grid-template-columns: 1fr; }
}

/* --- Utility --- */
.text-center { text-align: center; }
.mt-1 { margin-top: .5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.hidden { display: none !important; }
.badge {
  display: inline-flex;
  align-items: center;
  padding: .2rem .6rem;
  border-radius: 999px;
  font-size: .75rem;
  font-weight: 600;
}
.badge-success { background: #ECFDF5; color: #059669; }
.badge-blue    { background: var(--primary-light); color: var(--primary); }

/* Drag-sort visual */
.drag-over { outline: 2px dashed var(--primary); }
.dragging  { opacity: .5; }

/* Checkbox / Radio styling */
.check-group { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: .5rem; }
.check-item  { display: flex; align-items: center; gap: .4rem; font-size: .9rem; cursor: pointer; }
.check-item input { accent-color: var(--primary); width: 16px; height: 16px; cursor: pointer; }
