/**
 * Gang Size - Type 7 (Upload By Size) Styles
 */

/* Modal */
.gs7-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gs7-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
}

.gs7-modal-content {
  position: relative;
  background: #fff;
  border-radius: 12px;
  width: 90%;
  max-width: 760px;
  max-height: 90vh;
  overflow: auto;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.gs7-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 16px 20px;
  border-bottom: 1px solid #e5e7eb;
  background: #fafafa;
  border-radius: 12px 12px 0 0;
}

.gs7-modal-header h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: #111;
}

.gs7-modal-close {
  background: none;
  border: none;
  font-size: 28px;
  cursor: pointer;
  color: #666;
  padding: 0;
  line-height: 1;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: background 0.2s;
}

.gs7-modal-close:hover {
  background: #e5e7eb;
  color: #000;
}

.gs7-modal-body {
  padding: 20px;
}

/* App Container */
.gs7-app {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Header Info */
.gs7-header-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: linear-gradient(135deg, #f0f4f8 0%, #e8ecf0 100%);
  border-radius: 8px;
  border: 1px solid #e0e4e8;
}

.gs7-printer-spec {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #555;
}

.gs7-printer-spec svg {
  color: #666;
}

.gs7-pricing-rate {
  font-size: 13px;
  font-weight: 600;
  color: #2563eb;
  background: #eff6ff;
  padding: 4px 10px;
  border-radius: 20px;
}

/* Sections */
.gs7-section {
  display: flex;
  flex-direction: column;
}

.gs7-section-title {
  font-size: 14px;
  font-weight: 600;
  color: #333;
  margin: 0 0 12px 0;
}

/* Size Grid */
.gs7-sizes {
  margin-bottom: 4px;
}

.gs7-size-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 8px;
}

.gs7-size-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 8px;
  background: #fff;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.gs7-size-btn:hover {
  border-color: #999;
  background: #f8f8f8;
}

.gs7-size-btn.active {
  border-color: #2563eb;
  background: #eff6ff;
}

.gs7-size-name {
  font-size: 14px;
  font-weight: 600;
  color: #333;
}

.gs7-size-dim {
  font-size: 11px;
  color: #666;
  margin-top: 2px;
}

.gs7-size-btn.active .gs7-size-name,
.gs7-size-btn.active .gs7-size-dim {
  color: #2563eb;
}

/* Dropzone */
.gs7-dropzone {
  border: 2px dashed #d0d5dd;
  border-radius: 12px;
  background: #fafafa;
  cursor: pointer;
  transition: all 0.2s;
  min-height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gs7-dropzone:hover,
.gs7-dropzone.dragover {
  border-color: #2563eb;
  background: #f0f7ff;
}

.gs7-dropzone-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px;
  text-align: center;
}

.gs7-upload-icon {
  color: #9ca3af;
  margin-bottom: 8px;
}

.gs7-dropzone-title {
  margin: 0;
  font-size: 15px;
  font-weight: 500;
  color: #374151;
}

.gs7-dropzone-subtitle {
  margin: 8px 0;
  font-size: 13px;
  color: #9ca3af;
}

.gs7-browse-btn {
  padding: 8px 20px;
  font-size: 14px;
  font-weight: 500;
  color: #fff;
  background: #2563eb;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s;
}

.gs7-browse-btn:hover {
  background: #1d4ed8;
}

.gs7-dropzone-formats {
  margin: 12px 0 0 0;
  font-size: 11px;
  color: #9ca3af;
}

/* File Preview */
.gs7-dropzone-filled {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px;
  width: 100%;
}

.gs7-preview-wrapper {
  position: relative;
  display: inline-block;
}

.gs7-preview-wrapper img {
  max-width: 200px;
  max-height: 150px;
  object-fit: contain;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.gs7-remove-btn {
  position: absolute;
  top: -10px;
  right: -10px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #ef4444;
  color: #fff;
  border: 2px solid #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  transition: background 0.2s;
}

.gs7-remove-btn:hover {
  background: #dc2626;
}

.gs7-file-info {
  margin-top: 12px;
  text-align: center;
}

.gs7-file-name {
  margin: 0;
  font-size: 13px;
  font-weight: 500;
  color: #374151;
  word-break: break-all;
}

.gs7-file-dims {
  margin: 4px 0 0 0;
  font-size: 12px;
  color: #6b7280;
}

/* Tools Section */
.gs7-tools-section {
  padding: 16px;
  background: #f9fafb;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
}

.gs7-tools-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.gs7-tool-toggle {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  user-select: none;
}

.gs7-tool-toggle input[type="checkbox"] {
  display: none;
}

.gs7-toggle-track {
  position: relative;
  width: 44px;
  height: 24px;
  background: #d1d5db;
  border-radius: 12px;
  transition: background 0.2s;
}

.gs7-toggle-track::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s;
}

.gs7-tool-toggle input:checked + .gs7-toggle-track,
.gs7-qty-toggle input:checked + .gs7-toggle-track {
  background: #2563eb;
}

.gs7-tool-toggle input:checked + .gs7-toggle-track::after,
.gs7-qty-toggle input:checked + .gs7-toggle-track::after {
  transform: translateX(20px);
}

.gs7-toggle-label {
  font-size: 14px;
  color: #374151;
}

/* Tool hints */
.gs7-tool-hint {
  font-size: 12px;
  color: #9ca3af;
  margin: 4px 0 0 56px;
}

/* Background option wrapper */
.gs7-bg-option {
  padding-bottom: 12px;
  border-bottom: 1px solid #e5e7eb;
  margin-bottom: 12px;
}

