/* ==========================================================================
   Design System Configuration & Variables (02_Design_System)
   ========================================================================== */
:root {
  --bg-color: #050505;
  --surface-color-1: #0D0D0D;
  --surface-color-2: #111111;
  --accent-1: #8B0000;
  --accent-2: #A31515;
  --accent-3: #C41E3A;
  --text-color: #F0EDE8;
  --text-secondary: #9A9690;
  
  --font-display: 'Bebas Neue', sans-serif;
  --font-body: 'Cormorant Garamond', serif;
  --font-mono: 'Space Mono', monospace;
  
  --transition-smooth: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ==========================================================================
   Base Structure
   ========================================================================== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-color);
  color: var(--text-color);
  font-family: var(--font-body);
  font-size: 1.15rem;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Fixed Top Navigation */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 60px;
  background-color: rgba(5, 5, 5, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--surface-color-2);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  z-index: 1000;
}

.nav-logo {
  font-family: var(--font-display);
  font-size: 1.7rem;
  letter-spacing: 0.08em;
  color: var(--text-color);
  text-decoration: none;
}

.nav-logo span {
  color: var(--accent-3);
}

.nav-link {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-secondary);
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  transition: var(--transition-smooth);
}

.nav-link:hover {
  color: var(--text-color);
  text-shadow: 0 0 8px rgba(240, 237, 232, 0.3);
}

/* Main Layout Wrapper */
.main-container {
  flex: 1;
  width: 100%;
  max-width: 1200px;
  margin: 80px auto 40px auto;
  padding: 0 1.5rem;
}

/* ==========================================================================
   Hero Header Segment
   ========================================================================== */
.hero-section {
  text-align: center;
  margin-bottom: 2.5rem;
}

.title {
  font-family: var(--font-display);
  font-size: 3.5rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
  color: var(--text-color);
}

.subtitle {
  color: var(--text-secondary);
  font-size: 1.25rem;
  font-weight: 300;
}

/* ==========================================================================
   Upload Container Segment (Mobile-First Default)
   ========================================================================== */
.upload-container {
  max-width: 600px;
  margin: 0 auto;
  width: 100%;
}

.drop-zone {
  background-color: var(--surface-color-1);
  border: 1px dashed var(--surface-color-2);
  border-radius: 4px;
  padding: 4rem 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.drop-zone:hover, 
.drop-zone.drag-over {
  border-color: var(--accent-1);
  background-color: var(--surface-color-2);
  box-shadow: 0 0 20px rgba(139, 0, 0, 0.15);
}

.drop-icon {
  margin-bottom: 1.5rem;
  color: var(--accent-1);
  transition: var(--transition-smooth);
}

.drop-zone:hover .drop-icon {
  color: var(--accent-3);
  transform: translateY(-4px);
}

.drop-text {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.95rem;
  color: var(--text-color);
  margin-bottom: 0.5rem;
}

.drop-text .highlight {
  color: var(--accent-3);
  text-decoration: underline;
}

.drop-subtext {
  display: block;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* ==========================================================================
   Interactive Workspace Layout (Mobile First Grid)
   ========================================================================== */
.workspace {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  margin-top: 1rem;
}

/* Tablet and Desktop Screens */
@media (min-width: 992px) {
  .workspace {
    grid-template-columns: 1.2fr 1fr;
    align-items: start;
  }
}

/* ==========================================================================
   Comparison Slider Component
   ========================================================================== */
.preview-panel {
  width: 100%;
}

.comparison-slider {
  position: relative;
  width: 100%;
  aspect-ratio: 4/3;
  background-color: #020202;
  border: 1px solid var(--surface-color-2);
  border-radius: 4px;
  overflow: hidden;
  user-select: none;
}

@media (min-width: 768px) {
  .comparison-slider {
    aspect-ratio: 16/10;
  }
}

.slider-img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
}

.img-before {
  z-index: 10;
}

.img-after {
  z-index: 20;
  clip-path: inset(0 0 0 var(--slider-pos, 50%));
}

/* Slider Controls & Handles */
.slider-line {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--slider-pos, 50%);
  width: 2px;
  background-color: var(--accent-3);
  z-index: 30;
  transform: translateX(-50%);
  pointer-events: none;
  box-shadow: 0 0 8px var(--accent-3);
}

.slider-button {
  position: absolute;
  top: 50%;
  left: var(--slider-pos, 50%);
  width: 40px;
  height: 40px;
  background-color: var(--surface-color-1);
  border: 2px solid var(--accent-3);
  border-radius: 50%;
  z-index: 40;
  transform: translate(-50%, -50%);
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.7);
}

