/* ═══════════════════════════════════════════
   PDF Text Fixer — Shared Styles v0.2.4
   ═══════════════════════════════════════════ */

:root {
  --bg: #ffffff;
  --bg-secondary: #f5f5f7;
  --bg-tertiary: #e8e8ed;
  --text: #1d1d1f;
  --text-secondary: #515154;
  --text-tertiary: #86868b;
  --accent: #0071e3;
  --accent-hover: #0077ed;
  --border: #d2d2d7;
  --border-light: #e8e8ed;
  --shadow: 0 2px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.12);
  --radius: 12px;
  --radius-sm: 8px;
  --font: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 18px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ═══════════════════════════════════════════
   Landing Page
   ═══════════════════════════════════════════ */

.landing-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 56px;
  background: rgba(255,255,255,0.88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  padding: 0 40px;
  z-index: 100;
}

.landing-nav .brand {
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.2px;
}

.nav-feedback {
  margin-left: auto;
  font-size: 15px;
  color: var(--text-secondary);
  text-decoration: none;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  transition: all 0.15s;
}

.nav-feedback:hover {
  background: var(--bg-tertiary);
  color: var(--text);
  text-decoration: none;
}

/* Hero */
.hero {
  padding: 140px 40px 60px;
  text-align: center;
  max-width: 1000px;
  margin: 0 auto;
}

.hero h1 {
  font-size: clamp(52px, 6vw, 72px);
  font-weight: 700;
  letter-spacing: -1.2px;
  line-height: 1.08;
  margin-bottom: 20px;
  color: var(--text);
}

.hero .subtitle {
  font-size: clamp(20px, 2.5vw, 26px);
  color: var(--text-secondary);
  line-height: 1.4;
  margin-bottom: 16px;
  font-weight: 400;
  max-width: 760px;
  margin-left: auto;
  margin-right: auto;
}

.hero-highlight {
  font-size: 21px;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 32px;
  letter-spacing: -0.2px;
}

.hero .cta-btn {
  display: inline-block;
  padding: 16px 40px;
  background: var(--accent);
  color: #fff;
  font-size: 20px;
  font-weight: 500;
  border-radius: 980px;
  border: none;
  cursor: pointer;
  transition: background 0.2s;
  text-decoration: none;
}

.hero .cta-btn:hover {
  background: var(--accent-hover);
  text-decoration: none;
}

.hero-hint {
  margin-top: 14px;
  font-size: 16px;
  color: var(--text-tertiary);
}

/* Advantage Cards */
.advantages {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  max-width: 960px;
  margin: 0 auto;
  padding: 20px 40px 60px;
}

.advantage-card {
  background: var(--bg-secondary);
  border-radius: var(--radius);
  padding: 28px 24px;
  text-align: center;
}

.advantage-icon {
  font-size: 32px;
  margin-bottom: 12px;
}

.advantage-card h3 {
  font-size: 24px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text);
  line-height: 1.3;
}

.advantage-card p {
  font-size: 19px;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* Sections */
.section {
  padding: 72px 40px;
  max-width: 960px;
  margin: 0 auto;
}

.section-alt {
  background: var(--bg-secondary);
}

.section h2 {
  font-size: 48px;
  font-weight: 600;
  text-align: center;
  margin-bottom: 16px;
  letter-spacing: -0.4px;
  line-height: 1.12;
}

/* Steps */
.steps {
  display: flex;
  gap: 32px;
  justify-content: center;
}

.step {
  flex: 1;
  max-width: 260px;
  text-align: center;
}

.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 14px;
}

.step p {
  font-size: 19px;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* Use Cases */
.use-cases {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  max-width: 1100px;
  margin: 0 auto;
}

.use-case-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 20px;
  text-align: center;
  transition: box-shadow 0.2s, border-color 0.2s;
}

.use-case-card:hover {
  border-color: var(--border);
  box-shadow: var(--shadow);
}

.use-case-icon {
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 40px;
}

.use-case-card p {
  font-size: 21px;
  font-weight: 600;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* Note Card */
.note-card {
  background: var(--bg-secondary);
  border-radius: var(--radius);
  padding: 36px 40px;
  max-width: 640px;
  margin: 0 auto;
}

.note-card h3 {
  font-size: 24px;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--text);
}

