:root {
  /* Canva-inspired Color Palette */
  --primary: #00d2ff;          /* Brighter, Electric Cyan */
  --primary-hover: #0096c7;
  --bg-base: #050a10;          /* Deepest Navy/Black for high contrast */
  --bg-surface: rgba(15, 23, 42, 0.65); /* Semi-transparent surface for depth */
  --text-main: #ffffff;        /* Pure white for sharpness */
  --text-muted: #a1a1aa;
  --border: rgba(255, 255, 255, 0.15); /* Crisper, visible borders */
  --shadow-sm: 0 4px 6px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 10px 24px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 15px rgba(0, 210, 255, 0.2); /* Neon glow effect */
  --radius: 12px;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg-base);
  color: var(--text-main);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: var(--bg-base);
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 6px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--primary);
}

/* Core App Layout */
.app-layout {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* Sidebar for Tools & Settings */
.sidebar {
  width: 340px;
  background: var(--bg-surface);
  border-right: 1px solid var(--border);
  padding: 24px;
  overflow-y: auto;
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  z-index: 10;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Tool Panel Animation Wrapper */
.tool-panels-wrapper {
  position: relative;
}

.tool-panel {
  opacity: 0;
  transform: translateX(-15px);
  transition: opacity 0.3s ease-out, transform 0.3s ease-out;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  pointer-events: none; /* Prevent interaction with hidden panels */
}

.tool-panel.active {
  opacity: 1;
  transform: translateX(0);
  position: relative; /* Use relative to take up space in the document flow */
  pointer-events: auto;
}

/* Main Workspace */
.workspace {
  flex: 1;
  padding: 40px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Stunning Drop Zone */
#media-drop-zone {
  width: 100%;
  max-width: 800px;
  padding: 60px 40px;
  background: var(--bg-surface);
  border: 2px dashed #b3bac5;
  border-radius: var(--radius);
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-bottom: 30px;
}
#media-drop-zone:hover, #media-drop-zone.drag-over {
  border-color: var(--primary);
  background: rgba(0, 180, 216, 0.1);
}

/* Slide Card Components (from the app.js update) */
.image-duration-row {
  background: var(--bg-surface);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 800px;
  transition: transform 0.2s, box-shadow 0.2s;
}
.image-duration-row:hover {
  box-shadow: var(--shadow-glow), var(--shadow-md);
  border-color: rgba(0, 210, 255, 0.4);
  transform: translateY(-2px);
}

/* UI Utility Classes we added to app.js */
.image-left-group { display: flex; flex-direction: column; gap: 12px; }
.media-thumbnail { width: 100%; height: 160px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); }
.slide-time-controls { display: flex; gap: 12px; margin-top: 12px; }
.slide-control-group { display: flex; flex-direction: column; gap: 6px; flex: 1; }
.slide-control-group label { font-size: 0.85rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }
.slide-actions-group { display: flex; gap: 8px; margin-top: 16px; }

.image-name {
  flex: 1;
  font-size: 0.95rem;
  color: var(--text-main);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Inputs and Selects */
input[type="text"], input[type="number"], select, .modern-input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  transition: all 0.2s;
  box-sizing: border-box;
  background: rgba(0, 0, 0, 0.4);
  color: var(--text-main);
}
input:focus, select:focus {
  outline: none;
  background: rgba(0, 0, 0, 0.6);
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 210, 255, 0.25);
}

