/* ── BASTIAN TECHNOLOGIES — DESIGN SYSTEM ── */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #050a07;
  --bg-2: #0a0f0d;
  --bg-card: rgba(16,185,129,0.04);
  --border: rgba(16,185,129,0.13);
  --border-hover: rgba(16,185,129,0.4);
  --primary: #10b981;
  --accent: #14b8a6;
  --text: #ecfdf5;
  --text-muted: #6b7280;
  --text-dim: #9ca3af;
  --glow: rgba(16,185,129,0.18);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
}

html { scroll-behavior: smooth; }
body { background: var(--bg); color: var(--text); font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; line-height: 1.6; -webkit-font-smoothing: antialiased; }

/* ── TYPOGRAPHY ── */
h1 { font-size: clamp(2rem, 5vw, 3.8rem); font-weight: 800; line-height: 1.1; letter-spacing: -0.03em; }
h2 { font-size: clamp(1.4rem, 3vw, 2rem); font-weight: 700; }
h3 { font-size: 1.1rem; font-weight: 600; }
p { color: var(--text-dim); }

.gradient-text {
  background: linear-gradient(135deg, #10b981, #14b8a6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── NAV ── */
.bt-nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 48px; height: 64px;
  background: rgba(5,10,7,0.85); backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}
.bt-logo { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--text); font-size: 0.95rem; font-weight: 700; }
.bt-logo em { color: var(--primary); font-style: normal; }
.bt-nav-links { display: flex; gap: 32px; }
.bt-nav-links a { font-size: 0.875rem; color: var(--text-muted); text-decoration: none; transition: color 0.2s; }
.bt-nav-links a:hover { color: var(--text); }
.bt-nav-right { display: flex; align-items: center; gap: 12px; }
.bt-hamburger { display: none; flex-direction: column; gap: 5px; background: none; border: none; cursor: pointer; padding: 4px; }
.bt-hamburger span { display: block; width: 22px; height: 2px; background: var(--text-dim); border-radius: 2px; transition: all 0.2s; }

/* Mobile nav */
@media (max-width: 768px) {
  .bt-nav { padding: 0 20px; }
  .bt-nav-links, .bt-nav-right { display: none; }
  .bt-hamburger { display: flex; }
  .bt-nav.open .bt-nav-links {
    display: flex; flex-direction: column; gap: 0;
    position: fixed; top: 64px; left: 0; right: 0; bottom: 0;
    background: var(--bg-2); padding: 24px; border-top: 1px solid var(--border);
    z-index: 99;
  }
  .bt-nav.open .bt-nav-links a { padding: 14px 0; border-bottom: 1px solid var(--border); font-size: 1rem; color: var(--text); }
  .bt-nav.open .bt-nav-right { display: flex; position: fixed; bottom: 32px; left: 20px; right: 20px; z-index: 99; }
  .bt-nav.open .bt-nav-right .btn-primary { flex: 1; text-align: center; }
}

/* ── BUTTONS ── */
.btn-primary {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 10px 22px; border-radius: var(--radius-sm); border: none;
  background: var(--primary); color: #050a07; font-size: 0.875rem; font-weight: 600;
  text-decoration: none; cursor: pointer; transition: box-shadow 0.2s, transform 0.2s;
}
.btn-primary:hover { box-shadow: 0 0 24px var(--glow); transform: translateY(-1px); }
.btn-primary.lg { padding: 14px 32px; font-size: 1rem; font-weight: 700; }

.btn-ghost {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 10px 18px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: transparent;
  color: var(--text-dim); font-size: 0.875rem; text-decoration: none; cursor: pointer;
  transition: border-color 0.2s, color 0.2s, transform 0.2s;
}
.btn-ghost:hover { border-color: var(--primary); color: var(--text); transform: translateY(-1px); }
.btn-ghost.lg { padding: 14px 28px; font-size: 1rem; }

.btn-danger {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 8px 16px; border-radius: var(--radius-sm); border: 1px solid rgba(239,68,68,0.3);
  background: transparent; color: #ef4444; font-size: 0.82rem; cursor: pointer;
}

/* ── CARDS ── */
.card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
}
.card-header {
  padding: 14px 20px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.card-title { font-size: 0.78rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-muted); }
.card-body { padding: 20px; }

/* ── FORM ELEMENTS ── */
.bt-input {
  width: 100%; padding: 10px 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: rgba(16,185,129,0.03);
  color: var(--text); font-size: 0.9rem; outline: none; transition: border-color 0.2s;
}
.bt-input:focus { border-color: var(--primary); }
.bt-input::placeholder { color: var(--text-muted); }
.bt-label { display: block; font-size: 0.78rem; color: var(--text-muted); letter-spacing: .06em; text-transform: uppercase; margin-bottom: 8px; }
.bt-select { appearance: none; }
textarea.bt-input { font-family: inherit; resize: vertical; min-height: 120px; line-height: 1.5; }

