/* ===============================
   Reusable Table Component
   =============================== */

.data-table-container {
  background: rgba(255, 255, 255, 0.02);
  border-radius: 16px;
  overflow: hidden;
  height: 100%;
  display: flex;
  flex-direction: column;
}

/* Table Controls */
.table-controls {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* Search */
.table-search {
  position: relative;
  flex: 1;
  max-width: 500px;
  margin: 0 auto;
}

.table-search input {
  width: 100%;
  padding: 10px 16px;
  padding-right: 40px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  color: white;
  font-size: 14px;
}

.table-search input:focus {
  outline: none;
  border-color: rgba(255, 255, 255, 0.2);
}

.table-search i {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(255, 255, 255, 0.5);
  pointer-events: none;
}

/* Filter Button */
.table-filter-btn {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  color: white;
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.table-filter-btn:hover {
  background: rgba(255, 255, 255, 0.05);
}

.table-filter-btn i {
  opacity: 0.7;
}

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

.data-table {
  width: 100%;
  border-collapse: collapse;
  color: white;
}

/* Table Headers */
.data-table th {
  background: rgba(255, 255, 255, 0.03);
  font-weight: 600;
  font-size: 14px;
  text-align: left;
  padding: 8px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
}

.data-table th:hover {
  background: rgba(255, 255, 255, 0.05);
}

/* Table Cells */
.data-table td {
  padding: 8px 16px;
  font-size: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* Table Rows */
.data-table tbody tr {
  cursor: pointer;
  transition: background 0.2s ease;
}

.data-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.03);
}

.data-table tbody tr.active {
  background: rgba(255, 255, 255, 0.05);
}

/* Status Styles */
.status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 13px;
  background: rgba(255, 255, 255, 0.03);
}

.status.betaald {
  color: #00ff99;
}

.status.wachtend {
  color: #ffc371;
}

.status.mislukt {
  color: #ff5e62;
}

.status i {
  font-size: 12px;
}

/* Status column fixed width to prevent table jumping */
.data-table .col-status {
  width: 140px;
  min-width: 140px;
  max-width: 140px;
}

/* Sort Indicators */
.sortable-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.sortable.sorted-asc .sortable-label::after {
  content: "\f0de";
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  color: #00ff99;
}

.sortable.sorted-desc .sortable-label::after {
  content: "\f0dd";
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  color: #00ff99;
}

.sortable:not(.sorted-asc):not(.sorted-desc) .sortable-label::after {
  content: "\f0dc";
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  color: rgba(255, 255, 255, 0.3);
}

/* Pagination */
.table-pagination {
  display: flex;
  align-items: center;
  padding: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  position: relative;
}

.pagination-left {
  display: flex;
  gap: 8px;
  align-items: center;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.pagination-right {
  display: flex;
  align-items: center;
  margin-left: auto;
}

.pagination-btn {
  min-width: 36px;
  height: 36px;
  padding: 0 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: white;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.pagination-btn:hover {
  background: rgba(255, 255, 255, 0.05);
}

.pagination-btn.active {
  background: linear-gradient(45deg, #ff9966, #ff5e62);
  border-color: transparent;
}

.pagination-ellipsis {
  color: rgba(255, 255, 255, 0.5);
  padding: 0 8px;
  font-size: 14px;
}

/* Records per page selector */
.records-per-page {
  display: flex;
  align-items: center;
  gap: 8px;
}

.records-label {
  color: rgba(255, 255, 255, 0.7);
  font-size: 14px;
  white-space: nowrap;
}

.records-selector {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: white;
  padding: 6px 12px;
  font-size: 14px;
  cursor: pointer;
  min-width: 60px;
}

.records-selector:focus {
  outline: none;
  border-color: rgba(255, 255, 255, 0.2);
}

.records-selector option {
  background: #2a2a2a;
  color: white;
}

/* Mobile Styles */
@media (max-width: 1023px) {
  .data-table {
    display: block;
  }

  .data-table thead {
    display: none;
  }

  .data-table tbody {
    display: block;
  }

  .data-table tr {
    display: flex;
    flex-wrap: wrap;
    margin-bottom: 16px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 12px;
  }

  .data-table td {
    flex: 1 1 auto;
    min-width: 50%;
    border: none;
    padding: 8px;
  }

  .data-table td::before {
    content: attr(data-label);
    display: block;
    font-size: 12px;
    opacity: 0.7;
    margin-bottom: 4px;
  }

  /* Mobile Column Order */
  .data-table .col-volledige_datumtijd { order: 1; }
  .data-table .col-tafel { order: 2; }
  .data-table .col-totaal { order: 3; }
  .data-table .col-status { order: 4; }
  .data-table .col-ordernummer { order: 5; }
}

/* ===============================
   Printer-specific styling
   =============================== */

/* Status indicators */
.status-indicator {
  display: inline-flex;
  align-items: center;
  font-size: 14px;
}

.status-indicator.online i {
  color: #00ff99;
  filter: drop-shadow(0 0 4px rgba(0, 255, 153, 0.5));
}

.status-indicator.offline i {
  color: #ff4757;
  filter: drop-shadow(0 0 4px rgba(255, 71, 87, 0.5));
}

/* Last print time */
.last-print {
  text-align: left;
}

.print-date {
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 2px;
}

.print-time {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.6);
}

.no-print {
  color: rgba(255, 255, 255, 0.4);
  font-style: italic;
}

/* Action icons */
.action-icon {
  color: rgba(255, 255, 255, 0.6);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.action-icon:hover {
  color: #00ff99;
  background: rgba(0, 255, 153, 0.1);
}

/* Column specific styling for printers */
.col-ip {
  font-family: 'Courier New', monospace;
  font-size: 13px;
}

.col-actions {
  width: 60px;
  text-align: center;
}

/* ===============================
   Schema Builder Styling
   =============================== */

.schema-builder-section {
  margin-top: 24px;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 16px;
  padding: 20px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.schema-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.schema-header h3 {
  color: rgba(255, 255, 255, 0.9);
  font-size: 18px;
  font-weight: 600;
  margin: 0;
}

.schema-controls {
  display: flex;
  gap: 8px;
}

.schema-btn {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 8px 12px;
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 14px;
}

.schema-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.9);
}

.schema-btn.primary {
  background: linear-gradient(135deg, #ff6b6b, #ee5a52);
  border-color: transparent;
  color: white;
}

.schema-btn.primary:hover {
  background: linear-gradient(135deg, #ff5252, #e53e3e);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(255, 107, 107, 0.3);
}

.schema-canvas-container {
  background: rgba(0, 0, 0, 0.3);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  overflow: hidden;
  position: relative;
}

.schema-canvas {
  display: block;
  cursor: grab;
}

.schema-canvas:active {
  cursor: grabbing;
}

/* Device elements in schema */
.schema-device {
  cursor: move;
  will-change: transform;
  transform-origin: center;
}

.schema-device:hover {
  filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.3));
}

.schema-device.dragging {
  filter: drop-shadow(0 0 12px rgba(255, 107, 107, 0.5));
  transition: none;
  pointer-events: none;
}

.device-kiosk {
  fill: url(#kioskGradient);
  stroke: rgba(255, 153, 102, 0.3);
  stroke-width: 2;
  filter: 
    drop-shadow(0 4px 12px rgba(0, 0, 0, 0.3))
    drop-shadow(0 2px 6px rgba(255, 153, 102, 0.2));
}

.device-printer {
  fill: url(#printerGradient);
  stroke: rgba(255, 94, 98, 0.3);
  stroke-width: 2;
  filter: 
    drop-shadow(0 4px 12px rgba(0, 0, 0, 0.3))
    drop-shadow(0 2px 6px rgba(255, 94, 98, 0.2));
}

.device-text {
  fill: rgba(255, 255, 255, 0.95);
  font-family: 'Montserrat', sans-serif;
  font-size: 12px;
  font-weight: 600;
  text-anchor: middle;
  dominant-baseline: central;
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.7));
}

.device-icon {
  fill: rgba(255, 255, 255, 0.9);
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  font-size: 16px;
  text-anchor: middle;
  dominant-baseline: central;
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.5));
}

