/* src/assets/css/v3.css */

/* History Panel */
.qr-history-panel {
  margin: 2rem 0;
  padding: 1rem;
  background: rgba(2, 6, 23, 0.55);
  border-radius: 1rem;
}

.history-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.history-item {
  background: #020617;
  border-radius: 0.75rem;
  padding: 0.75rem;
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.history-preview {
  width: 50px;
  height: 50px;
  background: #0b1220;
  border-radius: 0.5rem;
  overflow: hidden;
}

.history-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.history-info {
  flex: 1;
}

.history-type {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
}

.history-time {
  font-size: 0.75rem;
  opacity: 0.7;
}

.history-actions {
  display: flex;
  gap: 0.35rem;
}

.btn-icon {
  width: 28px;
  height: 28px;
  border-radius: 0.35rem;
  background: #1e293b;
  color: #e5e7eb;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  cursor: pointer;
}

.btn-icon:hover {
  background: #334155;
}

/* Bulk Generator */
.bulk-generator {
  margin: 2rem 0;
  padding: 1.5rem;
  background: linear-gradient(145deg, #0b1220, #020617);
  border-radius: 1rem;
}

.bulk-input-area {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin: 1rem 0;
}

.bulk-preview {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.75rem;
  margin: 1rem 0;
}

.bulk-preview-item {
  position: relative;
  aspect-ratio: 1;
  background: #020617;
  border-radius: 0.5rem;
  overflow: hidden;
}

.bulk-preview-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.bulk-progress {
  height: 4px;
  background: #1e293b;
  border-radius: 2px;
  overflow: hidden;
}

.bulk-progress-bar {
  height: 100%;
  background: #22c55e;
  transition: width 0.3s ease;
}

/* Scanner Modal */
.scanner-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.scanner-container {
  position: relative;
  max-width: 500px;
  width: 90%;
  background: #020617;
  border-radius: 1rem;
  padding: 1rem;
}

.scanner-video {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 0.75rem;
  transform: scaleX(-1);
}

.scanner-overlay {
  position: absolute;
  top: 1rem;
  left: 1rem;
  right: 1rem;
  bottom: 1rem;
  border: 2px solid #22c55e;
  border-radius: 0.75rem;
  pointer-events: none;
}

.scanner-close {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  background: #1e293b;
  border: none;
  color: white;
  font-size: 1.5rem;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Dynamic QR Fields */
.dynamic-fields {
  margin: 1rem 0;
}

.dynamic-field {
  margin-bottom: 1rem;
}

.dynamic-field label {
  display: block;
  margin-bottom: 0.35rem;
  opacity: 0.85;
  font-size: 0.9rem;
}

.dynamic-field input,
.dynamic-field select,
.dynamic-field textarea {
  width: 100%;
  padding: 0.6rem;
  border-radius: 0.4rem;
  border: none;
  background: #020617;
  color: #e5e7eb;
}

/* Templates Panel */
.templates-panel {
  margin: 2rem 0;
}

.templates-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 0.75rem;
  margin: 1rem 0;
}

.template-card {
  background: #020617;
  border-radius: 0.75rem;
  padding: 1rem;
  text-align: center;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.template-card:hover {
  transform: translateY(-2px);
  background: #1e293b;
}

.template-icon {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.template-name {
  font-weight: 600;
  font-size: 0.9rem;
}

/* Theme Toggle */
.theme-toggle {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: #22c55e;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease;
}

.theme-toggle:hover {
  transform: scale(1.1);
}

/* Light Theme */
body.theme-light {
  background: #f8fafc;
  color: #0f172a;
}

.theme-light .qr-preview,
.theme-light .qr-customizer,
.theme-light .history-item,
.theme-light .template-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
}

.theme-light input,
.theme-light textarea,
.theme-light select {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: #0f172a;
}

.theme-light .btn-secondary {
  background: #e2e8f0;
  color: #1e293b;
}

/* PWA Install Button */
#pwa-install {
  position: fixed;
  bottom: 5rem;
  right: 2rem;
  z-index: 998;
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from {
    transform: translateY(100px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Keyboard Shortcuts Hint */
.shortcuts-hint {
  position: fixed;
  bottom: 1rem;
  left: 1rem;
  background: rgba(2, 6, 23, 0.8);
  padding: 0.5rem 1rem;
  border-radius: 2rem;
  font-size: 0.8rem;
  backdrop-filter: blur(4px);
  border: 1px solid rgba(148, 163, 184, 0.12);
}

/* Responsive */
@media (max-width: 768px) {
  .bulk-input-area {
    grid-template-columns: 1fr;
  }

  .bulk-preview {
    grid-template-columns: repeat(3, 1fr);
  }

  .theme-toggle {
    bottom: 5rem;
  }
}