/* Buttons */
button, .primary-btn {
  background: var(--primary);
  color: #000;
  border: none;
  padding: 12px 20px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  width: auto;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  box-shadow: 0 2px 10px rgba(0, 210, 255, 0.3);
}
button:hover {
  background: var(--text-main);
  box-shadow: 0 4px 15px rgba(255, 255, 255, 0.4);
}
.apply-all-btn, .duplicate-btn, .delete-btn { background: rgba(255, 255, 255, 0.05); color: #f8fafc; flex: 1; border: 1px solid var(--border); box-shadow: none; }
.apply-all-btn:hover, .duplicate-btn:hover { background: rgba(255, 255, 255, 0.1); border-color: var(--text-muted); color: #fff; box-shadow: none; }
.delete-btn:hover { background: rgba(255, 50, 50, 0.15); border-color: #ff4757; color: #ff4757; box-shadow: none; }

/* Action Grid / Floating Dashboard Navigation */
.action-grid {
  display: flex;
  justify-content: center;
  gap: 15px;
  padding: 15px 20px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  scrollbar-width: none; /* Hide scrollbar for clean look */
}
.action-grid::-webkit-scrollbar {
  display: none;
}
.nav-card {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 12px 20px;
  min-width: 100px;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}
.nav-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 15px rgba(0, 210, 255, 0.2);
  border-color: rgba(0, 210, 255, 0.4);
}
.nav-card.active {
  background: rgba(0, 180, 216, 0.15);
  border-color: var(--primary);
  box-shadow: 0 0 10px rgba(0, 210, 255, 0.3);
}
.nav-card.active .icon-box {
  filter: drop-shadow(0 0 10px #ff00aa);
  transform: scale(1.15);
}
.nav-card .icon-box {
  font-size: 1.5rem;
  margin-bottom: 6px;
  transition: all 0.2s ease;
}
.nav-card span {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
}

/* Status / Link */
#status, .merge-status, #image-tool-status, #printable-status, #av-status {
  margin-top: 20px;
  padding: 15px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  line-height: 1.4;
}

a {
  color: var(--primary);
}

/* Spinners */
.spinner {
  border: 3px solid var(--border);
  border-top: 3px solid var(--primary);
  border-radius: 50%;
  width: 18px;
  height: 18px;
  animation: spin 1s linear infinite;
  display: inline-block;
  vertical-align: middle;
  margin-right: 10px;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Custom Animated Loader for Overlay */
.loader-circle {
  width: 60px;
  height: 60px;
  border: 4px solid var(--border);
  border-top: 4px solid var(--primary);
  border-right: 4px solid #ff00aa; /* Dual-tone effect */
  border-radius: 50%;
  animation: spin 1s linear infinite, pulseGlow 2s ease-in-out infinite;
}
@keyframes pulseGlow {
  0% { box-shadow: 0 0 10px rgba(0, 210, 255, 0.2), inset 0 0 10px rgba(0, 210, 255, 0.2); }
  50% { box-shadow: 0 0 20px rgba(255, 0, 170, 0.4), inset 0 0 20px rgba(255, 0, 170, 0.4); }
  100% { box-shadow: 0 0 10px rgba(0, 210, 255, 0.2), inset 0 0 10px rgba(0, 210, 255, 0.2); }
}

.overlay-cancel-btn:hover {
  background: #ff4757 !important;
  color: #fff !important;
}

/* Progress Bar */
.progress-container {
  width: 100%;
  background-color: #334155;
  border-radius: 8px;
  overflow: hidden;
  position: relative;
  height: 36px;
  margin-top: 15px;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.2);
}

.progress-fill {
  height: 100%;
  background-color: var(--primary);
  width: 0%;
  transition: width 0.4s ease;
}

.progress-text {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  color: #f8fafc;
  font-weight: bold;
  text-shadow: 0 0 3px rgba(0, 0, 0, 0.5); 
}

input[type="checkbox"] {
  accent-color: var(--primary);
  width: 18px;
  height: 18px;
  cursor: pointer;
}

/* Animated Landing Page Background */
#landing-view {
  min-height: 100vh;
  background: linear-gradient(-45deg, #0f172a, #1e293b, #005f73, #0f172a);
  background-size: 400% 400%;
  animation: gradientBG 15s ease infinite;
}

@keyframes gradientBG {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* Landing Page Cards */
.landing-card {
  background: rgba(30, 41, 59, 0.6);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 32px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}
.landing-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-glow), 0 16px 32px rgba(0, 0, 0, 0.6);
  border-color: rgba(0, 180, 216, 0.4);
}

/* Logo Hover Animation */
.logo-hover {
  transition: transform 0.3s ease;
}
.logo-hover:hover {
  transform: scale(1.1);
}

/* Brand Text Gradient */
.brand-text-gradient {
  background: linear-gradient(90deg, var(--text-main), var(--primary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
}

@media (max-width: 768px) {
  .app-layout {
    flex-direction: column;
  }

  /* Ensure media scales correctly on small screens */
  img, video, canvas {
    max-width: 100%;
    height: auto;
  }

  /* Make timeline controls stack vertically */
  .slide-time-controls {
    flex-direction: column;
    gap: 15px;
  }

  /* Adjust drop zone padding for small screens */
  #media-drop-zone {
    padding: 40px 20px;
  }
  
  /* Action Grid mobile layout */
  .action-grid {
    justify-content: flex-start;
    padding: 10px;
    gap: 10px;
  }
  .nav-card {
    padding: 8px 12px;
    min-width: 80px;
  }
  .nav-card .icon-box {
    font-size: 1.2rem;
    margin-bottom: 4px;
  }
  .nav-card span {
    font-size: 0.75rem;
  }

  .sidebar {
    width: 100%;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  
  .workspace {
    padding: 15px 10px;
  }
}