.note-card p {
  font-size: 19px;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* Disclaimer */
.disclaimer {
  text-align: center;
  padding: 40px;
  font-size: 16px;
  color: var(--text-tertiary);
  border-top: 1px solid var(--border-light);
}

/* Footer */
.landing-footer {
  text-align: center;
  padding: 32px 40px;
  font-size: 16px;
  color: var(--text-tertiary);
}

/* ═══════════════════════════════════════════
   Editor Page
   ═══════════════════════════════════════════ */

.editor-app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  background: var(--bg-secondary);
}

/* Editor Toolbar */
.editor-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  height: 56px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  z-index: 50;
}

.editor-toolbar .brand {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 6px;
}

.editor-toolbar .brand:hover { text-decoration: none; }

.toolbar-group {
  display: flex;
  align-items: center;
  gap: 2px;
}

.tb-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 15px;
  font-family: var(--font);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.tb-btn:hover:not(:disabled) {
  background: var(--bg-tertiary);
  color: var(--text);
}

.tb-btn:disabled {
  opacity: 0.3;
  cursor: default;
}

.tb-btn.active {
  background: #e3f0ff;
  color: var(--accent);
}

.tb-btn svg { flex-shrink: 0; }

.tb-divider {
  width: 1px;
  height: 22px;
  background: var(--border);
  margin: 0 4px;
}

/* Page Navigation */
.page-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.page-nav button {
  width: 30px;
  height: 30px;
  border: 1px solid var(--border);
  background: var(--bg);
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: all 0.15s;
}

.page-nav button:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent);
}

.page-nav button:disabled {
  opacity: 0.3;
  cursor: default;
}

.page-nav .page-info {
  font-size: 13px;
  color: var(--text-tertiary);
  min-width: 70px;
  text-align: center;
}

/* Canvas Area */
.canvas-area {
  flex: 1;
  overflow: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px 32px 32px;
  position: relative;
}

.editor-tip {
  font-size: 15px;
  color: var(--text-tertiary);
  text-align: center;
  padding: 10px 16px;
  margin-bottom: 12px;
  background: var(--bg);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  width: 100%;
  max-width: 600px;
}

.canvas-wrapper {
  position: relative;
  box-shadow: var(--shadow-lg);
  border-radius: 2px;
  background: #fff;
}

#pdf-canvas {
  display: block;
  border-radius: 2px;
}

#overlay-canvas {
  position: absolute;
  top: 0;
  left: 0;
  cursor: crosshair;
  border-radius: 2px;
}

/* Properties Panel */
.props-panel {
  position: fixed;
  right: 16px;
  top: 72px;
  width: 240px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  z-index: 60;
  display: none;
}

.props-panel.visible { display: block; }

.props-panel h4 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
}

.prop-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.prop-row label {
  font-size: 14px;
  color: var(--text-secondary);
  min-width: 48px;
}

.prop-row input[type="text"],
.prop-row select {
  flex: 1;
  padding: 7px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-family: var(--font);
  outline: none;
  background: var(--bg);
  color: var(--text);
}

.prop-row input[type="text"]:focus,
.prop-row select:focus {
  border-color: var(--accent);
}

.prop-row input[type="color"] {
  width: 34px;
  height: 30px;
  padding: 2px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.prop-row input[type="number"] {
  width: 64px;
  padding: 7px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-family: var(--font);
  outline: none;
  background: var(--bg);
  color: var(--text);
}

.prop-row input[type="number"]:focus {
  border-color: var(--accent);
}

.prop-actions {
  display: flex;
  gap: 6px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border-light);
}

.prop-actions button {
  flex: 1;
  padding: 7px 0;
  border: 1px solid var(--border);
  background: var(--bg);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-family: var(--font);
  cursor: pointer;
  transition: all 0.15s;
}

.prop-actions .btn-delete {
  color: #ff3b30;
  border-color: #ff3b30;
}

.prop-actions .btn-delete:hover {
  background: #ff3b30;
  color: #fff;
}

/* Text Popup */
.text-popup {
  position: absolute;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  box-shadow: var(--shadow-lg);
  z-index: 100;
  display: none;
  min-width: 280px;
}

.text-popup.visible { display: block; }