.slider-button::before {
  content: '↔';
  color: var(--text-color);
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: bold;
}

/* Unobtrusive, Overlayed Drag Control input */
.slider-control {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 50;
  opacity: 0;
  cursor: ew-resize;
  margin: 0;
}

/* Labels on the Preview screen */
.slider-label {
  position: absolute;
  top: 15px;
  background-color: rgba(13, 13, 13, 0.75);
  border: 1px solid var(--surface-color-2);
  color: var(--text-color);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  padding: 4px 10px;
  border-radius: 2px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  z-index: 60;
}

.label-before {
  left: 15px;
}

.label-after {
  right: 15px;
}

/* ==========================================================================
   Controls & Configurations Panel
   ========================================================================== */
.controls-panel {
  width: 100%;
}

.card {
  background-color: var(--surface-color-1);
  border: 1px solid var(--surface-color-2);
  border-radius: 4px;
  padding: 2rem 1.5rem;
}

.card-title {
  font-family: var(--font-display);
  font-size: 2rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--surface-color-2);
  padding-bottom: 0.5rem;
}

.setting-group {
  margin-bottom: 2rem;
}

.setting-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.setting-label {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--text-secondary);
  text-transform: uppercase;
}

.setting-value {
  font-family: var(--font-mono);
  font-size: 1rem;
  color: var(--accent-3);
  font-weight: bold;
}

/* Quality Input Range Design */
.quality-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  background: var(--surface-color-2);
  border-radius: 2px;
  outline: none;
}

.quality-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent-3);
  cursor: pointer;
  border: none;
  transition: var(--transition-smooth);
}

.quality-slider::-webkit-slider-thumb:hover {
  background: var(--text-color);
  transform: scale(1.1);
}

.quality-slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent-3);
  cursor: pointer;
  border: none;
  transition: var(--transition-smooth);
}

.quality-slider::-moz-range-thumb:hover {
  background: var(--text-color);
  transform: scale(1.1);
}

/* Metric Display Area */
.metrics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 2rem;
}

.metric-box {
  border: 1px solid var(--surface-color-2);
  padding: 1rem;
  border-radius: 4px;
  display: flex;
  flex-direction: column;
}

.metric-box.full-width {
  grid-column: span 2;
}

.metric-box.highlighted {
  border-color: rgba(139, 0, 0, 0.3);
}

.metric-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 0.25rem;
}

.metric-value {
  font-family: var(--font-mono);
  font-size: 1.15rem;
  font-weight: bold;
  color: var(--text-color);
}

.metric-box.highlighted .metric-value {
  color: var(--accent-3);
}

/* ==========================================================================
   Buttons and Call-to-Actions (Actions)
   ========================================================================== */
.actions-group {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.btn {
  display: block;
  width: 100%;
  padding: 0.8rem 1.5rem;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  text-decoration: none;
  border-radius: 4px;
  cursor: pointer;
  transition: var(--transition-smooth);
}

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

.btn-primary:hover {
  background-color: var(--accent-3);
  border-color: var(--accent-3);
  box-shadow: 0 0 15px rgba(196, 30, 58, 0.4);
}

.btn-accent {
  background-color: transparent;
  border: 1px solid var(--text-color);
  color: var(--text-color);
}

.btn-accent:hover {
  background-color: var(--text-color);
  color: var(--bg-color);
}

.btn-outline {
  background-color: transparent;
  border: 1px solid var(--surface-color-2);
  color: var(--text-secondary);
}

.btn-outline:hover {
  border-color: var(--text-secondary);
  color: var(--text-color);
}

/* Helper Utilities */
.hidden {
  display: none !important;
}

/* ==========================================================================
   Footer
   ========================================================================== */
.footer {
  border-top: 1px solid var(--surface-color-2);
  padding: 2rem 1.5rem;
  margin-top: auto;
  text-align: center;
}

.footer-license {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 0.25rem;
}

.footer-logo {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: rgba(154, 150, 144, 0.4);
}
.footer-tagline {
  font-size: 0.75rem;
  color: rgba(154, 150, 144, 0.4);
  margin-top: 0.4rem;
}
.format-select {
  width: 100%;
  padding: 0.8rem 1rem;
  background: var(--surface-color-2);
  color: var(--text-color);
  border: 1px solid var(--surface-color-2);
  border-radius: 4px;
  font-family: var(--font-mono);
  cursor: pointer;
}

.format-select:focus {
  outline: none;
  border-color: var(--accent-3);
}
