/**
 * UI Sandbox Styles
 * Styles for the design system showcase in settings modal v2
 */

/* ===========================
   SANDBOX LAYOUT
   =========================== */

.sandbox-section {
  padding: 0;
}

.sandbox-intro {
  background: #f8f9fa;
  padding: 20px;
  border-radius: 8px;
  margin-bottom: 24px;
  border-left: 4px solid #3498db;
}

.sandbox-intro p {
  margin: 0;
  line-height: 1.6;
  color: #2c3e50;
  font-size: 16px;
}

.sandbox-demo-block {
  background: white;
  border: 2px solid #e8ebed;
  border-radius: 8px;
  padding: 24px;
  margin-bottom: 24px;
}

.sandbox-block-title {
  font-family: 'Bangers', cursive;
  font-size: 20px;
  color: #2c3e50;
  margin: 0 0 16px 0;
  padding-bottom: 12px;
  border-bottom: 2px solid #e8ebed;
  letter-spacing: 1px;
  text-shadow: 
    1px 1px 0 rgba(0, 0, 0, 0.1),
    -1px -1px 0 rgba(255, 255, 255, 0.3);
}

.sandbox-demo-content {
  display: block;
}

/* ===========================
   SANDBOX NOTES
   =========================== */

.sandbox-notes {
  background: #2c3e50;
  color: #ecf0f1;
  padding: 24px;
  border-radius: 8px;
  margin-top: 24px;
}

.sandbox-notes-title {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: #f8f9fa;
  margin: 0 0 16px 0;
  letter-spacing: 0.5px;
}

.sandbox-notes-list {
  margin: 0;
  padding-left: 24px;
  line-height: 1.8;
}

.sandbox-notes-list li {
  margin-bottom: 8px;
  color: #ecf0f1;
}

.sandbox-notes-list strong {
  color: #3498db;
}

/* ===========================
   BUTTON STYLES
   =========================== */

.sb-btn {
  padding: 10px 20px;
  border: none;
  border-radius: 6px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  outline: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-decoration: none;
  line-height: 1;
}

.sb-btn:focus-visible {
  outline: 3px solid #3498db;
  outline-offset: 2px;
}

/* Primary Buttons */
.sb-btn-primary {
  background: #3498db;
  color: white;
}

.sb-btn-success {
  background: #2ecc71;
  color: white;
}

.sb-btn-warning {
  background: #f39c12;
  color: white;
}

.sb-btn-danger {
  background: #e74c3c;
  color: white;
}

.sb-btn-energy {
  background: #9b59b6;
  color: white;
}

/* Secondary Buttons */
.sb-btn-secondary {
  background: #ecf0f1;
  color: #2c3e50;
  border: 2px solid #d0d3d4;
}

.sb-btn-secondary:hover {
  background: #d5dbdb;
}

/* Outline Buttons */
.sb-btn-outline-primary {
  background: transparent;
  color: #3498db;
  border: 2px solid #3498db;
}

.sb-btn-outline-primary:hover {
  background: #3498db;
  color: white;
}

.sb-btn-outline-success {
  background: transparent;
  color: #2ecc71;
  border: 2px solid #2ecc71;
}

.sb-btn-outline-success:hover {
  background: #2ecc71;
  color: white;
}

/* Ghost Button */
.sb-btn-ghost {
  background: transparent;
  color: #2c3e50;
  border: none;
  padding: 10px 16px;
}

.sb-btn-ghost:hover {
  background: #ecf0f1;
}

/* Icon-only Button */
.sb-btn-icon {
  width: 40px;
  height: 40px;
  padding: 0;
  background: #ecf0f1;
  color: #2c3e50;
  border: 2px solid #d0d3d4;
  font-size: 18px;
}

.sb-btn-icon:hover {
  background: #d5dbdb;
}

/* Size Variants */
.sb-btn-lg {
  padding: 14px 28px;
  font-size: 17px;
}

.sb-btn-sm {
  padding: 7px 14px;
  font-size: 14px;
}

.sb-btn-xs {
  padding: 5px 10px;
  font-size: 13px;
}

/* Disabled State */
.sb-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Active State (for button groups) */
.sb-btn-active {
  background: #3498db !important;
  color: white !important;
  border-color: #2980b9 !important;
}

/* ===========================
   BUTTON GROUPS
   =========================== */

.sb-btn-group {
  display: inline-flex;
  gap: 0;
}

.sb-btn-group .sb-btn {
  border-radius: 0;
  margin: 0;
  border-right-width: 1px;
}

.sb-btn-group .sb-btn:first-child {
  border-radius: 6px 0 0 6px;
}

.sb-btn-group .sb-btn:last-child {
  border-radius: 0 6px 6px 0;
  border-right-width: 2px;
}

.sb-btn-group .sb-btn:only-child {
  border-radius: 6px;
}

/* ===========================
   FORM ELEMENTS (for next section)
   =========================== */

.sb-field {
  margin-bottom: 20px;
}

.sb-field-label {
  display: block;
  font-weight: 600;
  color: #2c3e50;
  margin-bottom: 8px;
  font-size: 15px;
}

