/* components.css — Modular pure CSS widgets, buttons, tables, maps, charts, specs, and status elements */

/* Buttons */
.vox-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  padding: 12px 22px;
  min-height: var(--touch-target);
  border-radius: var(--radius);
  border: 1px solid var(--line);
  color: var(--text);
  background: transparent;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s var(--ease), border-color 0.2s, transform 0.15s;
  white-space: nowrap;
}

.vox-btn:hover {
  background: var(--surface-hover);
  transform: translateY(-1px);
}

.vox-btn-primary {
  background: var(--cta);
  color: var(--cta-text);
  border-color: var(--cta);
}

.vox-btn-primary:hover {
  opacity: 0.9;
  background: var(--cta);
}

.vox-icon-btn {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  padding: 0 14px;
  min-height: var(--touch-target);
  min-width: var(--touch-target);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.vox-icon-btn:hover {
  color: var(--text);
  background: var(--surface-hover);
  border-color: var(--muted);
}

/* Form Controls */
.vox-input, .vox-textarea, .vox-select,
.vox-date-picker, .vox-time-picker {
  width: 100%;
  font-family: var(--font-mono);
  font-size: 0.95rem;
  padding: 14px 16px;
  min-height: var(--touch-target);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
  outline: none;
}

.vox-input:focus, .vox-textarea:focus, .vox-select:focus,
.vox-date-picker:focus, .vox-time-picker:focus {
  border-color: var(--muted);
}

.vox-textarea {
  min-height: 120px;
  resize: vertical;
}

.vox-label {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  min-height: var(--touch-target);
}

.vox-checkbox, .vox-radio {
  accent-color: var(--text);
  width: 20px;
  height: 20px;
  cursor: pointer;
}

/* Switch Component */
.vox-switch {
  position: relative;
  display: inline-block;
  width: 46px;
  height: 26px;
}

.vox-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.vox-slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 26px;
  transition: .3s;
}

.vox-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background: var(--text);
  border-radius: 50%;
  transition: .3s;
}

input:checked + .vox-slider {
  background: var(--cta);
  border-color: var(--cta);
}

input:checked + .vox-slider:before {
  transform: translateX(20px);
  background: var(--cta-text);
}

/* Cards & Widgets */
.vox-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  overflow: hidden;
}

.vox-card-elevated {
  background: var(--surface-elevated);
}

.vox-card img {
  width: 100%;
  height: auto;
  border-radius: var(--radius);
  margin-bottom: 16px;
  display: block;
  border: 1px solid var(--line);
}

.vox-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
  background: var(--surface-elevated);
}

/* Progress indicator */
.vox-progress {
  width: 100%;
  height: 6px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
}

.vox-progress-bar {
  height: 100%;
  background: var(--text);
  transition: width 0.3s var(--ease);
}

/* Table Modules */
.vox-table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.vox-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  min-width: 480px;
}

.vox-table th, .vox-table td {
  padding: 14px 16px;
  text-align: left;
  border-bottom: 1px solid var(--line);
}

.vox-table th {
  color: var(--muted);
  font-weight: 500;
  background: var(--surface-elevated);
}

.vox-tree-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-mono);
  font-size: 0.85rem;
}

.vox-tree-table th, .vox-tree-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--line);
}

.vox-tree-table th {
  color: var(--muted);
  font-weight: 500;
  background: var(--surface-elevated);
}

.vox-tree-row:hover {
  background: var(--surface-hover);
}

.vox-tree-indent {
  display: inline-block;
  width: 20px;
}

.vox-tree-toggle {
  display: inline-block;
  width: 16px;
  cursor: pointer;
}

/* Overlays & Modals */
.vox-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.vox-modal.open {
  display: flex;
}

.vox-modal-content {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  width: 100%;
  max-width: 420px;
  padding: 24px;
}

.vox-toast {
  position: fixed;
  bottom: 50px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--surface-elevated);
  border: 1px solid var(--line);
  padding: 12px 20px;
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  display: none;
  z-index: 300;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.vox-toast.show {
  display: block;
}

/* Status & Tickers */
.vox-statusbar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 28px;
  background: var(--surface);
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  padding: 0 14px;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--muted);
  gap: 14px;
  z-index: 50;
}

.vox-status-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  background: #22c55e;
  border-radius: 50%;
  margin-right: 6px;
}

/* Calendar widget */
.vox-calendar {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  width: 100%;
  max-width: 340px;
}

.vox-calendar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  font-family: var(--font-mono);
  font-size: 0.9rem;
}

.vox-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  text-align: center;
}

.vox-calendar-day {
  padding: 8px 0;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--muted);
}

.vox-calendar-day.today {
  background: var(--cta);
  color: var(--cta-text);
  border-radius: 4px;
}

.vox-calendar-event {
  font-size: 0.75rem;
  padding: 6px 10px;
  background: var(--surface-elevated);
  border-left: 3px solid var(--text);
  margin-top: 8px;
  font-family: var(--font-mono);
}

/* Carousel */
.vox-carousel {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 12px;
}

.vox-carousel-card {
  min-width: 260px;
  flex-shrink: 0;
  scroll-snap-align: start;
}

/* Accordion (OpenUI5 Compact architecture style) */
.vox-accordion {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  max-width: 500px;
}

.vox-accordion-item {
  border-bottom: 1px solid var(--line);
}

.vox-accordion-item:last-child {
  border-bottom: none;
}

.vox-accordion-header {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  min-height: var(--touch-target);
  background: var(--surface);
  border: none;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
}

.vox-accordion-header:hover {
  background: var(--surface-hover);
}

.vox-accordion-content {
  padding: 16px;
  background: var(--bg);
  border-top: 1px solid var(--line);
}

