/* =========================
   Base + Layout
========================== */
* { box-sizing: border-box; }
body {
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: #0f172a;
  color: #e2e8f0;
  margin: 0;
  padding: 18px;
  display: flex;
  justify-content: center;
  min-height: 100vh;
}
.container {
  width: 980px;
  max-width: 100%;
  background: rgba(2,6,23,0.55);
  border: 1px solid rgba(148,163,184,0.22);
  border-radius: 16px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.35);
  padding: 18px;
}
.header { text-align: center; padding: 8px 10px 14px; }
.title { font-weight: 900; font-size: 1.55rem; color: #38bdf8; margin: 0; }
.subtitle {
  margin: 8px 0 0;
  color: #94a3b8;
  font-size: 0.92rem;
  line-height: 1.35;
}

/* =========================
   File Drop Zone
========================== */
.drop-zone {
  margin-top: 14px;
  border: 2px dashed rgba(148,163,184,0.38);
  border-radius: 14px;
  padding: 16px;
  text-align: center;
  background: rgba(2,6,23,0.25);
  cursor: pointer;
  user-select: none;
  transition: 0.15s ease;
}
.drop-zone.dragover {
  border-color: #38bdf8;
  background: rgba(56,189,248,0.08);
}
.file-btn {
  display: inline-block;
  padding: 10px 14px;
  border-radius: 12px;
  background: #38bdf8;
  color: #061225;
  font-weight: 900;
}
input[type="file"] { display: none; }

.status {
  margin-top: 10px;
  font-size: 0.9rem;
  color: #94a3b8;
  min-height: 1.3em;
  word-break: break-word;
}
.status.ok { color: #86efac; }
.status.warn { color: #fde68a; }
.status.err { color: #fca5a5; }

/* =========================
   Sections
========================== */
.section {
  margin-top: 14px;
  border: 1px solid rgba(148,163,184,0.2);
  border-radius: 14px;
  background: rgba(2,6,23,0.18);
  padding: 14px;
}
.section-title {
  margin: 0 0 10px;
  font-weight: 900;
  border-left: 4px solid #38bdf8;
  padding-left: 10px;
}
.hint {
  color: #94a3b8;
  font-size: 0.82rem;
  line-height: 1.35;
  margin-top: 8px;
}
.mini {
  font-size: 0.82rem;
  color: #94a3b8;
}
.divider {
  height: 1px;
  background: rgba(148,163,184,0.18);
  margin: 12px 0;
}

/* =========================
   Grid: prevents overlap
========================== */
.grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  align-items: end;
}
@media (max-width: 900px) {
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* =========================
   Result Grid with Flex
========================== */
.grid-results {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  flex-wrap: wrap;
}

.field label {
  display: block;
  font-size: 0.82rem;
  color: #cbd5e1;
  margin: 0 0 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

input[type="number"], input[type="text"], select, textarea {
  width: 100%;
  min-width: 0;
  border-radius: 12px;
  border: 1px solid rgba(148,163,184,0.25);
  background: rgba(2,6,23,0.62);
  color: #e2e8f0;
  padding: 10px 12px;
  font-size: 0.95rem;
  outline: none;
  transition: all 0.2s ease;
}
input:focus, select:focus, textarea:focus {
  border-color: #38bdf8;
  box-shadow: 0 0 8px rgba(56,189,248,0.3);
}
textarea {
  resize: vertical;
  min-height: 160px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  line-height: 1.35;
}
input::placeholder, textarea::placeholder { color: rgba(148,163,184,0.6); }

/* =========================
   Buttons - WITH PRESS FEEDBACK
========================== */
.row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
}

button {
  border: 0;
  border-radius: 14px;
  padding: 12px 14px;
  font-weight: 900;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
  position: relative;
  overflow: hidden;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Hover Effect */
button:hover {
  filter: brightness(1.08);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

/* Press Effect (active state) */
button:active {
  transform: translateY(0px);
  box-shadow: 0 2px 8px rgba(0,0,0,0.5) inset;
  filter: brightness(0.95);
}

/* Ripple Effect on Click */
button::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  transform: translate(-50%, -50%);
  pointer-events: none;
}

button:active::before {
  animation: ripple 0.6s ease-out;
}

@keyframes ripple {
  to {
    width: 300px;
    height: 300px;
    opacity: 0;
  }
}

.btn-primary { 
  background: #38bdf8; 
  color: #061225; 
  flex: 1 1 200px;
  min-width: 200px;
}

.btn-ghost {
  background: rgba(148,163,184,0.12);
  color: #e2e8f0;
  border: 1px solid rgba(148,163,184,0.2);
  flex: 1 1 200px;
  min-width: 200px;
}

.btn-danger { 
  background: #fb7185; 
  color: #2b0b12; 
  flex: 1 1 200px;
  min-width: 200px;
}

.btn-success { 
  background: #10b981; 
  color: #052e1b; 
  width: 100%;
  margin-top: 15px;
}

/* =========================
   Result fields + copy
========================== */
.result-wrap {
  display: flex;
  gap: 8px;
  align-items: center;
  width: 100%;
  min-width: 0;
}
.copy-btn {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(148,163,184,0.16);
  border: 1px solid rgba(148,163,184,0.25);
  color: #e2e8f0;
  font-weight: 900;
  flex: 0 0 auto;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: auto;
  min-height: auto;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  flex-wrap: wrap;
}
.checkbox-row label { color: #cbd5e1; font-size: 0.9rem; }

.checkbox-row input[type="checkbox"] {
  width: auto;
  min-width: auto;
  cursor: pointer;
}

/* =========================
   Result Field Sizing with Flex
========================== */
.field.field-large {
  flex: 1.3;
  min-width: 150px;
}

.field.field-small {
  flex: 0.7;
  min-width: 80px;
}