:root {
  --bg-color: #070709;
  --text-primary: #f0f0f5;
  --text-secondary: #c5c5d0;
  --text-muted: #9e9ea9;
  --accent-glow: linear-gradient(135deg, #ff007a, #7928ca, #4200ff);
  --card-bg: rgba(255, 255, 255, 0.035);
  --card-border: rgba(255, 255, 255, 0.09);
  --code-bg: rgba(255, 0, 122, 0.08);
  --code-border: rgba(255, 0, 122, 0.25);
  --pink-accent: #ff007a;
  --pink-light: #ff3399;
  --success-glow: linear-gradient(135deg, #00e676, #00b0ff);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: '-apple-system', BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

body {
  background-color: var(--bg-color);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  overflow-x: hidden;
  padding: 2.5rem 1rem;
}

/* Ambient Background Orbs */
.glow-orb {
  position: fixed;
  width: 800px;
  height: 800px;
  background: radial-gradient(circle, rgba(121, 40, 202, 0.18) 0%, rgba(0,0,0,0) 70%);
  top: -300px;
  left: -250px;
  z-index: 0;
  animation: float 12s ease-in-out infinite alternate;
  pointer-events: none;
}

.glow-orb-2 {
  position: fixed;
  width: 800px;
  height: 800px;
  background: radial-gradient(circle, rgba(255, 0, 122, 0.15) 0%, rgba(0,0,0,0) 70%);
  bottom: -300px;
  right: -250px;
  z-index: 0;
  animation: float 16s ease-in-out infinite alternate-reverse;
  pointer-events: none;
}

#particleCanvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
}

/* Navigation Bar */
nav {
  position: relative;
  z-index: 2;
  width: 95%;
  max-width: 900px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0 2rem 0;
}

.nav-logo {
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: #fff;
  text-decoration: none;
}

.nav-logo span {
  background: var(--accent-glow);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Main Glass Container */
.container {
  position: relative;
  z-index: 2;
  width: 95%;
  max-width: 900px;
  background: var(--card-bg);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--card-border);
  border-radius: 24px;
  padding: 3.5rem 3rem;
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.6), 
              inset 0 1px 0 rgba(255, 255, 255, 0.12);
  opacity: 0;
  transform: translateY(30px);
  animation: fadeInUp 1.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  margin-bottom: 2rem;
}

/* Header */
.header {
  text-align: center;
  margin-bottom: 2.5rem;
}

.app-name {
  font-size: 3.5rem;
  font-weight: 800;
  letter-spacing: -1px;
  margin-bottom: 0.75rem;
  background: linear-gradient(135deg, #ffffff 30%, #a5a5a5 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.app-name .accent {
  background: var(--accent-glow);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.tagline {
  font-size: 1.1rem;
  color: var(--text-secondary);
  line-height: 1.6;
  font-weight: 300;
  max-width: 650px;
  margin: 0 auto;
}

/* Drag and Drop File Zone */
.file-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 1.5rem 0;
  padding: 3.5rem 2rem;
  border: 2px dashed rgba(255, 255, 255, 0.15);
  border-radius: 20px;
  background: rgba(0, 0, 0, 0.2);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  width: 100%;
}

.upload-icon {
  font-size: 2rem;
  color: var(--pink-light);
  margin-bottom: 0.75rem;
  transition: transform 0.3s;
}

.file-label-text {
  font-size: 1.05rem;
  color: var(--text-secondary);
  font-weight: 400;
}

.file-label:hover, .file-label.is-dragover {
  border-color: var(--pink-accent);
  background: rgba(255, 0, 122, 0.05);
  transform: translateY(-3px);
  box-shadow: 0 12px 30px rgba(255, 0, 122, 0.15);
}

.file-label:hover .upload-icon, .file-label.is-dragover .upload-icon {
  transform: scale(1.15) rotate(5deg);
}

/* Glass Panels & Sections */
.workspace {
  margin-top: 2rem;
  animation: fadeInUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

h2.section-heading {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: #ffffff;
  border-bottom: 1px solid var(--card-border);
  padding-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 10px;
}

.glass-panel {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--card-border);
  border-radius: 18px;
  padding: 2rem;
  margin: 1.5rem 0;
}

.summary-panel {
  padding: 1.25rem;
  max-height: 280px;
  overflow-y: auto;
}

/* Form Controls & Layout */
.dimensions-group {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
}

.input-col {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.icon-col {
  flex: 0 0 auto;
  margin-top: 1.8rem;
  font-size: 1.2rem;
  color: var(--pink-light);
  transition: opacity 0.3s;
}

.icon-col.dimmed {
  opacity: 0.25;
}

label {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

input[type="number"], select {
  padding: 12px 16px;
  border-radius: 10px;
  border: 1px solid var(--card-border);
  background: rgba(0, 0, 0, 0.4);
  color: var(--text-primary);
  font-size: 1rem;
  transition: all 0.3s;
  width: 100%;
}

input[type="number"]:focus, select:focus {
  outline: none;
  border-color: var(--pink-accent);
  background: rgba(0, 0, 0, 0.6);
  box-shadow: 0 0 12px rgba(255, 0, 122, 0.25);
}

.settings-row {
  display: flex;
  align-items: center;
  gap: 20px;
  margin: 1.5rem 0 0.5rem;
}

.split-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: end;
  gap: 20px;
}

/* Custom Checkbox */
.custom-checkbox {
  display: flex;
  align-items: center;
  cursor: pointer;
  position: relative;
  gap: 10px;
  color: var(--text-primary);
  margin: 0;
  font-weight: 400;
}

.custom-checkbox input {
  position: absolute;
  opacity: 0;
  cursor: pointer;
}

.checkmark {
  height: 20px;
  width: 20px;
  background-color: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--card-border);
  border-radius: 6px;
  display: inline-block;
  position: relative;
  transition: all 0.2s;
}

.custom-checkbox:hover input ~ .checkmark {
  background-color: rgba(255, 255, 255, 0.1);
}

.custom-checkbox input:checked ~ .checkmark {
  background-color: var(--pink-accent);
  border-color: var(--pink-accent);
  box-shadow: 0 0 10px rgba(255, 0, 122, 0.4);
}

.checkmark::after {
  content: "";
  position: absolute;
  display: none;
  left: 6px; top: 2px;
  width: 5px; height: 10px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.custom-checkbox input:checked ~ .checkmark::after {
  display: block;
}

/* Range Slider */
input[type="range"] {
  -webkit-appearance: none;
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 3px;
  outline: none;
  margin-top: 12px;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--pink-light);
  cursor: pointer;
  box-shadow: 0 0 10px rgba(255, 0, 122, 0.5);
  transition: transform 0.2s;
}

input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.25);
}

