/* ===== TOPBAR ===== */
.topbar {
  position: sticky; 
  top: 0; 
  z-index: 1000;
  display: flex; 
  justify-content: space-between; 
  align-items: center; 
  gap: 12px;
  padding: 14px 20px; 
  height: var(--topbar-h);
  background-color: var(--bg);
  background-image: linear-gradient(to bottom, rgba(255,255,255,0.06), rgba(0,0,0,0));
  border-bottom: 1px solid var(--border);
}

.left-actions { 
  display: flex; 
  align-items: center; 
  gap: 8px; 
}

/* Center project status text */
#projectStatus {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  margin: 0;
}

.title { 
  font-size: 28px; 
  font-weight: 700; 
  margin: 0; 
}

/* ===== SETTINGS MENU ===== */
.settings { 
  position: relative; 
}

.menu { 
  position: absolute; 
  right: 0; 
  margin-top: 8px; 
  padding: 12px; 
  background: var(--panel); 
  border: 1px solid var(--border); 
  border-radius: 10px; 
  min-width: 380px; 
  box-shadow: 0 8px 20px rgba(0,0,0,0.25); 
  display: none; 
  z-index: 2000; 
}

.menu.visible { 
  display: block; 
}

.menu h4 { 
  margin: 2px 0 8px; 
}

.menu .actions { 
  display: flex; 
  gap: 8px; 
  flex-wrap: wrap; 
}

.menu .item {
  display: flex; 
  align-items: center; 
  gap: 8px;
  width: 100%; 
  padding: 8px 10px; 
  border: 0; 
  background: transparent; 
  cursor: pointer;
  border-radius: 8px; 
  font: inherit; 
  color: inherit; 
  text-align: left;
}

.menu .item:hover { 
  background: rgba(0,0,0,0.06); 
}

.menu .item .ico { 
  display: inline-flex; 
}

/* ===== SWITCHES & TOGGLES ===== */
.switch, .slider-row { 
  display: flex; 
  align-items: center; 
  justify-content: space-between; 
  gap: 12px; 
  padding: 6px 0; 
}

.toggle { 
  width: 48px; 
  height: 26px; 
  border-radius: 999px; 
  background: var(--border); 
  position: relative; 
  border: 1px solid var(--button-border); 
  cursor: pointer; 
}

.toggle::after { 
  content: ""; 
  position: absolute; 
  top: 1px; 
  left: 1px; 
  width: 22px; 
  height: 22px; 
  border-radius: 50%; 
  background: var(--button-bg); 
  border: 1px solid var(--button-border); 
  transition: transform .15s ease; 
}

.toggle.on { 
  background: var(--accent); 
}

.toggle.on::after { 
  transform: translateX(22px); 
}

/* ===== BOXED CONTAINERS ===== */
.boxed { 
  border: 1px dashed var(--border); 
  border-radius: 8px; 
  padding: 8px; 
  margin-top: 6px; 
}

/* ===== FIELD SETS ===== */
fieldset { 
  border: 1px solid var(--border); 
  padding: 12px; 
  border-radius: 8px; 
  background: var(--panel); 
  width: 100%; 
}

legend { 
  padding: 0 6px; 
  font-weight: 600; 
  color: var(--muted); 
}

/* ===== PREVIEW BOX ===== */
.previewBox { 
  border: 1px solid var(--border); 
  border-radius: 10px; 
  padding: 10px; 
  background: var(--panel); 
  display: flex; 
  flex-direction: column; 
  align-items: center; 
  gap: 8px; 
  margin-top: 20px; 
}

.deckPreview { 
  border: 1px solid var(--canvas-border); 
  max-width: 100%; 
  max-height: 80vh; 
  width: auto; 
  height: auto; 
}

/* ===== CAUTION/WARNING ===== */
.caution { 
  color: #ffbf5a; 
  opacity: .95; 
  font-size: 14px; 
}

.caution svg { 
  width: 16px; 
  height: 16px; 
  margin-right: 6px; 
  transform: translateY(2px); 
}

.caution.amber { 
  color: #ffbf5a; 
  display: flex; 
  align-items: flex-start; 
  gap: 12px; 
  font-size: 18px; 
  line-height: 1.3; 
}

.caution.amber .icon { 
  width: 20px; 
  line-height: 1; 
  transform: translateY(1px); 
}

/* ===== SECTION TOOLBAR ===== */
.section-toolbar {
  display: flex; 
  align-items: center; 
  justify-content: space-between;
  gap: 16px; 
  margin-bottom: 10px;
}

.section-toolbar .caution { 
  display: flex; 
  align-items: center; 
  gap: 8px; 
  font-size: 14px; 
  opacity: .9; 
}

