/* ═══════════════════════════════════════════════════════
   NeoCalculator.net — Responsive & Theme-Aware Scientific Calculator
   ═══════════════════════════════════════════════════════ */

@import url('/css/percent-calculator-22ddf0d06da58bee5476ea4f3d55f776.css');

.stat-container {
  padding-top: 25px;
  padding-bottom: 50px;
}

/* ── Calculator Device Container ── */
.calc-device {
  max-width: 520px;
  width: 100%;
  margin: 0 auto 25px auto;
  background: #1e293b;
  border-radius: 18px;
  padding: 20px;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3), inset 0 1px 1px rgba(255, 255, 255, 0.1);
  border: 1px solid #334155;
  box-sizing: border-box;
}

/* ── Screen Display Area ── */
.calc-screen-container {
  background: #0f172a !important;
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 18px;
  border: 1px solid #1e293b;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.6);
}

.calc-screen-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #38bdf8;
  font-family: monospace, monospace;
  font-size: 0.85rem;
  margin-bottom: 6px;
  font-weight: 600;
}

/* Text Visibility Fix on Focus & Click */
.calc-display {
  width: 100%;
  background: transparent !important;
  border: none !important;
  color: #f8fafc !important;
  font-family: 'Consolas', 'Courier New', monospace;
  font-size: clamp(1rem, 4vw, 1.3rem);
  font-weight: 600;
  resize: none;
  outline: none !important;
  box-shadow: none !important;
  box-sizing: border-box;
  caret-color: #38bdf8;
}

.calc-display:focus,
.calc-display:active {
  background: transparent !important;
  color: #f8fafc !important;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
}

.calc-display::placeholder {
  color: #64748b !important;
  font-size: 0.95rem;
}

/* ── Responsive Keypad ── */
.calc-keypad {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
}

.calc-btn {
  height: 48px;
  border: none;
  border-radius: 8px;
  font-size: clamp(0.85rem, 3.2vw, 1.05rem);
  font-weight: 700;
  cursor: pointer;
  transition: all 0.12s ease-in-out;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.3);
  padding: 0;
}

.calc-btn:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.3);
}

/* Key Colors */
.calc-btn.num {
  background: #334155;
  color: #f8fafc;
}
.calc-btn.num:hover {
  background: #475569;
}

.calc-btn.fn {
  background: #0f766e;
  color: #ccfbf1;
}
.calc-btn.fn:hover {
  background: #115e59;
}

.calc-btn.primary {
  background: #2563eb;
  color: #ffffff;
}
.calc-btn.primary:hover {
  background: #1d4ed8;
}

.calc-btn.warning {
  background: #d97706;
  color: #ffffff;
}
.calc-btn.warning:hover {
  background: #b45309;
}

.calc-btn.danger {
  background: #dc2626;
  color: #ffffff;
}
.calc-btn.danger:hover {
  background: #b91c1c;
}

/* Results & Data Display Tables */
.table-responsive-wrapper {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-bottom: 15px;
  border-radius: var(--radius-sm, 8px);
}

.stat-results-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 15px;
  min-width: 280px;
}

.stat-results-table th,
.stat-results-table td {
  padding: 10px 12px;
  border: 1px solid var(--border);
  text-align: left;
  word-break: break-word;
}

.stat-results-table th {
  background: var(--bg-input);
  color: var(--text-dark);
  font-weight: 700;
}

.stat-sorted-box {
  background-color: var(--bg-input);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  font-family: monospace, monospace;
  font-size: 1rem;
  margin-top: 8px;
  color: var(--accent);
  font-weight: 600;
  word-break: break-all;
}

/* Frequency Table & Control Toggles */
.stat-mode-toggle {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  margin-bottom: 16px;
  background: var(--bg-input);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  font-weight: 600;
}

.freq-input-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 12px;
  min-width: 320px;
}

.freq-input-table th,
.freq-input-table td {
  padding: 8px 10px;
  border: 1px solid var(--border);
  text-align: center;
}

.btn-row-del {
  background: #ef4444;
  color: #ffffff;
  border: none;
  border-radius: 4px;
  width: 28px;
  height: 28px;
  cursor: pointer;
  font-weight: bold;
}

/* ── Mobile Layout Fine-Tuning ── */
@media (max-width: 600px) {
  .stat-results-table th,
  .stat-results-table td {
    padding: 8px 8px;
    font-size: 0.88rem;
  }

  .stat-mode-toggle {
    flex-direction: column;
    gap: 10px;
  }

  .table-control-btns {
    display: flex;
    gap: 8px;
  }

  .table-control-btns .btn {
    flex: 1;
    padding: 8px 10px;
    font-size: 0.85rem;
  }
}

@media (max-width: 480px) {
  .calc-device {
    padding: 12px;
    border-radius: 14px;
  }
  
  .calc-keypad {
    gap: 6px;
  }
  
  .calc-btn {
    height: 42px;
    border-radius: 6px;
  }

  .calc-screen-container {
    padding: 10px;
  }
  
  .calc-screen-header {
    font-size: 0.75rem;
  }

  .pct-action-btns {
    flex-direction: column;
    gap: 8px;
  }

  .pct-action-btns .btn {
    width: 100%;
  }
}