/* ============================================================
   TextSplit Pro — style.css
   Aesthetic: Clean industrial-utility with warm amber accents
   Fonts: Syne (display) + DM Sans (body)
   ============================================================ */

/* ---------- CSS Variables ---------- */
:root {
  --bg: #f5f3ef;
  --bg-card: #ffffff;
  --bg-card-alt: #faf9f7;
  --bg-input: #f0ede8;
  --border: #e2ddd6;
  --border-focus: #d4a853;
  --text-primary: #1a1714;
  --text-secondary: #6b6057;
  --text-muted: #9e948a;
  --accent: #d4a853;
  --accent-dark: #b8893a;
  --accent-light: #f7e9c8;
  --success: #3d9970;
  --success-dark: #2d7a57;
  --success-bg: #e8f5ee;
  --danger: #c0392b;
  --danger-bg: #fbeae8;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.07), 0 2px 6px rgba(0,0,0,0.04);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.09), 0 4px 12px rgba(0,0,0,0.05);
  --radius: 14px;
  --radius-sm: 8px;
  --radius-lg: 20px;
  --font-display: 'Syne', sans-serif;
  --font-body: 'DM Sans', sans-serif;
  --transition: 0.22s ease;
}

.dark-mode {
  --bg: #0f0e0c;
  --bg-card: #1c1a17;
  --bg-card-alt: #221f1b;
  --bg-input: #2a2621;
  --border: #332f28;
  --border-focus: #d4a853;
  --text-primary: #f0ece5;
  --text-secondary: #a89d90;
  --text-muted: #6b6057;
  --accent: #d4a853;
  --accent-dark: #e8ba6a;
  --accent-light: #2a2210;
  --success: #52b788;
  --success-dark: #74c69d;
  --success-bg: #0f2a1e;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.25);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.3);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.4);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text-primary);
  line-height: 1.6;
  font-size: 15px;
  transition: background var(--transition), color var(--transition);
  min-height: 100vh;
}

/* ---------- Utility ---------- */
.hidden { display: none !important; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
strong { font-weight: 600; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: background var(--transition), border-color var(--transition);
}

.header-inner {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 24px;
  height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 1.25rem;
  color: var(--text-primary);
  text-decoration: none;
}
.logo-icon { font-size: 1.4rem; }
.logo-text { letter-spacing: -0.02em; }
.logo-text strong { color: var(--accent); }

.header-nav {
  display: flex;
  align-items: center;
  gap: 24px;
}

.header-nav a {
  font-size: 0.875rem;
  color: var(--text-secondary);
  font-weight: 500;
  letter-spacing: 0.01em;
  transition: color var(--transition);
}
.header-nav a:hover { color: var(--accent); text-decoration: none; }

.theme-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 50px;
  padding: 6px 14px;
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
}
.theme-toggle:hover {
  background: var(--accent-light);
  border-color: var(--accent);
  color: var(--accent);
}
.toggle-icon { font-size: 0.95rem; }

/* ---------- Ad Spaces ---------- */
.ad-banner-wrap {
  max-width: 1140px;
  margin: 20px auto 0;
  padding: 0 24px;
}

.ad-placeholder {
  background: var(--bg-card);
  border: 2px dashed var(--border);
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.ad-banner {
  width: 100%;
  min-height: 90px;
  padding: 18px;
}

.ad-square {
  width: 100%;
  min-height: 250px;
  margin-bottom: 20px;
}

.ad-label { font-size: 0.75rem; font-weight: 600; }
.ad-size { font-size: 0.7rem; opacity: 0.65; }

/* ---------- Hero ---------- */
.hero {
  max-width: 1140px;
  margin: 0 auto;
  padding: 52px 24px 36px;
}

.hero-inner {
  text-align: center;
  max-width: 680px;
  margin: 0 auto;
}

.hero-badge {
  display: inline-block;
  background: var(--accent-light);
  color: var(--accent-dark);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 5px 14px;
  border-radius: 50px;
  margin-bottom: 20px;
  border: 1px solid rgba(212, 168, 83, 0.3);
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  margin-bottom: 18px;
}

.hero-title .accent {
  color: var(--accent);
  position: relative;
  display: inline-block;
}

.hero-sub {
  font-size: 1.05rem;
  color: var(--text-secondary);
  font-weight: 300;
  line-height: 1.7;
  max-width: 540px;
  margin: 0 auto;
}

/* ---------- Main Layout ---------- */
.main-layout {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 24px 60px;
}

.main-grid {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 24px;
  align-items: start;
}

/* ---------- Cards ---------- */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
  transition: background var(--transition), border-color var(--transition), box-shadow var(--transition);
}

