/* ========================================
   Hashonomics - Password Cracking Cost Calculator
   Clean & Compact White Theme
   ======================================== */

/* CSS Variables */
:root {
  --bg-primary: #ffffff;
  --bg-secondary: #f8f9fa;
  --bg-tertiary: #f1f3f5;

  --text-primary: #1a1a2e;
  --text-secondary: #495057;
  --text-muted: #868e96;

  --accent-primary: #f7931a;
  --accent-secondary: #e88a17;
  --accent-light: #fff8f0;

  --border-color: #dee2e6;
  --border-hover: #f7931a;

  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.08);

  --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
}

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

body {
  font-family: var(--font-primary);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.5;
  font-size: 14px;
}

/* Container */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px 24px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */
.header {
  padding: 8px 0 16px;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 20px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-icon {
  font-size: 1.75rem;
  color: var(--accent-primary);
}

.logo h1 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

/* Main Content */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Config Section */
.config-section {
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  border: 1px solid var(--border-color);
}

/* Primary Config Row */
.primary-config {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  align-items: flex-start;
}

.config-block {
  flex: 1;
  min-width: 200px;
}

.block-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.block-title .hint {
  font-size: 11px;
  font-weight: 400;
  color: var(--text-muted);
  text-transform: none;
}

.config-block-wide {
  flex-basis: 100%;
}

/* Chips (Checkbox Labels) */
.checkbox-inline,
.multiplier-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip {
  cursor: pointer;
}

.chip input {
  display: none;
}

.chip span {
  display: inline-block;
  padding: 6px 12px;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all 0.15s ease;
  font-family: var(--font-mono);
}

.chip:hover span {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}

.chip input:checked+span {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  color: white;
}

.charset-info {
  margin-top: 8px;
  font-size: 12px;
  color: var(--text-muted);
}

.charset-info strong {
  color: var(--accent-primary);
  font-family: var(--font-mono);
}

/* Length Grid */
.length-grid {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 4px;
  margin-bottom: 8px;
}

@media (max-width: 600px) {
  .length-grid {
    grid-template-columns: repeat(5, 1fr);
  }
}

.length-btn {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.length-btn:hover {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}

.length-btn.active {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  color: white;
}

.length-shortcuts {
  display: flex;
  gap: 4px;
}

.length-shortcuts button {
  padding: 4px 8px;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 11px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
}

.length-shortcuts button:hover {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}

.length-shortcuts .btn-clear {
  color: var(--danger);
}

.length-shortcuts .btn-clear:hover {
  border-color: var(--danger);
  color: var(--danger);
}

/* Advanced Config (Collapsible) */
.advanced-config {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--border-color);
}

.advanced-config summary {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-muted);
  list-style: none;
  user-select: none;
}

.advanced-config summary::-webkit-details-marker {
  display: none;
}

.advanced-config summary:hover {
  color: var(--accent-primary);
}

.summary-icon {
  font-size: 14px;
}

.summary-arrow {
  margin-left: auto;
  font-size: 10px;
  transition: transform 0.2s ease;
}

.advanced-config[open] .summary-arrow {
  transform: rotate(180deg);
}

.advanced-content {
  padding-top: 12px;
}

.input-inline {
  display: flex;
  gap: 16px;
}

.input-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.input-field label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

.input-wrap {
  display: flex;
  align-items: center;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.input-wrap:focus-within {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 2px rgba(247, 147, 26, 0.1);
}

.input-wrap input {
  width: 80px;
  padding: 6px 10px;
  border: none;
  background: transparent;
  font-size: 13px;
  font-family: var(--font-mono);
  color: var(--text-primary);
  outline: none;
}

.input-wrap .unit {
  padding: 6px 10px;
  background: var(--bg-tertiary);
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

/* Calculate Button */
.btn-calculate {
  margin-top: 16px;
  padding: 10px 32px;
  background: var(--accent-primary);
  border: none;
  border-radius: var(--radius-md);
  color: white;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-calculate:hover {
  background: var(--accent-secondary);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(247, 147, 26, 0.3);
}

.btn-calculate:active {
  transform: translateY(0);
}

/* Results Section */
.results-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

/* Stats Bar */
.stats-bar {
  display: flex;
  gap: 24px;
  padding: 12px 20px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
}

.stat {
  display: flex;
  align-items: center;
  gap: 8px;
}

.stat-label {
  font-size: 12px;
  color: var(--text-muted);
}

.stat-value {
  font-size: 14px;
  font-weight: 600;
  color: var(--accent-primary);
  font-family: var(--font-mono);
}

/* Table Wrapper */
.table-wrapper {
  flex: 1;
  overflow-x: auto;
  padding: 0;
}

.placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  color: var(--text-muted);
  text-align: center;
}

.placeholder-icon {
  font-size: 2.5rem;
  margin-bottom: 12px;
  opacity: 0.5;
}

.placeholder p {
  font-size: 14px;
}

/* Result Table */
.result-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.result-table th,
.result-table td {
  padding: 10px 14px;
  text-align: right;
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}

.result-table th:first-child,
.result-table td:first-child {
  text-align: left;
  padding-left: 20px;
}

.result-table th:last-child,
.result-table td:last-child {
  padding-right: 20px;
}

.result-table thead {
  background: var(--bg-tertiary);
  position: sticky;
  top: 0;
}

.result-table th {
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.result-table tbody tr:hover {
  background: var(--accent-light);
}

.result-table td {
  font-family: var(--font-mono);
  color: var(--text-primary);
}

.result-table td:first-child {
  font-family: var(--font-primary);
  font-weight: 500;
}

/* Cell Styles */
.cell-length {
  color: var(--accent-primary) !important;
  font-weight: 600 !important;
}

.cell-combinations {
  font-size: 12px;
  color: var(--text-secondary) !important;
}

.cell-time {
  color: var(--warning) !important;
}

.cell-cost {
  color: var(--success) !important;
}

.cell-impossible {
  color: var(--danger) !important;
  font-style: italic;
}

/* Multiplier Header */
.multiplier-header {
  background: var(--accent-light) !important;
  color: var(--accent-primary) !important;
}

/* Total Row */
.total-row {
  background: var(--bg-secondary);
  font-weight: 600;
}

.total-row td {
  border-top: 2px solid var(--accent-primary);
}

/* Footer */
.footer {
  padding: 16px 0;
  text-align: center;
  color: var(--text-muted);
  font-size: 12px;
  border-top: 1px solid var(--border-color);
  margin-top: 24px;
}

/* Responsive */
@media (max-width: 768px) {
  .container {
    padding: 12px 16px;
  }

  .primary-config {
    flex-direction: column;
    gap: 16px;
  }

  .config-block {
    min-width: 100%;
  }

  .stats-bar {
    flex-wrap: wrap;
    gap: 12px;
  }

  .result-table {
    font-size: 12px;
  }

  .result-table th,
  .result-table td {
    padding: 8px 10px;
  }
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--accent-primary);
}

/* Selection */
::selection {
  background: rgba(247, 147, 26, 0.2);
}

/* Table row animation */
@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.result-table tbody tr {
  animation: fadeIn 0.2s ease;
}