/* Weblotery Turbo Page Styles */
.weblotery-page {
  min-height: calc(100vh - 64px);
  background: linear-gradient(135deg, #0a0a0a 0%, #1a1a1a 100%);
  padding: 3rem 1rem;
}

.weblotery-page .container {
  max-width: 900px;
  margin: 0 auto;
}

/* Page Header */
.weblotery-page .page-header {
  text-align: center;
  margin-bottom: 2rem;
  animation: wlFadeInUp 0.6s ease-out;
}

.weblotery-page .page-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.weblotery-page .page-title {
  font-size: clamp(2rem, 5vw, 2.5rem);
  font-weight: 700;
  color: #ffffff;
  margin: 0 0 1rem;
  letter-spacing: -0.5px;
}

.weblotery-page .page-subtitle {
  font-size: clamp(1rem, 2.5vw, 1.125rem);
  color: #94a3b8;
  margin: 0 auto;
  max-width: 600px;
  line-height: 1.6;
}

/* WASM Status */
.wasm-status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 2rem;
  font-size: 0.9rem;
  color: #94a3b8;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.status-dot.loading {
  background: #f59e0b;
  animation: wlPulse 1s ease-in-out infinite;
}

.status-dot.ready {
  background: #10b981;
  animation: none;
}

.status-dot.error {
  background: #ef4444;
  animation: none;
}

/* Cards */
.input-card,
.console-card,
.found-card {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 2rem;
  margin-bottom: 1.5rem;
  backdrop-filter: blur(10px);
  animation: wlFadeInUp 0.6s ease-out 0.2s both;
}

.card-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: #ffffff;
  margin: 0 0 1.5rem;
}

/* Puzzle Presets */
.puzzle-presets {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.presets-label {
  font-size: 0.875rem;
  font-weight: 500;
  color: #cbd5e1;
  margin-right: 0.25rem;
}

.btn-preset {
  padding: 0.5rem 1rem;
  background: rgba(247, 147, 26, 0.1);
  border: 1px solid rgba(247, 147, 26, 0.3);
  border-radius: 8px;
  color: #f7931a;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-preset:hover {
  background: rgba(247, 147, 26, 0.2);
  border-color: rgba(247, 147, 26, 0.5);
  transform: translateY(-1px);
}

.btn-preset.active {
  background: #f7931a;
  color: #000;
  border-color: #f7931a;
}

/* Input Fields */
.input-group {
  margin-bottom: 1.25rem;
}

.input-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: #cbd5e1;
  margin-bottom: 0.5rem;
}

.input-field {
  width: 100%;
  padding: 0.75rem 1rem;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  color: #e2e8f0;
  font-size: 0.95rem;
  transition: border-color 0.2s ease;
  box-sizing: border-box;
}

.input-field:focus {
  outline: none;
  border-color: #f7931a;
  box-shadow: 0 0 0 2px rgba(247, 147, 26, 0.2);
}

.input-field.mono {
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  font-size: 0.875rem;
}

/* Buttons */
.button-group {
  display: flex;
  gap: 1rem;
  margin-top: 1.5rem;
}

.weblotery-page .btn {
  padding: 0.75rem 2rem;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.weblotery-page .btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn-start {
  background: #f7931a;
  color: #000;
}

.btn-start:hover:not(:disabled) {
  background: #e8850f;
  transform: translateY(-1px);
}

.btn-stop {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.btn-stop:hover:not(:disabled) {
  background: rgba(239, 68, 68, 0.3);
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
  animation: wlFadeInUp 0.6s ease-out 0.3s both;
}

.stat-card {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 1.25rem;
  text-align: center;
  backdrop-filter: blur(10px);
}

.stat-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 500;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.5rem;
}

.stat-value {
  display: block;
  font-size: 1.1rem;
  font-weight: 600;
  color: #f7931a;
}

.stat-value.mono {
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  font-size: 0.8rem;
}

.stat-value.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Console */
.console-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.console-header .card-title {
  margin-bottom: 0;
}

.btn-clear {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #94a3b8;
  padding: 0.375rem 0.75rem;
  border-radius: 6px;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-clear:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #e2e8f0;
}

.console-output {
  margin-top: 1rem;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  padding: 1rem;
  height: 240px;
  overflow-y: auto;
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  font-size: 0.8rem;
  line-height: 1.6;
}

.console-entry {
  padding: 2px 0;
  word-break: break-all;
}

.console-entry.info { color: #94a3b8; }
.console-entry.success { color: #10b981; }
.console-entry.error { color: #ef4444; }
.console-entry.warn { color: #f59e0b; }

/* Found Card */
.found-card {
  border-color: rgba(16, 185, 129, 0.4);
  animation: wlFadeInUp 0.4s ease-out both;
}

.found-title {
  color: #10b981;
}

.found-table {
  width: 100%;
  border-collapse: collapse;
}

.found-table th {
  text-align: left;
  padding: 0.75rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.found-table td {
  padding: 0.75rem;
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  font-size: 0.85rem;
  color: #10b981;
  word-break: break-all;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

/* Animations */
@keyframes wlFadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes wlPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* Responsive */
@media (max-width: 768px) {
  .weblotery-page {
    padding: 2rem 1rem;
  }

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

  .input-card,
  .console-card,
  .found-card {
    padding: 1.5rem;
  }

  .button-group {
    flex-direction: column;
  }

  .weblotery-page .btn {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .input-card,
  .console-card,
  .found-card {
    padding: 1rem;
  }

  .console-output {
    height: 180px;
    font-size: 0.75rem;
  }
}