.card:hover {
  box-shadow: var(--shadow-md);
}

.card-header {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 22px;
}

.step-badge {
  width: 40px;
  height: 40px;
  background: var(--accent);
  color: #fff;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.85rem;
  letter-spacing: 0.01em;
  flex-shrink: 0;
}

.accent-badge {
  background: var(--accent-light);
  font-size: 1.1rem;
  border: 1px solid rgba(212,168,83,0.3);
}

.card-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.card-sub {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 400;
}

/* ---------- Drop Zone ---------- */
.drop-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 40px 24px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  background: var(--bg-card-alt);
  position: relative;
  overflow: hidden;
}

.drop-zone::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 0%, rgba(212,168,83,0.06) 0%, transparent 70%);
  opacity: 0;
  transition: opacity var(--transition);
}

.drop-zone:hover::before,
.drop-zone.drag-over::before {
  opacity: 1;
}

.drop-zone:hover,
.drop-zone.drag-over {
  border-color: var(--accent);
  background: var(--accent-light);
  transform: scale(1.005);
  box-shadow: var(--shadow-md);
}

.drop-zone.drag-over {
  animation: pulse-border 1s ease infinite;
}

@keyframes pulse-border {
  0%, 100% { border-color: var(--accent); }
  50% { border-color: var(--accent-dark); box-shadow: 0 0 0 4px rgba(212,168,83,0.15); }
}

.drop-icon {
  font-size: 3rem;
  margin-bottom: 14px;
  display: block;
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

.drop-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.drop-sub {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.hidden-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

/* ---------- File Info Box ---------- */
.file-info-box {
  margin-top: 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--bg-card-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  transition: all var(--transition);
  animation: slideIn 0.3s ease;
}

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

.file-info-icon { font-size: 1.6rem; flex-shrink: 0; }

.file-info-details {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.file-name {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.btn-icon {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 1rem;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  flex-shrink: 0;
}

.btn-icon:hover {
  background: var(--danger-bg);
  color: var(--danger);
}

/* ---------- Mode Tabs ---------- */
.mode-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}

.mode-tab {
  flex: 1;
  min-width: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card-alt);
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: 0.83rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
}

.mode-tab .mode-icon { font-size: 1rem; }

.mode-tab:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-light);
}

.mode-tab.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 3px 10px rgba(212,168,83,0.3);
}

/* ---------- Mode Panels ---------- */
.mode-panel { display: none; }
.mode-panel.active { display: block; animation: fadeUp 0.25s ease; }

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

/* ---------- Form Controls ---------- */
.form-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.input-group {
  display: flex;
  align-items: center;
  background: var(--bg-input);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  transition: all var(--transition);
}

.input-group:focus-within {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(212,168,83,0.15);
  background: var(--bg-card);
}

.form-input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  padding: 12px 14px;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-primary);
  min-width: 0;
}

.form-input::placeholder { color: var(--text-muted); font-weight: 400; }

.input-suffix {
  padding: 12px 14px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
  border-left: 1px solid var(--border);
  background: var(--bg-card-alt);
}

.hint {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 8px;
  line-height: 1.5;
}

/* ---------- Stats Grid ---------- */
.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.stat-item {
  background: var(--bg-card-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: all var(--transition);
}

.stat-item:hover {
  border-color: var(--accent);
  background: var(--accent-light);
}

.stat-icon { font-size: 1.2rem; }

.stat-value {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.4rem;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
  letter-spacing: 0.02em;
}

/* ---------- Progress Bar ---------- */
.progress-wrap {
  margin-bottom: 20px;
  animation: fadeUp 0.3s ease;
}

.progress-track {
  width: 100%;
  height: 8px;
  background: var(--bg-input);
  border-radius: 50px;
  overflow: hidden;
  margin-bottom: 8px;
}

.progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent-dark));
  border-radius: 50px;
  transition: width 0.15s ease;
  position: relative;
  overflow: hidden;
}

.progress-bar::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  animation: shimmer 1.2s ease infinite;
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(200%); }
}

.progress-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
  text-align: center;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 26px;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.93rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  letter-spacing: 0.01em;
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.15);
  opacity: 0;
  transition: opacity var(--transition);
}

.btn:hover::before { opacity: 1; }

.btn:active { transform: scale(0.97); }

.btn-icon { font-size: 1rem; }

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: #fff;
  box-shadow: 0 4px 14px rgba(212,168,83,0.35);
}

.btn-primary:hover {
  box-shadow: 0 6px 20px rgba(212,168,83,0.45);
  transform: translateY(-1px);
}

.btn-primary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-success {
  background: linear-gradient(135deg, var(--success), var(--success-dark));
  color: #fff;
  box-shadow: 0 4px 14px rgba(61,153,112,0.3);
}