.gs7-bg-option:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

/* Color Picker */
.gs7-color-picker-wrap {
  margin-top: 12px;
  margin-left: 56px;
  padding: 12px;
  background: #fff;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
}

.gs7-color-label {
  font-size: 13px;
  color: #374151;
  display: block;
  margin-bottom: 10px;
}

.gs7-color-presets {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.gs7-color-preset {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  border: 2px solid #d1d5db;
  cursor: pointer;
  transition: all 0.2s;
}

.gs7-color-preset:hover {
  transform: scale(1.1);
  border-color: #9ca3af;
}

.gs7-color-preset.active {
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.3);
}

.gs7-color-preset[data-color="#000000"] {
  border-color: #374151;
}

.gs7-color-custom {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.gs7-color-custom input[type="color"] {
  width: 40px;
  height: 32px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  padding: 0;
}

.gs7-color-custom span {
  font-size: 13px;
  color: #6b7280;
}

.gs7-selected-color {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid #e5e7eb;
}

.gs7-selected-color span {
  font-size: 13px;
  color: #374151;
}

.gs7-color-preview {
  width: 24px;
  height: 24px;
  border-radius: 4px;
  border: 1px solid #d1d5db;
}

#gs7-color-value {
  font-family: monospace;
  font-size: 12px;
  color: #6b7280;
}

/* Quantity Section */
.gs7-quantity-section {
  padding: 16px;
  background: #f9fafb;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
}

.gs7-quantity-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.gs7-quantity-label {
  font-size: 14px;
  font-weight: 600;
  color: #374151;
}

.gs7-qty-toggle {
  display: flex;
  align-items: center;
  cursor: pointer;
}

.gs7-qty-toggle input[type="checkbox"] {
  display: none;
}

.gs7-quantity-default {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
}

.gs7-qty-value {
  font-size: 24px;
  font-weight: 700;
  color: #111;
  min-width: 40px;
}

.gs7-qty-hint {
  font-size: 12px;
  color: #9ca3af;
}

.gs7-quantity-input-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
}

.gs7-qty-btn {
  width: 40px;
  height: 40px;
  border: 1px solid #d1d5db;
  background: #fff;
  border-radius: 8px;
  font-size: 20px;
  font-weight: 500;
  color: #374151;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.gs7-qty-btn:hover {
  background: #f3f4f6;
  border-color: #9ca3af;
}

.gs7-qty-btn:active {
  background: #e5e7eb;
}

.gs7-qty-input {
  width: 80px;
  height: 40px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  text-align: center;
  font-size: 18px;
  font-weight: 600;
  color: #111;
}

.gs7-qty-input:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Hide spin buttons on number input */
.gs7-qty-input::-webkit-outer-spin-button,
.gs7-qty-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.gs7-qty-input[type=number] {
  -moz-appearance: textfield;
}

/* Summary */
.gs7-summary {
  background: #f0fdf4;
  border: 1px solid #86efac;
  border-radius: 8px;
  padding: 16px;
}

.gs7-summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.gs7-summary-row + .gs7-summary-row {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid #bbf7d0;
}

.gs7-summary-label {
  font-size: 14px;
  color: #166534;
}

.gs7-summary-value {
  font-size: 14px;
  font-weight: 500;
  color: #166534;
}

.gs7-summary-total .gs7-summary-label {
  font-weight: 600;
}

.gs7-price {
  font-size: 20px;
  font-weight: 700;
  color: #15803d;
}

/* Submit Button */
.gs7-submit-btn {
  width: 100%;
  padding: 14px 24px;
  font-size: 16px;
  font-weight: 600;
  background: #2563eb;
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.gs7-submit-btn:hover:not(:disabled) {
  background: #1d4ed8;
}

.gs7-submit-btn:disabled {
  background: #9ca3af;
  cursor: not-allowed;
}

.gs7-btn-loading {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.gs7-spinner {
  animation: gs7-spin 1s linear infinite;
}

@keyframes gs7-spin {
  to { transform: rotate(360deg); }
}

/* Actions Container */
.gs7-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Button Variants */
.gs7-btn-primary {
  background: #2563eb;
}

.gs7-btn-primary:hover:not(:disabled) {
  background: #1d4ed8;
}

.gs7-btn-secondary {
  background: #fff;
  color: #374151;
  border: 2px solid #d1d5db;
}

.gs7-btn-secondary:hover:not(:disabled) {
  background: #f9fafb;
  border-color: #9ca3af;
}

.gs7-btn-secondary:disabled {
  background: #f9fafb;
  color: #9ca3af;
  border-color: #e5e7eb;
}

/* Success Message */
.gs7-success-msg {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 16px;
  background: #10b981;
  color: #fff;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  animation: gs7-fade-in 0.3s ease;
}

@keyframes gs7-fade-in {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Responsive */
@media (max-width: 480px) {
  .gs7-modal-content {
    width: 95%;
    max-height: 95vh;
    border-radius: 8px;
  }

  .gs7-modal-body {
    padding: 16px;
  }

  .gs7-header-info {
    flex-direction: column;
    gap: 8px;
    text-align: center;
  }

  .gs7-size-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ========== DRIVER.JS TOUR OVERRIDES ========== */
/* Overlay must be above .gs7-modal (z-index:999999) but below popover */
.driver-overlay {
  z-index: 10000000 !important;
}
/* Popover must be above the overlay so buttons are clickable */
.driver-popover {
  z-index: 10000002 !important;
}
/* Highlighted element needs to sit between overlay and popover */
.driver-active-element {
  z-index: 10000001 !important;
}