/* Segmented Button (UI5 standard Layout) */
.vox-segmented {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
}

.vox-segmented-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  min-height: var(--touch-target);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  background: transparent;
  color: var(--muted);
  border: none;
  border-right: 1px solid var(--line);
  cursor: pointer;
}

.vox-segmented-btn:last-child {
  border-right: none;
}

.vox-segmented-btn:hover {
  color: var(--text);
  background: var(--surface-hover);
}

.vox-segmented-btn.active {
  color: var(--cta-text);
  background: var(--cta);
}

/* Navigation Tabs Component */
.vox-tabs-comp {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
  max-width: 600px;
}

.vox-tabs-comp-header {
  display: flex;
  border-bottom: 1px solid var(--line);
  background: var(--surface-elevated);
}

.vox-tabs-comp-btn {
  padding: 0 16px;
  min-height: var(--touch-target);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--muted);
  background: transparent;
  border: none;
  border-right: 1px solid var(--line);
  cursor: pointer;
  position: relative;
}

.vox-tabs-comp-btn:hover {
  color: var(--text);
  background: var(--surface-hover);
}

.vox-tabs-comp-btn.active {
  color: var(--text);
  background: var(--surface);
}

.vox-tabs-comp-btn.active::after {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--text);
}

.vox-tabs-comp-body {
  padding: 16px;
  background: var(--surface);
}

/* Retro Pure CSS Charts */
.vox-chart-container {
  max-width: 500px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
}

.vox-chart-bar-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  height: 100%;
}

.vox-chart-bar {
  background: var(--text);
  width: 100%;
  min-width: 24px;
  transition: height 0.5s var(--ease);
}

.vox-chart-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--muted);
  text-align: center;
  margin-top: 8px;
  display: block;
}

/* Integrations & Specs Block */
.vox-spec-container {
  margin-top: 32px;
  border-top: 2px dashed var(--line);
  padding-top: 24px;
}

.vox-spec-title {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 12px;
}

.vox-spec-tabs {
  display: flex;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 16px;
  max-width: fit-content;
}

.vox-spec-tab-btn {
  background: transparent;
  border: none;
  border-right: 1px solid var(--line);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  min-height: 38px;
  padding: 0 16px;
  cursor: pointer;
}

.vox-spec-tab-btn:last-child {
  border-right: none;
}

.vox-spec-tab-btn:hover {
  background: var(--surface-hover);
  color: var(--text);
}

.vox-spec-tab-btn.active {
  background: var(--surface-elevated);
  color: var(--text);
  font-weight: 600;
}

.vox-spec-pane {
  display: none;
}

.vox-spec-pane.active {
  display: block;
}

.vox-spec-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
}

.vox-spec-card p {
  margin: 0 0 12px;
  font-size: 0.9rem;
  color: var(--muted);
}

.vox-spec-card p:last-child {
  margin-bottom: 0;
}

.vox-spec-code-wrapper {
  position: relative;
}

.vox-code-block {
  margin: 0;
  padding: 16px;
  background: var(--surface-elevated);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: #22c55e;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.5;
  overflow-x: auto;
  white-space: pre;
}

.vox-copy-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  padding: 4px 8px;
  cursor: pointer;
  transition: all 0.15s;
}

.vox-copy-btn:hover {
  color: var(--text);
  background: var(--surface-hover);
}

.vox-table-spec {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  margin-top: 12px;
}

.vox-table-spec th, .vox-table-spec td {
  padding: 10px 12px;
  border: 1px solid var(--line);
  text-align: left;
}

.vox-table-spec th {
  background: var(--surface-elevated);
  font-weight: 600;
  color: var(--text);
}

.vox-table-spec td {
  color: var(--muted);
}

.vox-table-spec code {
  color: #ef4444;
  background: var(--surface-hover);
  padding: 2px 4px;
  border-radius: 4px;
}

.vox-demo-title {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--muted);
  margin-bottom: 14px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.vox-heading {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0 0 16px;
  letter-spacing: -0.02em;
}

/* Slider / Range */
.vox-slider-input {
  width: 100%;
  height: 6px;
  accent-color: var(--text);
  background: transparent;
  cursor: pointer;
}

/* Tooltip */
.vox-tooltip {
  position: relative;
  display: inline-block;
}

.vox-tooltip::before {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) scale(0.96);
  padding: 8px 12px;
  background: var(--surface-elevated);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s, transform 0.15s;
  z-index: 10;
}

.vox-tooltip::after {
  content: "";
  position: absolute;
  bottom: calc(100% + 2px);
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: var(--line);
  opacity: 0;
  transition: opacity 0.15s;
}

.vox-tooltip:hover::before,
.vox-tooltip:hover::after {
  opacity: 1;
}

.vox-tooltip:hover::before {
  transform: translateX(-50%) scale(1);
}

/* Spinner */
@keyframes vox-spin {
  to { transform: rotate(360deg); }
}

.vox-spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid var(--line);
  border-top-color: var(--text);
  border-radius: 50%;
  animation: vox-spin 1s linear infinite;
}

.vox-spinner-large {
  width: 32px;
  height: 32px;
  border-width: 3px;
}

/* Breadcrumb */
.vox-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--muted);
}

.vox-breadcrumb a {
  color: var(--text);
  text-decoration: none;
}

.vox-breadcrumb a:hover {
  text-decoration: underline;
}

.vox-breadcrumb-sep {
  color: var(--line);
}

.vox-breadcrumb-current {
  color: var(--muted);
}

/* Avatar */
.vox-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--surface-elevated);
  border: 1px solid var(--line);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
}

.vox-avatar-image {
  background-size: cover;
  background-position: center;
  text-indent: -9999px;
}
