/* Cell-Shaded CSS for S3 Upload Interface */

/* CSS Variables for consistent theming */
:root {
  --bg-primary: #1a1a1a;
  --bg-secondary: #2a2a2a;
  --bg-accent: #3a3a3a;
  --border-primary: #ffffff;
  --border-secondary: #888888;
  --border-width: 3px;
  --text-primary: #ffffff;
  --text-secondary: #cccccc;
  --text-muted: #666666;
  --accent-color: #ffffff;
  --accent-hover: #cccccc;
  --shadow-offset: 4px;
  --border-radius: 0; /* Sharp corners for cell-shaded look */
  --font-mono: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  --font-system: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
}

/* Reset and base styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-system);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.5;
  font-size: 16px;
  min-height: 100vh;
}

/* Container and layout */
body > div {
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem;
  position: relative;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-mono);
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 1rem;
}

h3 {
  font-size: 2rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  position: relative;
}

h3::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 0;
  width: 60px;
  height: var(--border-width);
  background: var(--border-primary);
}

/* Tagline styling - positioned beside the underline */
.tagline {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 1px;
  color: var(--text-secondary);
  margin: 0;
  text-transform: uppercase;
  position: absolute;
  bottom: -8px; /* Match the underline position exactly */
  left: 70px; /* Position after the 60px underline + 10px gap */
  line-height: var(--border-width); /* Match the underline height */
}

/* Links */
a {
  color: var(--accent-color);
  text-decoration: none;
  font-family: var(--font-mono);
  font-weight: 500;
  position: relative;
  display: inline-block;
  transition: none; /* Remove smooth transitions for cell-shaded feel */
}

a:hover {
  color: var(--accent-hover);
}

/* Center text utility */
.center-text {
  text-align: center;
}

/* Drop zone styling - main feature */
#drop_zone {
  width: 100%;
  height: 200px;
  border: var(--border-width) dashed var(--border-primary);
  border-radius: var(--border-radius);
  background-color: var(--bg-secondary);
  background-image: 
    radial-gradient(circle at 1px 1px, var(--text-muted) 1px, transparent 0);
  background-size: 4px 4px;
  text-align: center;
  padding: 20px;
  margin: 2rem 0;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  cursor: pointer;
  font-family: var(--font-mono);
  transition: none;
}

/* Cell-shaded shadow effect */
#drop_zone::after {
  content: '';
  position: absolute;
  top: var(--shadow-offset);
  left: var(--shadow-offset);
  right: -var(--shadow-offset);
  bottom: -var(--shadow-offset);
  background-color: var(--bg-accent);
  border: var(--border-width) solid var(--border-secondary);
  z-index: -1;
}

#drop_zone:hover {
  background-color: var(--bg-accent);
  border-color: var(--accent-color);
}

#drop_zone:hover::after {
  background-color: var(--border-primary);
  opacity: 0.2;
}

#drop_zone_text {
  font-size: 1.2rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Drag state styling */
body.drag-over #drop_zone {
  border-color: var(--accent-color);
  background-color: rgba(60, 60, 60, 0.1);
}

/* Upload Progress Bar */
#upload_progress_container {
  margin: 1rem 0;
  height: 80px; /* Fixed height to prevent layout shift */
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease;
}

#upload_progress_container.show {
  opacity: 1;
  visibility: visible;
}

#upload_progress_bar {
  height: 40px;
  background-color: var(--bg-secondary);
  background-image: 
    radial-gradient(circle at 1px 1px, var(--text-muted) 1px, transparent 0);
  background-size: 4px 4px;
  border: var(--border-width) solid var(--border-primary);
  position: relative;
  overflow: hidden;
  margin-bottom: 10px;
}

/* Cell-shaded shadow for progress bar */
#upload_progress_bar::after {
  content: '';
  position: absolute;
  top: var(--shadow-offset);
  left: var(--shadow-offset);
  right: -var(--shadow-offset);
  bottom: -var(--shadow-offset);
  background-color: var(--bg-accent);
  border: var(--border-width) solid var(--border-secondary);
  z-index: -1;
}

#upload_progress_fill {
  height: 100%;
  width: 0%; /* Start empty */
  background: transparent; /* No background by default */
  position: relative;
  transition: width 0.3s ease;
}

#upload_progress_fill.uploading {
  width: 100%;
  background: repeating-linear-gradient(
    45deg,
    var(--text-muted) 0px,
    var(--text-muted) 10px,
    var(--border-secondary) 10px,
    var(--border-secondary) 20px
  );
  background-size: 28px 28px;
  animation: progress-stripes 1s linear infinite;
}

#upload_progress_fill.complete {
  width: 100%;
  background: var(--border-primary);
  animation: progress-pulse 0.8s ease-in-out;
}

#upload_progress_text {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  text-align: center;
  color: var(--text-primary);
}

/* Upload status area */
#upload_status {
  margin-top: 2rem;
}

#upload_status li {
  list-style: none;
  padding: 0.5rem 0;
  margin-bottom: 0.5rem;
  font-family: var(--font-mono);
}

/* Square bullets are now added directly in JavaScript */

