/* ============================================================================
   Photo & Video Editor - High-Tech Modern UI Styles
   ============================================================================
   Features:
   - Dark theme with neon accent colors (red, green, blue)
   - Glassmorphism effects
   - Smooth animations and transitions
   - Responsive design
   - Modern UI patterns
   ============================================================================ */

/* ============================================================================
   CSS Variables - Color Palette
   ============================================================================ */
:root {
  /* Dark backgrounds */
  --bg-primary: #0a0a0a;
  --bg-secondary: #1a1a1a;
  --bg-tertiary: #2a2a2a;

  /* Neon accent colors */
  --neon-red: #ff0040;
  --neon-red-light: #ff3366;
  --neon-green: #00ff88;
  --neon-green-light: #00ffaa;
  --neon-blue: #0088ff;
  --neon-blue-light: #00aaff;
  --neon-cyan: #00ffff;
  --neon-purple: #aa00ff;
  --neon-pink: #ff00aa;

  /* Grays */
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;

  /* Spacing */
  --spacing-xs: 0.25rem;
  --spacing-sm: 0.5rem;
  --spacing-md: 1rem;
  --spacing-lg: 1.5rem;
  --spacing-xl: 2rem;

  /* Border radius */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;

  /* Transitions */
  --transition-fast: 150ms ease-in-out;
  --transition-normal: 300ms ease-in-out;
  --transition-slow: 500ms ease-in-out;
}

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

body {
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
    Arial, sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ============================================================================
   Navigation Buttons
   ============================================================================ */
.nav-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(10px);
}

.nav-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: white;
  border-color: rgba(0, 170, 255, 0.5);
  box-shadow: 0 0 20px rgba(0, 170, 255, 0.3);
}

.nav-btn.active {
  background: linear-gradient(
    135deg,
    rgba(0, 136, 255, 0.3),
    rgba(0, 170, 255, 0.3)
  );
  border-color: var(--neon-blue-light);
  color: white;
  box-shadow: 0 0 30px rgba(0, 170, 255, 0.5);
}

/* ============================================================================
   Section Management
   ============================================================================ */
.editor-section {
  display: none;
  animation: fadeIn 0.5s ease-in-out;
}

.editor-section.active {
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ============================================================================
   Glass Card Effect
   ============================================================================ */
.glass-card {
  background: rgba(26, 26, 26, 0.6);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-xl);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  transition: all var(--transition-normal);
}

.glass-card:hover {
  border-color: rgba(0, 170, 255, 0.3);
  box-shadow: 0 8px 32px rgba(0, 170, 255, 0.2);
}

/* ============================================================================
   Dropzone Styles
   ============================================================================ */
.dropzone {
  border: 2px dashed rgba(0, 170, 255, 0.3);
  border-radius: var(--radius-lg);
  padding: 3rem 2rem;
  text-align: center;
  background: rgba(0, 170, 255, 0.05);
  transition: all var(--transition-normal);
  cursor: pointer;
}

.dropzone:hover {
  border-color: var(--neon-blue-light);
  background: rgba(0, 170, 255, 0.1);
  box-shadow: 0 0 30px rgba(0, 170, 255, 0.2);
}

.dropzone.drag-over {
  border-color: var(--neon-green);
  background: rgba(0, 255, 136, 0.1);
  box-shadow: 0 0 40px rgba(0, 255, 136, 0.3);
  transform: scale(1.02);
}

/* ============================================================================
   Button Styles
   ============================================================================ */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  font-weight: 600;
  border-radius: var(--radius-lg);
  border: none;
  cursor: pointer;
  transition: all var(--transition-normal);
  background: linear-gradient(135deg, var(--neon-blue), var(--neon-blue-light));
  color: white;
  box-shadow: 0 4px 15px rgba(0, 136, 255, 0.4);
  position: relative;
  overflow: hidden;
}

.btn-primary::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.3),
    transparent
  );
  transition: left var(--transition-slow);
}

.btn-primary:hover::before {
  left: 100%;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 25px rgba(0, 136, 255, 0.6);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-primary:disabled:hover {
  transform: none;
  box-shadow: none;
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1rem;
  font-weight: 600;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.2);
  cursor: pointer;
  transition: all var(--transition-normal);
  background: rgba(255, 255, 255, 0.05);
  color: white;
  backdrop-filter: blur(10px);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--neon-cyan);
  box-shadow: 0 0 20px rgba(0, 255, 255, 0.3);
}