/* Action Buttons */
.action-buttons {
  display: flex;
  gap: 16px;
  margin-top: 2rem;
  justify-content: center;
}

.action-buttons button {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 16px 28px;
  border: none;
  border-radius: 14px;
  font-size: 1.05rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.glow-btn {
  background: linear-gradient(135deg, #ff007a, #7928ca);
  color: #ffffff;
  box-shadow: 0 10px 30px rgba(255, 0, 122, 0.35);
}

.glow-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 15px 40px rgba(255, 0, 122, 0.55);
  background: linear-gradient(135deg, #ff1a8c, #8a3bd8);
}

.ghost-btn {
  background: rgba(255, 255, 255, 0.05);
  color: #ffffff;
  border: 1px solid var(--card-border) !important;
}

.ghost-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.25) !important;
}

button.download-ready {
  background: var(--success-glow);
  box-shadow: 0 10px 30px rgba(0, 230, 118, 0.35);
}

button.download-ready:hover {
  box-shadow: 0 15px 40px rgba(0, 230, 118, 0.55);
}

/* Progress Bar & Indicators */
.progress-wrapper {
  margin: 1.5rem 0;
  width: 100%;
}

.progress-track {
  height: 8px;
  background: rgba(0, 0, 0, 0.4);
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid var(--card-border);
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #ff007a, #7928ca);
  transition: width 0.3s ease;
  box-shadow: 0 0 12px rgba(255, 0, 122, 0.5);
}

.progress-fill.indeterminate {
  width: 30%;
  animation: indet 1.5s infinite ease-in-out;
}

@keyframes indet {
  0% { transform: translateX(-100%); }
  50% { transform: translateX(300%); }
  100% { transform: translateX(-100%); }
}

.progress-text {
  margin-top: 10px;
  font-size: 0.9rem;
  color: var(--text-muted);
  text-align: center;
}

/* Output File Summary Rows */
.file-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.file-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 12px;
  border: 1px solid var(--card-border);
}

.file-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 55%;
  font-weight: 500;
  color: var(--text-primary);
}

.file-sizes {
  color: var(--pink-light);
  font-family: 'SFMono-Regular', Consolas, monospace;
  font-size: 0.88rem;
  text-align: right;
}

/* Processing Dot Animation */
.processing-dots {
  color: var(--pink-light);
  font-weight: 500;
  text-align: center;
  margin: 1rem 0;
}

.processing-dots::after {
  content: '';
  animation: dots 1.5s infinite;
}

@keyframes dots {
  0% { content: ''; }
  25% { content: '.'; }
  50% { content: '..'; }
  75% { content: '...'; }
  100% { content: ''; }
}

.hidden { display: none !important; }

/* Global Animations */
@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes float {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(50px, 40px) scale(1.1); }
}

@media (max-width: 768px) {
  .app-name { font-size: 2.5rem; }
  .container { padding: 2.5rem 1.5rem; }
  .split-row { grid-template-columns: 1fr; gap: 15px; }
  .action-buttons { flex-direction: column-reverse; }
}