.section-toolbar .caution .icon { 
  width: 16px; 
  height: 16px; 
}

/* ===== ACTIONS ROW ===== */
.actions-row { 
  display: flex; 
  gap: 10px; 
  justify-content: flex-end; 
  margin-top: 6px; 
  flex-wrap: wrap; 
}

/* ===== ANIMATIONS ===== */
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* ===== DRAG AND DROP STYLES ===== */

/* Drag and drop zone styling */
.drag-drop-zone {
  position: relative;
  transition: all 0.2s ease;
  cursor: pointer;
}

.drag-drop-zone:hover {
  background: rgba(34, 49, 74, 0.02);
}

.drag-drop-zone.drag-over {
  background: rgba(34, 49, 74, 0.1) !important;
  border-color: #22314a !important;
  transform: scale(1.02);
  box-shadow: 0 4px 12px rgba(34, 49, 74, 0.2);
  animation: pulse 0.6s ease-in-out;
}

.drag-drop-zone.drag-over::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(34, 49, 74, 0.05);
  border: 2px dashed #22314a;
  border-radius: inherit;
  pointer-events: none;
  z-index: 1;
}

.drag-drop-zone.drag-over .txt .title {
  color: #22314a !important;
}

/* Drag and drop notifications */
.drag-drop-notification {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 12px 20px;
  border-radius: 8px;
  color: white;
  font-weight: 500;
  z-index: 10000;
  animation: slideInRight 0.3s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.drag-drop-notification.success {
  background: #4caf50;
}

.drag-drop-notification.error {
  background: #f44336;
}

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

@keyframes pulse {
  0% {
    transform: scale(1.02);
  }
  50% {
    transform: scale(1.05);
  }
  100% {
    transform: scale(1.02);
  }
}

/* Enhanced file button styling for drag and drop */
.themed-btn.file-btn.drag-drop-zone {
  cursor: pointer;
}

.themed-btn.file-btn.drag-drop-zone:hover {
  background: rgba(34, 49, 74, 0.05);
}

/* File input wrapper for deck modal */
.file-input-wrapper {
  position: relative;
  display: inline-block;
  width: 100%;
}

.file-input-wrapper input[type="file"] {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
}

.file-input-wrapper .file-input-display {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border: 2px solid var(--button-border);
  border-radius: 10px;
  background: var(--button-bg);
  color: var(--button-text);
  cursor: pointer;
  transition: all 0.2s ease;
  min-height: 56px;
  position: relative;
  overflow: hidden;
}

.file-input-wrapper .file-input-display:hover {
  background: rgba(34, 49, 74, 0.05);
  border-color: #22314a;
}

.file-input-wrapper .file-input-display::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(45deg, transparent 40%, rgba(34, 49, 74, 0.02) 50%, transparent 60%);
  background-size: 20px 20px;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.file-input-wrapper .file-input-display:hover::after {
  opacity: 1;
}

.file-input-wrapper .file-input-display svg {
  width: 20px;
  height: 20px;
  opacity: 0.9;
}

.file-input-wrapper .file-input-display .txt {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.file-input-wrapper .file-input-display .txt .title {
  font-weight: 700;
  font-size: 16px;
}

.file-input-wrapper .file-input-display .txt .sub {
  font-size: 12px;
  opacity: 0.7;
  margin-top: 4px;
}

/* Drag over state for file input wrapper */
.file-input-wrapper.drag-over .file-input-display {
  background: rgba(34, 49, 74, 0.1);
  border-color: #22314a;
  transform: scale(1.02);
  box-shadow: 0 4px 12px rgba(34, 49, 74, 0.2);
}

.file-input-wrapper.drag-over .file-input-display::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(34, 49, 74, 0.05);
  border: 2px dashed #22314a;
  border-radius: inherit;
  pointer-events: none;
  z-index: 1;
}

/* ===== PROGRESS BAR OVERLAY ===== */
.progress-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  border-radius: inherit;
}

.progress-container {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  min-width: 320px;
  max-width: 400px;
  text-align: center;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.progress-header h4 {
  margin: 0 0 8px 0;
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
}

.progress-header p {
  margin: 0 0 20px 0;
  color: var(--text-secondary);
  font-size: 14px;
}

.progress-bar {
  width: 100%;
  height: 8px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 12px;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-light));
  border-radius: 4px;
  width: 0%;
  transition: width 0.3s ease;
  position: relative;
}

.progress-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  animation: progress-shimmer 2s infinite;
}

@keyframes progress-shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.progress-details {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--text-secondary);
}

.progress-details span:first-child {
  font-weight: 600;
  color: var(--accent);
}

.progress-details span:last-child {
  font-style: italic;
}