/* ============================================================================
   Control Styles
   ============================================================================ */
.control-select {
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(26, 26, 26, 0.8);
  color: white;
  font-size: 0.95rem;
  transition: all var(--transition-normal);
  cursor: pointer;
}

.control-select:hover {
  border-color: var(--neon-blue-light);
  box-shadow: 0 0 15px rgba(0, 170, 255, 0.2);
}

.control-select:focus {
  outline: none;
  border-color: var(--neon-blue);
  box-shadow: 0 0 20px rgba(0, 136, 255, 0.4);
}

.control-input {
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(26, 26, 26, 0.8);
  color: white;
  font-size: 0.95rem;
  transition: all var(--transition-normal);
}

.control-input:hover {
  border-color: var(--neon-blue-light);
}

.control-input:focus {
  outline: none;
  border-color: var(--neon-blue);
  box-shadow: 0 0 20px rgba(0, 136, 255, 0.4);
}

/* ============================================================================
   Slider Styles
   ============================================================================ */
.control-slider {
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: linear-gradient(
    to right,
    rgba(255, 0, 64, 0.3) 0%,
    rgba(0, 255, 136, 0.3) 50%,
    rgba(0, 136, 255, 0.3) 100%
  );
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}

.control-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--neon-blue), var(--neon-cyan));
  cursor: pointer;
  box-shadow: 0 0 15px rgba(0, 170, 255, 0.6);
  transition: all var(--transition-normal);
}

.control-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
  box-shadow: 0 0 25px rgba(0, 170, 255, 0.8);
}

.control-slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--neon-blue), var(--neon-cyan));
  cursor: pointer;
  border: none;
  box-shadow: 0 0 15px rgba(0, 170, 255, 0.6);
  transition: all var(--transition-normal);
}

.control-slider::-moz-range-thumb:hover {
  transform: scale(1.2);
  box-shadow: 0 0 25px rgba(0, 170, 255, 0.8);
}

/* ============================================================================
   Resolution Button Styles
   ============================================================================ */
.resolution-btn {
  padding: 1rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(26, 26, 26, 0.6);
  color: white;
  cursor: pointer;
  transition: all var(--transition-normal);
  text-align: center;
}

.resolution-btn:hover {
  border-color: var(--neon-blue-light);
  background: rgba(0, 136, 255, 0.1);
  box-shadow: 0 0 20px rgba(0, 136, 255, 0.3);
  transform: translateY(-2px);
}

.resolution-btn.active {
  border-color: var(--neon-blue);
  background: linear-gradient(
    135deg,
    rgba(0, 136, 255, 0.3),
    rgba(0, 170, 255, 0.3)
  );
  box-shadow: 0 0 30px rgba(0, 136, 255, 0.5);
}

/* ============================================================================
   Video Tab Styles
   ============================================================================ */
.video-tab {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.7);
}

.video-tab:hover {
  background: rgba(255, 255, 255, 0.1);
  color: white;
  border-color: rgba(0, 170, 255, 0.5);
}

.video-tab.active {
  background: linear-gradient(
    135deg,
    rgba(170, 0, 255, 0.3),
    rgba(255, 0, 170, 0.3)
  );
  border-color: var(--neon-purple);
  color: white;
  box-shadow: 0 0 25px rgba(170, 0, 255, 0.4);
}

/* ============================================================================
   Loading Spinner
   ============================================================================ */
.loading-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(0, 170, 255, 0.2);
  border-top-color: var(--neon-blue-light);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ============================================================================
   Progress Bar
   ============================================================================ */
.progress-bar {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(
    90deg,
    var(--neon-blue),
    var(--neon-cyan),
    var(--neon-green)
  );
  border-radius: 4px;
  transition: width var(--transition-normal);
  position: relative;
  overflow: hidden;
}

.progress-fill::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.3),
    transparent
  );
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

/* ============================================================================
   Toast Notifications
   ============================================================================ */