#upload_status li a {
  color: var(--accent-color);
  font-weight: 600;
}

#upload_status li a:hover {
  color: var(--accent-hover);
}

/* Toast notifications */
.toast {
  visibility: hidden;
  min-width: 300px;
  margin-left: -150px;
  background-color: var(--bg-secondary);
  background-image: 
    radial-gradient(circle at 1px 1px, var(--text-muted) 1px, transparent 0);
  background-size: 4px 4px;
  color: var(--text-primary);
  text-align: center;
  border: var(--border-width) solid var(--accent-color);
  padding: 1rem;
  position: fixed;
  z-index: 1000;
  left: 50%;
  bottom: 30px;
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Cell-shaded toast shadow */
.toast::after {
  content: '';
  position: absolute;
  top: var(--shadow-offset);
  left: var(--shadow-offset);
  right: -var(--shadow-offset);
  bottom: -var(--shadow-offset);
  background-color: var(--accent-color);
  border: var(--border-width) solid var(--accent-color);
  z-index: -1;
  opacity: 0.3;
}

.toast.show {
  visibility: visible;
  -webkit-animation: slidein 0.3s, slideout 0.3s 2.5s;
  animation: slidein 0.3s, slideout 0.3s 2.5s;
}

/* Sharp animations instead of smooth fades */
@keyframes slidein {
  from {
    bottom: 0;
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    bottom: 30px;
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes slideout {
  from {
    bottom: 30px;
    opacity: 1;
    transform: scale(1);
  }
  to {
    bottom: 0;
    opacity: 0;
    transform: scale(0.8);
  }
}

/* Progress Bar Animations */
@keyframes progress-stripes {
  from {
    background-position: 0 0;
  }
  to {
    background-position: 28px 0;
  }
}

@keyframes progress-pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}

@-webkit-keyframes slidein {
  from {
    bottom: 0;
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    bottom: 30px;
    opacity: 1;
    transform: scale(1);
  }
}

@-webkit-keyframes slideout {
  from {
    bottom: 30px;
    opacity: 1;
    transform: scale(1);
  }
  to {
    bottom: 0;
    opacity: 0;
    transform: scale(0.8);
  }
}

/* Copy links button styling */
a[onclick] {
  color: var(--accent-color);
  text-decoration: none;
  font-family: var(--font-mono);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  display: inline-block;
  margin: 1rem 0;
}

a[onclick]:hover {
  color: var(--accent-hover);
}

/* Clipboard icon styling */
.clipboard-icon {
  margin-right: 0.5rem;
}

/* Hide file input */
#file_input {
  display: none;
}

/* Compression Options Styling */
#compression_options {
  margin: 1.5rem 0;
  padding: 1rem;
  background: transparent;
  font-family: var(--font-mono);
}

#compression_options label {
  display: block;
  margin-bottom: 0.75rem;
  color: var(--text-primary);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: 0.9rem;
}

#compression_options input[type="checkbox"] {
  margin-right: 0.5rem;
  width: 18px;
  height: 18px;
  -webkit-appearance: none;
  appearance: none;
  background-color: var(--bg-accent);
  border: var(--border-width) solid var(--border-primary);
  position: relative;
  cursor: pointer;
}

#compression_options input[type="checkbox"]:checked {
  background-color: var(--accent-color);
}

#compression_options input[type="checkbox"]:checked::after {
  content: '✓';
  position: absolute;
  top: -2px;
  left: 2px;
  color: var(--bg-primary);
  font-weight: bold;
  font-size: 14px;
}

#quality_control {
  margin-top: 0.75rem;
}

#quality_control > label {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 0.8rem;
  font-weight: normal;
}

#quality_presets {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

#quality_presets label {
  display: flex;
  align-items: center;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  color: var(--text-secondary);
  transition: color 0.2s;
}

#quality_presets label:hover {
  color: var(--text-primary);
}

#quality_presets input[type="radio"] {
  margin-right: 0.5rem;
  width: 16px;
  height: 16px;
  -webkit-appearance: none;
  appearance: none;
  background-color: var(--bg-accent);
  border: var(--border-width) solid var(--border-primary);
  border-radius: 50%;
  position: relative;
  cursor: pointer;
}

#quality_presets input[type="radio"]:checked {
  background-color: var(--accent-color);
}

#quality_presets input[type="radio"]:checked::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 6px;
  height: 6px;
  background: var(--bg-primary);
  border-radius: 50%;
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
  body > div {
    padding: 1rem;
  }
  
  h3 {
    font-size: 1.5rem;
  }
  
  #drop_zone {
    height: 150px;
    margin: 1rem 0;
  }
  
  #drop_zone_text {
    font-size: 1rem;
  }
  
  .toast {
    min-width: 280px;
    margin-left: -140px;
    font-size: 0.9rem;
  }
  
  #compression_options {
    margin: 1rem 0;
    padding: 0.75rem;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  :root {
    --border-width: 4px;
    --shadow-offset: 6px;
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  .toast.show {
    -webkit-animation: none;
    animation: none;
  }
  
  * {
    transition: none !important;
  }
}