.sb-field-input,
.sb-field-select,
.sb-field-textarea {
  width: 100%;
  padding: 10px 12px;
  border: 2px solid #d0d3d4;
  border-radius: 6px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 15px;
  color: #2c3e50;
  background: white;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.sb-field-input:focus,
.sb-field-select:focus,
.sb-field-textarea:focus {
  outline: none;
  border-color: #3498db;
  box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.sb-field-input:disabled,
.sb-field-select:disabled,
.sb-field-textarea:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: #f8f9fa;
}

.sb-field-textarea {
  min-height: 100px;
  resize: vertical;
  font-family: 'Monaco', 'Courier New', monospace;
}

/* Checkbox and Radio */
.sb-field-checkbox,
.sb-field-radio {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  margin-bottom: 8px;
}

.sb-field-checkbox input,
.sb-field-radio input {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.sb-field-checkbox label,
.sb-field-radio label {
  cursor: pointer;
  font-weight: 400;
  color: #2c3e50;
  margin: 0;
}

/* Toggle Switch */
.sb-toggle {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 26px;
}

.sb-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.sb-toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #d0d3d4;
  transition: 0.3s;
  border-radius: 26px;
}

.sb-toggle-slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.3s;
  border-radius: 50%;
}

.sb-toggle input:checked + .sb-toggle-slider {
  background-color: #2ecc71;
}

.sb-toggle input:checked + .sb-toggle-slider:before {
  transform: translateX(24px);
}

.sb-toggle input:focus-visible + .sb-toggle-slider {
  outline: 3px solid #3498db;
  outline-offset: 2px;
}

/* Range Slider */
.sb-field-range {
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: #d0d3d4;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}

.sb-field-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #3498db;
  cursor: pointer;
  transition: all 0.2s ease;
}

.sb-field-range::-webkit-slider-thumb:hover {
  background: #2980b9;
  transform: scale(1.1);
}

.sb-field-range::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #3498db;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
}

.sb-field-range::-moz-range-thumb:hover {
  background: #2980b9;
  transform: scale(1.1);
}

/* Field Helper Text */
.sb-field-help {
  font-size: 13px;
  color: #7f8c8d;
  margin-top: 4px;
  line-height: 1.4;
}

.sb-field-error {
  font-size: 13px;
  color: #e74c3c;
  margin-top: 4px;
  line-height: 1.4;
}

/* ===========================
   UTILITY CLASSES
   =========================== */

.sb-text-light {
  color: #7f8c8d;
}

.sb-text-dark {
  color: #2c3e50;
}

.sb-bg-light {
  background: #f8f9fa;
}

.sb-bg-dark {
  background: #2c3e50;
}

.sb-mt-0 { margin-top: 0; }
.sb-mt-1 { margin-top: 8px; }
.sb-mt-2 { margin-top: 16px; }
.sb-mt-3 { margin-top: 24px; }
.sb-mt-4 { margin-top: 32px; }

.sb-mb-0 { margin-bottom: 0; }
.sb-mb-1 { margin-bottom: 8px; }
.sb-mb-2 { margin-bottom: 16px; }
.sb-mb-3 { margin-bottom: 24px; }
.sb-mb-4 { margin-bottom: 32px; }

.sb-p-0 { padding: 0; }
.sb-p-1 { padding: 8px; }
.sb-p-2 { padding: 16px; }
.sb-p-3 { padding: 24px; }
.sb-p-4 { padding: 32px; }

/* ===========================
   RESPONSIVE - MOBILE
   =========================== */

@media (max-width: 1024px) {
  /* Show mobile menu toggle */
  .mobile-tab-menu-toggle {
    display: flex !important;
  }
  
  /* Hide tab buttons by default on mobile */
  .tab-buttons {
    display: none !important;
    position: absolute;
    top: 52px;
    left: 0;
    right: 0;
    z-index: 1000;
    max-height: 80vh !important;
    flex-direction: column !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  }
  
  /* Make tab buttons full width on mobile */
  .tab-buttons .tab-button {
    width: 100%;
    justify-content: flex-start;
  }
  
  /* Reduce padding on mobile */
  .tab-container {
    padding: 12px !important;
  }
  
  /* Sandbox blocks take less padding on mobile */
  .sandbox-demo-block {
    padding: 16px !important;
  }
  
  .sandbox-intro {
    padding: 12px !important;
  }
  
  .sandbox-notes {
    padding: 16px !important;
  }
  
  /* Reduce font sizes slightly on mobile */
  .sandbox-block-title {
    font-size: 18px;
  }
  
  /* Stack grid layouts on mobile */
  .sandbox-demo-content > div[style*="grid"] {
    grid-template-columns: 1fr !important;
  }
}

@media (max-width: 480px) {
  /* Even smaller adjustments for very small screens */
  .sandbox-block-title {
    font-size: 16px;
  }
  
  .mobile-tab-menu-toggle {
    font-size: 16px;
  }
  
  .tab-container {
    padding: 8px !important;
  }
  
  .sandbox-demo-block {
    padding: 12px !important;
  }
  
  /* Smaller buttons on tiny screens */
  .sb-btn {
    padding: 8px 14px;
    font-size: 14px;
  }
  
  .sb-btn-lg {
    padding: 10px 18px;
    font-size: 15px;
  }
}