/* Connection lines - Jamezz Design System */
.connection-line {
  stroke: rgba(255, 255, 255, 0.3);
  stroke-width: 2;
  stroke-dasharray: 6,3;
}

.connection-line.active {
  stroke: #ff5e62;
  stroke-width: 3;
  filter: drop-shadow(0 0 6px rgba(255, 94, 98, 0.4));
}

@keyframes dash {
  to {
    stroke-dashoffset: -200;
  }
}

.connection-plus {
  fill: rgba(255, 255, 255, 0.8);
  stroke: rgba(255, 255, 255, 0.2);
  stroke-width: 1;
  cursor: pointer;
  transition: all 0.2s ease;
}

.connection-plus:hover {
  fill: #ff6b6b;
  stroke: #ff5252;
  transform: scale(1.1);
}

.connection-plus-icon {
  fill: rgba(0, 0, 0, 0.8);
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  font-size: 12px;
  text-anchor: middle;
  dominant-baseline: central;
  pointer-events: none;
}

/* Schema popup modal */
.schema-popup {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 10000;
}

.schema-popup.active {
  display: flex;
}

.schema-popup-content {
  background: linear-gradient(135deg, #1a1a1a, #2d2d2d);
  border-radius: 16px;
  padding: 24px;
  max-width: 400px;
  width: 90%;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
}

.schema-popup-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.schema-popup-header h3 {
  color: white;
  margin: 0;
  font-size: 18px;
}

.schema-popup-close {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.7);
  font-size: 18px;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.schema-popup-close:hover {
  color: white;
  background: rgba(255, 255, 255, 0.1);
}

.schema-setting-item {
  margin-bottom: 16px;
}

.schema-setting-label {
  display: block;
  color: rgba(255, 255, 255, 0.8);
  font-size: 14px;
  margin-bottom: 8px;
  font-weight: 500;
}

.schema-setting-input {
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 10px 12px;
  color: white;
  font-size: 14px;
}

.schema-setting-input:focus {
  outline: none;
  border-color: #ff6b6b;
  box-shadow: 0 0 0 2px rgba(255, 107, 107, 0.2);
}

.schema-popup-actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
}

.schema-popup-btn {
  flex: 1;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 10px 16px;
  color: white;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 14px;
  font-weight: 500;
}

.schema-popup-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

.schema-popup-btn.primary {
  background: linear-gradient(135deg, #ff6b6b, #ee5a52);
  border-color: transparent;
}

.schema-popup-btn.primary:hover {
  background: linear-gradient(135deg, #ff5252, #e53e3e);
}

.schema-popup-btn.danger {
  background: linear-gradient(135deg, #f44336, #d32f2f);
  border-color: transparent;
}

.schema-popup-btn.danger:hover {
  background: linear-gradient(135deg, #e53935, #c62828);
}

/* Notification animations */
@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideOut {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(100%);
    opacity: 0;
  }
} 