/* ── UPLOAD ZONE ── */
.upload-zone {
  border: 2px dashed var(--border); border-radius: var(--radius); padding: 48px 24px;
  text-align: center; cursor: pointer; transition: border-color 0.2s, background 0.2s;
}
.upload-zone:hover, .upload-zone.dragover { border-color: var(--primary); background: rgba(16,185,129,0.02); }
.upload-zone__title { font-size: 1rem; font-weight: 500; margin-bottom: 6px; color: var(--text); }
.upload-zone__hint { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 16px; }

/* ── PROGRESS BAR ── */
.progress-wrap { margin-top: 16px; }
.progress-meta { display: flex; justify-content: space-between; font-size: 0.8rem; color: var(--text-muted); margin-bottom: 8px; }
.progress-bar { height: 4px; background: rgba(16,185,129,0.1); border-radius: 999px; overflow: hidden; }
.progress-fill { height: 100%; background: linear-gradient(90deg, #10b981, #14b8a6); border-radius: 999px; transition: width 0.3s; }

/* ── FILE LIST ── */
.file-list { display: flex; flex-direction: column; gap: 8px; }
.file-item {
  display: flex; align-items: center; gap: 12px; padding: 10px 14px;
  border-radius: 9px; background: rgba(16,185,129,0.03); border: 1px solid var(--border);
}
.file-item__num {
  width: 22px; height: 22px; border-radius: 6px; background: rgba(16,185,129,0.12);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.7rem; font-weight: 700; color: var(--primary); flex-shrink: 0;
}
.file-item__name { font-size: 0.85rem; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-item__size { font-size: 0.75rem; color: var(--text-muted); flex-shrink: 0; }
.file-item__remove { width: 24px; height: 24px; border-radius: 6px; border: 1px solid var(--border); background: transparent; color: var(--text-muted); cursor: pointer; display: flex; align-items: center; justify-content: center; flex-shrink: 0; transition: border-color 0.2s, color 0.2s; font-size: 0.75rem; }
.file-item__remove:hover { border-color: #ef4444; color: #ef4444; }

/* ── RESULT CARD ── */
.result-card {
  background: rgba(16,185,129,0.06); border: 1px solid rgba(16,185,129,0.25);
  border-radius: var(--radius); padding: 18px 20px;
  display: flex; align-items: center; gap: 16px;
}
.result-card__info { flex: 1; min-width: 0; }
.result-card__name { font-weight: 600; font-size: 0.95rem; }
.result-card__meta { font-size: 0.78rem; color: var(--text-muted); margin-top: 2px; }

/* ── ERROR CARD ── */
.error-card {
  background: rgba(239,68,68,0.06); border: 1px solid rgba(239,68,68,0.25);
  border-radius: var(--radius); padding: 16px 18px;
  display: flex; align-items: flex-start; gap: 12px; color: #fca5a5;
  font-size: 0.88rem;
}

/* ── FEATURES GRID ── */
.features-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
@media (max-width: 768px) { .features-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .features-grid { grid-template-columns: 1fr; } }
.feature-card { padding: 16px; border-radius: var(--radius); background: var(--bg-card); border: 1px solid var(--border); }
.feature-card__icon { width: 32px; height: 32px; border-radius: 8px; background: rgba(16,185,129,0.1); display: flex; align-items: center; justify-content: center; margin-bottom: 10px; }
.feature-card__title { font-size: 0.85rem; font-weight: 600; margin-bottom: 4px; color: var(--text); }
.feature-card__desc { font-size: 0.75rem; color: var(--text-muted); line-height: 1.5; }

/* ── API CODE BLOCK ── */
.api-section { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.api-tabs { display: flex; border-bottom: 1px solid var(--border); overflow-x: auto; }
.api-tab { padding: 10px 20px; font-size: 0.82rem; color: var(--text-muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; flex-shrink: 0; background: none; border-left: none; border-right: none; border-top: none; }
.api-tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.api-body { padding: 20px; }
.code-block { background: #020604; border-radius: 9px; padding: 16px; font-family: 'Courier New', Courier, monospace; font-size: 0.75rem; line-height: 1.8; overflow-x: auto; color: var(--text); white-space: pre; }
.c-method { color: #14b8a6; } .c-url { color: #ecfdf5; } .c-key { color: #10b981; } .c-val { color: #a3e635; } .c-comment { color: #4b5563; }

/* ── BADGE ── */
.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 0.72rem; letter-spacing: .06em; }
.badge-primary { background: rgba(16,185,129,0.1); border: 1px solid rgba(16,185,129,0.2); color: var(--primary); }
.badge-muted { background: rgba(255,255,255,0.04); border: 1px solid var(--border); color: var(--text-muted); }

/* ── SECTION HELPERS ── */
.section-label { font-size: 0.75rem; letter-spacing: .15em; color: var(--primary); text-transform: uppercase; margin-bottom: 10px; }
.divider { border: none; border-top: 1px solid var(--border); margin: 32px 0; }
.page-container { max-width: 900px; margin: 0 auto; padding: 36px 24px 80px; }
.pt-nav { padding-top: 64px; }

/* ── BREADCRUMB ── */
.breadcrumb { display: flex; align-items: center; gap: 8px; font-size: 0.78rem; color: var(--text-muted); margin-bottom: 28px; flex-wrap: wrap; }
.breadcrumb a { color: var(--text-muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb__sep { opacity: .4; }
.breadcrumb__current { color: var(--text); }

/* ── TOOL HEADER ── */
.tool-header { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 32px; }
.tool-header__icon { width: 48px; height: 48px; border-radius: 12px; background: rgba(16,185,129,0.1); border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.tool-header__title { font-size: 1.6rem; font-weight: 700; margin-bottom: 6px; }
.tool-header__sub { color: var(--text-muted); font-size: 0.9rem; line-height: 1.6; }
@media (max-width: 480px) { .tool-header { flex-direction: column; } .tool-header__icon { width: 40px; height: 40px; } }

/* ── ACTIONS ROW ── */
.actions-row { display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
.actions-row .btn-primary { flex: 1; min-width: 140px; }
@media (max-width: 480px) { .actions-row { flex-direction: column; } .actions-row .btn-primary, .actions-row .btn-ghost { width: 100%; } }

/* ── FOOTER ── */
.bt-footer { border-top: 1px solid var(--border); padding: 32px 48px; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px; }
.bt-footer__copy { font-size: 0.8rem; color: var(--text-muted); }
.bt-footer__links { display: flex; gap: 24px; }
.bt-footer__links a { font-size: 0.8rem; color: var(--text-muted); text-decoration: none; }
.bt-footer__links a:hover { color: var(--primary); }
@media (max-width: 600px) { .bt-footer { padding: 24px 20px; justify-content: center; text-align: center; } .bt-footer__links { flex-wrap: wrap; justify-content: center; gap: 16px; } }

/* ── ANIMATIONS ── */
@keyframes fadeUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.3; } }
@keyframes float { 0% { transform: translateY(100vh) scale(0); opacity: 0; } 10% { opacity: 0.6; } 90% { opacity: 0.3; } 100% { transform: translateY(-20px) scale(1); opacity: 0; } }

.fade-up { animation: fadeUp 0.6s ease both; }
.fade-up-1 { animation: fadeUp 0.6s ease 0.1s both; }
.fade-up-2 { animation: fadeUp 0.6s ease 0.2s both; }
.fade-up-3 { animation: fadeUp 0.6s ease 0.3s both; }

/* Scroll-triggered fade (use with IntersectionObserver or Alpine.js x-intersect) */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.visible { opacity: 1; transform: translateY(0); }

/* ── OPTION CHIPS ── */
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { padding: 8px 16px; border-radius: 8px; border: 1px solid var(--border); background: transparent; color: var(--text-dim); font-size: 0.85rem; cursor: pointer; transition: all 0.2s; }
.chip.active, .chip:hover { border-color: var(--primary); background: rgba(16,185,129,0.1); color: var(--primary); }

/* ── USAGE BAR ── */
.usage-item { margin-bottom: 14px; }
.usage-item:last-child { margin-bottom: 0; }
.usage-row { display: flex; justify-content: space-between; font-size: 0.82rem; margin-bottom: 5px; }
.usage-name { color: var(--text-dim); }
.usage-count { color: var(--text); font-weight: 500; }
.usage-bar { height: 4px; background: rgba(16,185,129,0.1); border-radius: 999px; overflow: hidden; }
.usage-fill { height: 100%; background: linear-gradient(90deg, #10b981, #14b8a6); border-radius: 999px; }

/* ── ALPINE HIDE/SHOW ── */
[x-cloak] { display: none !important; }

/* ── ADDITIONAL MOBILE ── */
@media (max-width: 480px) {
  .page-container { padding: 24px 16px 60px; }
  .result-card { flex-direction: column; align-items: flex-start; gap: 12px; }
  .api-tabs { gap: 0; }
  .api-tab { padding: 10px 14px; font-size: 0.78rem; }
  .bt-nav { padding: 0 16px; }
  .upload-zone { padding: 32px 16px; }
}