.btn-success:hover {
  box-shadow: 0 6px 20px rgba(61,153,112,0.4);
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent;
  border: 1.5px solid var(--border);
  color: var(--text-secondary);
}

.btn-outline:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-light);
}

.action-buttons {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.action-buttons .btn {
  flex: 1;
  min-width: 160px;
}

/* ---------- Output File List ---------- */
.output-list {
  margin-top: 22px;
  animation: fadeUp 0.3s ease;
}

.output-list-title {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.output-file-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 280px;
  overflow-y: auto;
  padding-right: 4px;
}

.output-file-list::-webkit-scrollbar { width: 4px; }
.output-file-list::-webkit-scrollbar-track { background: var(--bg-input); border-radius: 4px; }
.output-file-list::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.output-file-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: var(--bg-card-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 0.84rem;
  transition: all var(--transition);
  animation: slideIn 0.2s ease;
}

.output-file-item:hover {
  border-color: var(--success);
  background: var(--success-bg);
}

.output-file-name {
  font-weight: 600;
  color: var(--text-primary);
  flex: 1;
}

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

.output-file-dl {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--success);
  cursor: pointer;
  background: var(--success-bg);
  border: 1px solid rgba(61,153,112,0.25);
  border-radius: 6px;
  padding: 3px 10px;
  transition: all var(--transition);
}

.output-file-dl:hover {
  background: var(--success);
  color: #fff;
  border-color: var(--success);
}

/* ---------- Sidebar ---------- */
.sidebar-column {
  position: sticky;
  top: 80px;
}

.sidebar-section-title {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  margin-bottom: 18px;
}

/* ---------- How to Use ---------- */
.how-to-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.how-to-list li {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.how-num {
  width: 26px;
  height: 26px;
  background: var(--accent);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 800;
  flex-shrink: 0;
  margin-top: 1px;
}

.how-to-list strong {
  display: block;
  font-size: 0.88rem;
  color: var(--text-primary);
  margin-bottom: 3px;
}

.how-to-list p {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* ---------- Features List ---------- */
.features-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.features-list li {
  font-size: 0.84rem;
  color: var(--text-secondary);
  padding: 7px 0;
  border-bottom: 1px solid var(--border);
  transition: color var(--transition);
}

.features-list li:last-child { border-bottom: none; }
.features-list li:hover { color: var(--text-primary); }

/* ---------- Toast Notifications ---------- */
.toast-container {
  position: fixed;
  bottom: 28px;
  right: 24px;
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 18px;
  min-width: 260px;
  max-width: 340px;
  box-shadow: var(--shadow-lg);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-primary);
  pointer-events: all;
  animation: toastIn 0.35s cubic-bezier(0.34,1.56,0.64,1);
  border-left: 4px solid var(--accent);
}

.toast.toast-success { border-left-color: var(--success); }
.toast.toast-error { border-left-color: var(--danger); }

@keyframes toastIn {
  from { opacity: 0; transform: translateX(40px) scale(0.9); }
  to { opacity: 1; transform: translateX(0) scale(1); }
}

.toast-icon { font-size: 1.1rem; flex-shrink: 0; }
.toast-msg { flex: 1; line-height: 1.4; }

.toast-out {
  animation: toastOut 0.3s ease forwards;
}

@keyframes toastOut {
  to { opacity: 0; transform: translateX(40px) scale(0.9); }
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  padding: 28px 24px;
  text-align: center;
  transition: background var(--transition), border-color var(--transition);
}

.footer-inner {
  max-width: 1140px;
  margin: 0 auto;
}

.footer-privacy {
  font-size: 0.83rem;
  color: var(--text-secondary);
  font-weight: 500;
  margin-bottom: 6px;
}

.footer-copy {
  font-size: 0.76rem;
  color: var(--text-muted);
}

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

  .sidebar-column {
    position: static;
    order: 2;
  }

  .tool-column {
    order: 1;
  }

  .ad-square {
    min-height: 180px;
  }
}

@media (max-width: 640px) {
  .header-nav a { display: none; }

  .hero {
    padding: 36px 16px 24px;
  }

  .main-layout {
    padding: 0 16px 48px;
  }

  .card {
    padding: 20px;
  }

  .stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .mode-tabs {
    flex-direction: column;
  }

  .mode-tab {
    min-width: unset;
  }

  .action-buttons {
    flex-direction: column;
  }

  .action-buttons .btn {
    min-width: unset;
    flex: none;
    width: 100%;
  }
}

@media (max-width: 400px) {
  .hero-title { font-size: 1.8rem; }
}