.toast {
  min-width: 300px;
  padding: 1rem 1.5rem;
  border-radius: var(--radius-lg);
  backdrop-filter: blur(20px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  gap: 1rem;
  animation: slideIn 0.3s ease-out;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.toast.success {
  background: rgba(0, 255, 136, 0.2);
  border-color: var(--neon-green);
  box-shadow: 0 8px 32px rgba(0, 255, 136, 0.3);
}

.toast.error {
  background: rgba(255, 0, 64, 0.2);
  border-color: var(--neon-red);
  box-shadow: 0 8px 32px rgba(255, 0, 64, 0.3);
}

.toast.info {
  background: rgba(0, 136, 255, 0.2);
  border-color: var(--neon-blue);
  box-shadow: 0 8px 32px rgba(0, 136, 255, 0.3);
}

@keyframes slideIn {
  from {
    transform: translateX(400px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.toast-icon {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

.toast-content {
  flex: 1;
}

.toast-title {
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.toast-message {
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.8);
}

/* ============================================================================
   Responsive Design
   ============================================================================ */
@media (max-width: 1024px) {
  .grid-cols-1.lg\\:grid-cols-2 {
    grid-template-columns: 1fr 1fr !important;
  }
}

@media (max-width: 768px) {
  header nav .flex {
    flex-direction: column;
    gap: 1rem;
  }

  .nav-btn {
    width: 100%;
  }

  main {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .glass-card {
    padding: 1.5rem;
  }

  .dropzone {
    padding: 2rem 1rem;
  }
}

@media (max-width: 640px) {
  h2 {
    font-size: 2rem;
  }

  .resolution-btn {
    padding: 0.75rem;
  }

  .resolution-btn .text-lg {
    font-size: 1rem;
  }

  .btn-primary,
  .btn-secondary {
    padding: 0.625rem 1rem;
    font-size: 0.875rem;
  }
}

/* ============================================================================
   Utility Classes
   ============================================================================ */
.hidden {
  display: none !important;
}

.pointer-events-none {
  pointer-events: none;
}

/* ============================================================================
   Neon Glow Effects
   ============================================================================ */
.neon-glow-red {
  box-shadow: 0 0 20px rgba(255, 0, 64, 0.5);
}

.neon-glow-green {
  box-shadow: 0 0 20px rgba(0, 255, 136, 0.5);
}

.neon-glow-blue {
  box-shadow: 0 0 20px rgba(0, 136, 255, 0.5);
}

/* ============================================================================
   Scrollbar Styling
   ============================================================================ */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: rgba(26, 26, 26, 0.5);
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--neon-blue), var(--neon-cyan));
  border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(
    180deg,
    var(--neon-blue-light),
    var(--neon-green)
  );
}

/* ============================================================================
   Focus Styles for Accessibility
   ============================================================================ */
button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid var(--neon-blue);
  outline-offset: 2px;
}

/* ============================================================================
   Image and Video Preview Styles
   ============================================================================ */
#photo-preview,
#video-preview {
  max-width: 100%;
  max-height: 350px;
  height: auto;
  display: block;
  object-fit: contain;
}

/* ============================================================================
   Animation for Status Updates
   ============================================================================ */
@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

.animate-pulse {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Layout fix: compact side-by-side layout */
.glass-card {
  overflow-y: auto;
  max-height: 600px;
}

#photo-preview-container {
  max-height: 400px;
  width: 300px;
  overflow: hidden;
}

/* Make the photo section container more compact */
#photo-section .grid {
  align-items: stretch !important;
}

/* Reduce padding for compact layout */
#photo-section .glass-card {
  padding: 1rem !important;
}


/* === Task CSS Adjustments === */

/* 1. Reduce Upload Photo card width by 100px */
#photo-section .grid > .glass-card:first-child {
    max-width: calc(100% - 100px);
}

/* 2. Increase font sizes in Effects panel by 1px */
#photo-section .grid > .glass-card:last-child .text-sm {
    font-size: 15px !important;
}
#photo-section .grid > .glass-card:last-child .text-xs {
    font-size: 13px !important;
}
#photo-section .grid > .glass-card:last-child .control-select {
    font-size: 15px !important;
}
#photo-section .grid > .glass-card:last-child .text-white {
    font-size: 13px !important;
}

/* 3. Add 5px spacing between sharpness control and Apply Effects button */
#photo-process-btn {
    margin-top: 5px !important;
}
