:root {
  /* Changed to Dark Rose/Plum tones */
  --bg-dark: #1a1016;
  --panel-bg: #2f1b25;

  --text-primary: #fdf2f8; /* Very light pink/white */
  --text-secondary: #fbcfe8; /* Light pink/gray */

  /* PINK ACCENTS */
  --accent-color: #ec4899; /* Hot Pink */
  --accent-hover: #db2777; /* Deep Pink */

  --danger-color: #ef4444;
  --border-radius: 16px;
}

body {
  font-family: "Inter", "Segoe UI", sans-serif;
  /* Deep Pink/Purple Gradient */
  background: linear-gradient(135deg, #1a1016 0%, #4a1d33 100%);
  color: var(--text-primary);
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100vh;
  overflow: hidden;
  user-select: none;
}

/* --- Main Layout Container --- */
.app-container {
  display: flex;
  width: 900px;
  max-width: 95%;
  height: 600px;
  /* Tinted background */
  background: rgba(47, 27, 37, 0.7);
  backdrop-filter: blur(20px);
  border-radius: var(--border-radius);
  /* Pinkish shadow */
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
  overflow: hidden;
  transition: transform 0.3s ease;
}

/* Left Side: Controls */
.controls-panel {
  flex: 1;
  padding: 40px;
  padding-top: 0px;
  padding-bottom: 0px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  z-index: 10;
}

/* Right Side: Hero Image */
.hero-panel {
  flex: 1;
  background-image: url("Astolfo.jpg");
  background-size: cover;
  background-position: center;
  position: relative;
}

.hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  /* Gradient blend to match the new pink panel background */
  background: linear-gradient(to right, rgba(47, 27, 37, 1), transparent);
}

/* --- Typography & Elements --- */
h1 {
  margin: 0 0 10px 0;
  font-size: 2rem;
  letter-spacing: -0.02em;
  /* Gradient text: White to Light Pink */
  background: linear-gradient(to right, #fff, #f9a8d4);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

p.subtitle {
  color: var(--text-secondary);
  margin-bottom: 30px;
  line-height: 1.5;
}

/* --- Custom File Input (Drop Zone) --- */
.drop-zone {
  width: 100%;
  height: 120px;
  border: 2px dashed #831843; /* Dark pink border */
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  margin-bottom: 20px;
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-secondary);
  box-sizing: border-box;
}

.drop-zone:hover {
  border-color: var(--accent-color);
  /* Pink tint on hover */
  background: rgba(236, 72, 153, 0.05);
  color: var(--text-primary);
}

.drop-zone span {
  font-size: 0.9rem;
  margin-top: 8px;
}

.drop-zone .icon {
  font-size: 1.5rem;
}

/* When dragging file over body */
body.dragging .app-container {
  transform: scale(0.98);
  border-color: var(--accent-color);
}
body.dragging .drop-zone {
  border-color: var(--accent-color);
  background: rgba(236, 72, 153, 0.1);
}

/* --- Controls & Buttons --- */
.control-group {
  width: 100%;
  display: flex;
  gap: 15px;
}

select {
  background: #501c30; /* Darker pink bg for inputs */
  color: white;
  padding: 12px 16px;
  border-radius: 8px;
  border: 1px solid #831843;
  flex: 1;
  cursor: pointer;
  outline: none;
}

button#present-btn {
  background: var(--accent-color);
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  flex: 1;
  transition: all 0.2s;
  /* Pink Glow */
  box-shadow: 0 4px 6px -1px rgba(236, 72, 153, 0.4);
}

button#present-btn:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
}
button#present-btn:disabled {
  background: #4a2b3b; /* Desaturated dark pink */
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
  color: #831843;
}

/* --- File Name Display --- */
#file-name-display {
  font-size: 0.85rem;
  color: var(--accent-color);
  margin-top: -10px;
  margin-bottom: 20px;
  height: 20px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
}

/* --- Presentation Mode (Fullscreen Overlay) --- */
#presentation-area {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: black;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

/* Canvas Wrapper & Nav Zones */
#canvas-wrapper {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  perspective: 1000px;
}

canvas {
  max-width: 95vw;
  max-height: 95vh;
  box-shadow: 0 0 50px rgba(0, 0, 0, 1);
}

.click-zone {
  position: absolute;
  top: 0;
  height: 100%;
  width: 50%;
  z-index: 101;
  cursor: default;
}
#left-zone {
  left: 0;
  cursor: w-resize;
}
#right-zone {
  right: 0;
  cursor: e-resize;
}

/* UI Overlay Buttons in Presentation */
.pres-ui-btn {
  position: absolute;
  background: rgba(255, 255, 255, 0.1);
  color: #ddd;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  cursor: pointer;
  z-index: 200;
  transition: 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.pres-ui-btn:hover {
  background: var(--accent-color);
  color: white;
  border-color: transparent;
}

#toggle-screen-btn {
  top: 20px;
  right: 20px;
  width: 40px;
  height: 40px;
  font-size: 1.2rem;
}
#exit-pres-btn {
  top: 20px;
  left: 20px;
  padding: 8px 16px;
  font-size: 0.9rem;
  border-radius: 20px;
}
#exit-pres-btn:hover {
  background: var(--danger-color);
}

/* Page Counter */
#page-counter {
  position: absolute;
  bottom: 30px;
  background: rgba(20, 20, 20, 0.8);
  padding: 6px 16px;
  border-radius: 20px;
  font-family: monospace;
  font-size: 1rem;
  color: #fff;
  z-index: 102;
  pointer-events: none;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Esc Message */
#esc-message {
  position: absolute;
  top: 80px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.8);
  color: #fff;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 0.9rem;
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
  z-index: 200;
}
.show-msg {
  opacity: 1 !important;
}

/* Loader */
#loader {
  position: absolute;
  width: 40px;
  height: 40px;
  border: 4px solid rgba(255, 255, 255, 0.1);
  border-top: 4px solid var(--accent-color);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  z-index: 103;
  display: none;
}
@keyframes spin {
  100% {
    transform: rotate(360deg);
  }
}

/* Animations */
.anim-fade {
  animation: fadeIn 0.4s ease;
}
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.anim-zoom {
  animation: zoomIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
@keyframes zoomIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.anim-slide {
  animation: slideIn 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}
@keyframes slideIn {
  from {
    transform: translateX(60px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.anim-flip {
  animation: flipIn 0.6s cubic-bezier(0.455, 0.03, 0.515, 0.955);
}
@keyframes flipIn {
  from {
    transform: rotateY(90deg);
    opacity: 0;
  }
  to {
    transform: rotateY(0deg);
    opacity: 1;
  }
}

/* Responsive */
@media (max-width: 800px) {
  .app-container {
    flex-direction: column;
    height: auto;
    width: 90%;
  }
  .hero-panel {
    display: none;
  }
  .controls-panel {
    padding: 30px;
  }
}
