/* Root theme variables */
:root {
  --bg-primary: #0f0f12;
  --bg-secondary: #1a1a1f;
  --bg-tertiary: rgba(31, 31, 38, 0.5);
  --text-primary: #f0f0f0;
  --text-secondary: #d1d5db;
  --text-tertiary: #9ca3af;
  --border-color: rgba(75, 85, 99, 0.3);
  --border-color-hover: rgba(107, 114, 128, 0.5);
  --accent-blue: #3b82f6;
  --accent-blue-dark: #2563eb;
}

body.light-mode {
  --bg-primary: #f9fafb;
  --bg-secondary: #f3f4f6;
  --bg-tertiary: rgba(229, 231, 235, 0.5);
  --text-primary: #1f2937;
  --text-secondary: #374151;
  --text-tertiary: #6b7280;
  --border-color: rgba(209, 213, 219, 0.4);
  --border-color-hover: rgba(156, 163, 175, 0.5);
  --accent-blue: #2563eb;
  --accent-blue-dark: #1d4ed8;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  background: var(--bg-primary);
  color: var(--text-secondary);
  transition: background 0.3s, color 0.3s;
}

/* Layout */
#app {
  display: flex;
  flex-direction: column;
  height: 100%;
}

#nav {
  flex-shrink: 0;
  position: relative;
  z-index: 50;
  border-bottom: 1px solid var(--border-color);
  background: rgba(15, 15, 18, 0.95);
  backdrop-filter: blur(12px);
  transition: all 0.3s;
}

body.light-mode #nav {
  background: rgba(249, 250, 251, 0.95);
}

#content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
  background: #2d2d35;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #3d3d45;
}

body.light-mode ::-webkit-scrollbar-thumb {
  background: #d1d5db;
}

body.light-mode ::-webkit-scrollbar-thumb:hover {
  background: #9ca3af;
}

/* Tabs */
.tab-active {
  border-bottom: 2px solid var(--accent-blue);
  color: var(--accent-blue);
}

.tab-inactive {
  border-bottom: 2px solid transparent;
  color: var(--text-tertiary);
  cursor: pointer;
  transition: color 0.3s;
}

.tab-inactive:hover {
  color: var(--text-secondary);
}

/* Hero video */
.video-container {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--bg-primary);
}

.video-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.5;
}

.video-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(180deg, rgba(15, 15, 18, 0.6) 0%, rgba(15, 15, 18, 0.85) 100%);
  transition: background 0.3s;
}

body.light-mode .video-overlay {
  background: linear-gradient(180deg, rgba(249, 250, 251, 0.5) 0%, rgba(249, 250, 251, 0.8) 100%);
}

.content-wrapper {
  position: relative;
  z-index: 1;
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-fade {
  animation: fadeIn 0.6s ease-out;
}

/* Form elements */
.glass-input {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  transition: all 0.2s;
}

.glass-input:focus {
  outline: none;
  border-color: var(--accent-blue);
  background: rgba(59, 130, 246, 0.05);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.glass-input::placeholder {
  color: var(--text-tertiary);
}

/* Sections & cards */
.section {
  min-height: 100%;
  display: flex;
  flex-direction: column;
}

.card {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  transition: all 0.3s;
}

.card:hover {
  border-color: var(--border-color-hover);
}

/* Stats */
.stat-value {
  font-size: 2rem;
  font-weight: 600;
  color: var(--accent-blue);
  letter-spacing: -0.5px;
}

.stat-label {
  font-size: 0.875rem;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Reviews */
.review-star {
  color: #fbbf24;
  font-size: 0.875rem;
  letter-spacing: 2px;
}

/* Theme toggle */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  width: 60px;
  height: 32px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 0 4px;
  cursor: pointer;
  transition: all 0.3s;
}

.theme-toggle:hover {
  border-color: var(--accent-blue);
}

.theme-toggle .toggle-dot {
  width: 24px;
  height: 24px;
  background: var(--text-primary);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  position: relative;
  transition: transform 0.3s;
}

.theme-toggle .toggle-dot .icon {
  position: absolute;
  width: 14px;
  height: 14px;
  fill: #111827;
  stroke: #111827;
  stroke-width: 1.5;
  transition: opacity 0.3s;
}

.theme-toggle .dark-icon {
  opacity: 1;
}

body.light-mode .theme-toggle .dark-icon {
  opacity: 0;
}

.theme-toggle .light-icon {
  opacity: 0;
}

body.light-mode .theme-toggle .light-icon {
  opacity: 1;
}

body.light-mode .theme-toggle .toggle-dot {
  transform: translateX(28px);
}

/* Buttons */
button {
  transition: all 0.2s;
}

.btn-primary {
  background: var(--accent-blue);
  color: white;
  border: none;
  font-weight: 600;
}

.btn-primary:hover {
  background: var(--accent-blue-dark);
}

.btn-secondary {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background: var(--bg-tertiary);
  border-color: var(--border-color-hover);
}


/* Description preview: clamp to 3 lines */
.description-preview {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.4;
  max-height: calc(3 * 1.4em);
}

/* Product images */
.product-image {
  width: 100%;
  height: 200px;
  background: var(--bg-secondary);
  border-radius: 6px;
  object-fit: cover;
  border: 1px solid var(--border-color);
}

.product-image-placeholder {
  width: 100%;
  height: 200px;
  background: var(--bg-secondary);
  border-radius: 6px;
  border: 2px dashed var(--border-color);
  display: flex;
  align-items: center;
  justify-content: flex-start;
  color: var(--text-tertiary);
  font-size: 13px;
}

/* File input */
.image-upload-input {
  display: none;
}

.file-input-wrapper {
  position: relative;
  cursor: pointer;
}

/* Ticket file picker */
.ticket-file-picker {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.file-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 12px;
  font-size: 12px;
  line-height: 1;
  border: 1px dashed var(--border-color);
  background: var(--bg-secondary);
  color: var(--text-secondary);
  width: 100%;
}

.file-btn:hover {
  border-color: var(--accent-blue);
}

.file-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.file-pill {
  font-size: 10px;
  padding: 6px 8px;
  border-radius: 999px;
  border: 1px solid var(--border-color);
  background: var(--bg-tertiary);
  color: var(--text-tertiary);
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Ticket messages + attachments */
.ticket-message-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}

.ticket-attachments {
  margin-top: 10px;
  display: grid;
  gap: 8px;
}

.ticket-attachment {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  background: var(--bg-tertiary);
  text-decoration: none;
}

.ticket-attachment:hover {
  border-color: var(--accent-blue);
}

.ticket-attachment-badge {
  font-size: 10px;
  padding: 4px 6px;
  border-radius: 8px;
  background: rgba(59, 130, 246, 0.12);
  color: var(--accent-blue);
  border: 1px solid rgba(59, 130, 246, 0.35);
  min-width: 42px;
  text-align: center;
}

.ticket-attachment-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.ticket-attachment-name {
  font-size: 12px;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ticket-attachment-sub {
  font-size: 10px;
  color: var(--text-tertiary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ticket-attachment-dl {
  font-size: 14px;
  color: var(--text-tertiary);
}


/* Cart blur when payment is open */
#cart-modal-content.cart-blurred {
  filter: blur(6px);
  pointer-events: none;
}
