/* Style dla Generatora Ekierek 3D - Zoptymalizowany pod Bambu Lab */

:root {
  --primary: #10b981; /* Emerald / Bambu green */
  --primary-hover: #059669;
  --primary-glow: rgba(16, 185, 129, 0.25);
  --accent: #f59e0b; /* Amber warning / highlight */
  --bg-dark: #0f172a;
  --panel-bg: rgba(15, 23, 42, 0.92);
  --panel-border: rgba(51, 65, 85, 0.7);
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background-color: var(--bg-dark);
  color: var(--text-main);
  overflow: hidden;
  height: 100vh;
  width: 100vw;
  user-select: none;
}

/* 3D Canvas */
#webgl-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: rgba(15, 23, 42, 0.5);
}
::-webkit-scrollbar-thumb {
  background: rgba(71, 85, 105, 0.8);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(100, 116, 139, 1);
}

/* Tab Navigation Styling */
.tab-btn {
  position: relative;
  border-bottom: 2px solid transparent !important;
  color: #94a3b8 !important;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  background: transparent;
  cursor: pointer;
  border-radius: 6px 6px 0 0;
  font-weight: 500;
}

.tab-btn:hover {
  color: #f1f5f9 !important;
  background: rgba(51, 65, 85, 0.3) !important;
}

.tab-btn.active {
  color: #34d399 !important;
  border-bottom-color: #10b981 !important;
  background: rgba(16, 185, 129, 0.12) !important;
  font-weight: 700 !important;
  box-shadow: inset 0 -1px 0 rgba(16, 185, 129, 0.4);
}

.tab-btn.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 15%;
  right: 15%;
  height: 2px;
  background: #34d399;
  box-shadow: 0 0 8px #10b981;
  border-radius: 2px;
}

/* Custom Sliders */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  background: #334155;
  border-radius: 3px;
  outline: none;
  transition: background 0.2s;
}

input[type="range"]:hover {
  background: #475569;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #10b981;
  cursor: pointer;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.5);
  transition: transform 0.15s, background-color 0.15s;
}

input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.2);
  background: #34d399;
}

/* Preset & Button Cards */
.preset-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid rgba(51, 65, 85, 0.8);
  background: rgba(30, 41, 59, 0.7);
  transition: all 0.2s ease;
  cursor: pointer;
  text-align: left;
}

.preset-btn:hover {
  background: rgba(51, 65, 85, 0.9);
  border-color: #10b981;
  transform: translateY(-1px);
}

.preset-btn.active {
  background: rgba(16, 185, 129, 0.15);
  border-color: #10b981;
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.25);
}

.preset-btn .preset-title {
  font-weight: 600;
  font-size: 0.85rem;
  color: #f1f5f9;
}

.preset-btn .preset-desc {
  font-size: 0.72rem;
  color: #94a3b8;
  margin-top: 2px;
}

/* Tooltip */
.tooltip-container {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.tooltip-container:hover .tooltip-box {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.tooltip-box {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  background: #1e293b;
  border: 1px solid #475569;
  padding: 5px 9px;
  font-size: 0.72rem;
  color: #e2e8f0;
  border-radius: 6px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease;
  z-index: 50;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

/* Animations */
@keyframes pulse-subtle {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

.animate-pulse-subtle {
  animation: pulse-subtle 3s infinite ease-in-out;
}

/* Glassmorphism */
.glass-panel {
  background: var(--panel-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--panel-border);
}

/* Color swatch button */
.color-swatch {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.15s, border-color 0.15s;
  position: relative;
}

.color-swatch:hover {
  transform: scale(1.15);
}

.color-swatch.active {
  border-color: #ffffff;
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.6);
}

/* Badge tags */
.badge-tech {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  font-size: 0.7rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  border-radius: 4px;
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid rgba(71, 85, 105, 0.6);
  color: #cbd5e1;
}

/* Mobile responsive sidebar */
@media (max-width: 768px) {
  #sidebar {
    width: 100% !important;
    max-height: 50vh !important;
    bottom: 0 !important;
    top: auto !important;
    border-right: none !important;
    border-top: 1px solid var(--panel-border) !important;
    border-radius: 16px 16px 0 0 !important;
  }
}