.text-popup input[type="text"] {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 15px;
  outline: none;
  margin-bottom: 8px;
  font-family: var(--font);
}

.text-popup input[type="text"]:focus {
  border-color: var(--accent);
}

.text-popup-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.text-popup-row select,
.text-popup-row input[type="number"] {
  padding: 5px 6px;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 13px;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
}

.text-popup-row input[type="color"] {
  width: 30px;
  height: 28px;
  padding: 1px;
  border: 1px solid var(--border);
  border-radius: 4px;
  cursor: pointer;
}

.popup-actions {
  display: flex;
  gap: 6px;
  margin-top: 10px;
  justify-content: flex-end;
}

.popup-actions button {
  padding: 6px 16px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: var(--font);
  cursor: pointer;
}

.popup-actions .btn-ok {
  background: var(--accent);
  color: #fff;
}

.popup-actions .btn-cancel {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
}

/* Upload Zone */
.upload-zone {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.upload-card {
  text-align: center;
  padding: 56px 72px;
  border: 2px dashed var(--border);
  border-radius: 20px;
  background: var(--bg);
  transition: all 0.2s;
  cursor: pointer;
}

.upload-card:hover,
.upload-card.dragover {
  border-color: var(--accent);
  background: #f0f7ff;
}

.upload-card svg { margin-bottom: 16px; color: var(--text-tertiary); }

.upload-card h3 {
  font-size: 22px;
  font-weight: 500;
  margin-bottom: 6px;
  color: var(--text);
}

.upload-card p {
  font-size: 16px;
  color: var(--text-tertiary);
  margin-bottom: 4px;
}

.upload-card .privacy {
  font-size: 14px;
  color: var(--text-tertiary);
  margin-top: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

/* Status bar */
.status-bar {
  height: 30px;
  background: var(--bg);
  border-top: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  font-size: 14px;
  color: var(--text-tertiary);
  flex-shrink: 0;
}

.status-bar-right {
  display: flex;
  align-items: center;
  gap: 6px;
}

.status-feedback {
  color: var(--text-tertiary);
  text-decoration: none;
  transition: color 0.15s;
}

.status-feedback:hover {
  color: var(--accent);
  text-decoration: underline;
}

.backup-download {
  color: var(--accent);
  text-decoration: underline;
  font-size: 14px;
  cursor: pointer;
}

/* Section Subtitle */
.section-subtitle {
  text-align: center;
  font-size: 20px;
  color: var(--text-tertiary);
  margin-top: 0;
  margin-bottom: 44px;
  line-height: 1.45;
}

/* Use Case Description */
.use-case-desc {
  font-size: 16px !important;
  font-weight: 400 !important;
  color: var(--text-tertiary) !important;
  margin-top: 6px;
}

/* ═══════════════════════════════════════════
   Responsive
   ═══════════════════════════════════════════ */

@media (max-width: 900px) {
  .advantages {
    grid-template-columns: repeat(2, 1fr);
  }
  .use-cases {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .hero { padding: 120px 24px 48px; }
  .hero h1 { font-size: 44px; letter-spacing: -0.8px; }
  .hero .subtitle { font-size: 21px; }
  .hero-highlight { font-size: 18px; }
  .hero .cta-btn { padding: 14px 32px; font-size: 18px; }
  .section { padding: 56px 24px; }
  .section h2 { font-size: 32px; }
  .section-subtitle { font-size: 17px; margin-top: 0; }
  .landing-nav { padding: 0 20px; }
  .advantages { padding: 16px 24px 48px; gap: 16px; }
  .advantage-card { padding: 24px 20px; }
  .advantage-card h3 { font-size: 18px; }
  .advantage-card p { font-size: 16px; }
  .use-cases { grid-template-columns: 1fr; max-width: 400px; }
  .steps { flex-direction: column; align-items: center; gap: 24px; }
  .editor-toolbar { padding: 0 10px; }
  .tb-btn span { display: none; }
  .tb-btn { padding: 8px; }
  .canvas-area { padding: 12px; }
  .props-panel { right: 8px; width: 200px; }
}

@media (max-width: 480px) {
  .advantages { grid-template-columns: 1fr; }
  .hero h1 { font-size: 36px; }
}
