:root {
  --bg-primary: #000000;
  --bg-secondary: rgba(255, 255, 255, 0.05);
  --bg-tertiary: rgba(255, 255, 255, 0.03);
  --text-primary: #ffffff;
  --text-secondary: #cccccc;
  --text-muted: rgba(255, 255, 255, 0.6);
  --border-color: rgba(255, 255, 255, 0.15);
  --border-hover: rgba(255, 255, 255, 0.3);
  --grid-color: rgba(255, 255, 255, 0.1);
  --shadow-color: rgba(0, 0, 0, 0.3);
  --glass-bg: rgba(255, 255, 255, 0.05);
  --glass-border: rgba(255, 255, 255, 0.15);
}

[data-theme="light"] {
  --bg-primary: #f8f9fa;
  --bg-secondary: rgba(0, 0, 0, 0.05);
  --bg-tertiary: rgba(0, 0, 0, 0.03);
  --text-primary: #212529;
  --text-secondary: #495057;
  --text-muted: rgba(0, 0, 0, 0.6);
  --border-color: rgba(0, 0, 0, 0.15);
  --border-hover: rgba(0, 0, 0, 0.3);
  --grid-color: rgba(0, 0, 0, 0.1);
  --shadow-color: rgba(0, 0, 0, 0.1);
  --glass-bg: rgba(255, 255, 255, 0.8);
  --glass-border: rgba(0, 0, 0, 0.1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  /* Replaced clean gradient with animated grid pattern background */
  background: linear-gradient(var(--grid-color) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-color) 1px, transparent 1px), var(--bg-primary);
  background-size: 50px 50px;
  animation: gridMove 20s linear infinite;
  min-height: 100vh;
  color: var(--text-primary);
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* Added keyframe animation for moving grid background */
@keyframes gridMove {
  0% {
    background-position: 0 0, 0 0;
  }
  100% {
    background-position: 50px 50px, 50px 50px;
  }
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

/* Header Styles */
.header {
  text-align: center;
  margin-bottom: 40px;
}

.header-content {
  /* Updated header to liquid glass design with enhanced transparency and blur effects */
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  border-radius: 25px;
  padding: 40px;
  border: 1px solid var(--glass-border);
  box-shadow: 0 8px 32px var(--shadow-color), inset 0 1px 0 rgba(255, 255, 255, 0.2), inset 0 -1px 0
    rgba(255, 255, 255, 0.1);
  transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  position: relative;
  overflow: hidden;
}

/* Added liquid glass hover effects for header */
.header-content:hover {
  transform: translateY(-5px);
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--border-hover);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4), 0 0 40px rgba(255, 255, 255, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.3),
    inset 0 -1px 0 rgba(255, 255, 255, 0.15);
}

/* Added shimmer effect for header */
.header-content::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  transition: left 0.6s ease;
}

.header-content:hover::before {
  left: 100%;
}

.logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
  margin-bottom: 20px;
  position: relative;
}

/* Added logo image styles */
.logo-img {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.2);
}

.logo h1 {
  font-size: 3rem;
  font-weight: 700;
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 2px;
}

.subtitle {
  font-size: 1.2rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.6;
}

/* Main Content */
.main-content {
  margin-bottom: 60px;
}

/* Upload Section */
.upload-section {
  /* Updated to liquid glass design with enhanced transparency and blur effects */
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  border-radius: 25px;
  padding: 40px;
  border: 1px solid var(--glass-border);
  box-shadow: 0 8px 32px var(--shadow-color), inset 0 1px 0 rgba(255, 255, 255, 0.2), inset 0 -1px 0
    rgba(255, 255, 255, 0.1);
  margin-bottom: 30px;
  transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  position: relative;
  overflow: hidden;
}

.upload-section:hover {
  transform: translateY(-5px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4), 0 0 40px rgba(255, 255, 255, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.3),
    inset 0 -1px 0 rgba(255, 255, 255, 0.15);
}

.upload-tabs {
  display: flex;
  gap: 15px;
  margin-bottom: 40px;
  justify-content: center;
}

.tab-btn {
  padding: 15px 30px;
  border: 1px solid var(--border-color);
  background: var(--bg-secondary);
  color: var(--text-muted);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 0.9rem;
  font-weight: 500;
}

.tab-btn.active {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border-color: var(--border-hover);
}

.tab-btn:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  transform: translateY(-2px);
}

.url-area {
  border: 2px dashed var(--border-color);
  border-radius: 15px;
  padding: 60px 20px;
  text-align: center;
  background: rgba(255, 255, 255, 0.02);
  transition: all 0.3s ease;
}

.url-icon {
  font-size: 3rem;
  margin-bottom: 20px;
  opacity: 0.7;
}

.url-area h3 {
  font-size: 1.3rem;
  margin-bottom: 10px;
  color: var(--text-primary);
  font-weight: 600;
}

.url-area p {
  color: var(--text-muted);
  margin-bottom: 25px;
}

.url-input-group {
  display: flex;
  gap: 15px;
  max-width: 500px;
  margin: 0 auto 20px;
  align-items: stretch;
}

.url-input {
  flex: 1;
  padding: 15px 20px;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-size: 1rem;
  transition: all 0.3s ease;
}

.url-input::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

.url-input:focus {
  outline: none;
  border-color: var(--border-hover);
  background: var(--bg-tertiary);
}

.upload-area {
  border: 2px dashed var(--border-color);
  border-radius: 15px;
  padding: 60px 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  background: var(--bg-secondary);
}

.upload-area:hover {
  border-color: var(--border-hover);
  background: var(--bg-tertiary);
}

.upload-icon {
  font-size: 3rem;
  margin-bottom: 20px;
  opacity: 0.7;
}

.upload-area h3 {
  font-size: 1.3rem;
  margin-bottom: 10px;
  color: var(--text-primary);
  font-weight: 600;
}

.upload-area p {
  color: var(--text-muted);
  margin-bottom: 10px;
}

.file-info {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.5);
}

/* Processing Section */
.processing-section {
  /* Matching minimal card design */
  background: var(--bg-tertiary);
  border-radius: 20px;
  padding: 50px 40px;
  border: 1px solid var(--border-color);
  box-shadow: 0 20px 40px var(--shadow-color);
  transition: all 0.3s ease;
}

.processing-section:hover {
  transform: translateY(-5px);
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.4);
}

.image-comparison {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  margin-bottom: 40px;
}

@media (max-width: 768px) {
  .image-comparison {
    grid-template-columns: 1fr;
    gap: 30px;
  }
}

.image-container {
  /* Clean minimal image container design */
  background: var(--bg-secondary);
  border-radius: 15px;
  padding: 25px;
  border: 1px solid var(--border-color);
  box-shadow: 0 10px 20px var(--shadow-color);
  transition: all 0.3s ease;
}

.image-container:hover {
  transform: translateY(-3px);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.3);
}

.image-container h3 {
  font-size: 1.1rem;
  margin-bottom: 20px;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
}

.image-wrapper {
  border-radius: 10px;
  overflow: hidden;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  height: 350px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.image-wrapper img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 8px;
}

@media (max-width: 768px) {
  .image-wrapper {
    height: 280px;
  }
}

@media (max-width: 480px) {
  .image-wrapper {
    height: 220px;
  }
}

#processedImageContainer {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 350px;
  color: var(--text-muted);
}

@media (max-width: 768px) {
  #processedImageContainer {
    height: 280px;
  }
}

@media (max-width: 480px) {
  #processedImageContainer {
    height: 220px;
  }
}

.loading-spinner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
}

.spinner {
  width: 35px;
  height: 35px;
  border: 3px solid rgba(255, 255, 255, 0.2);
  border-top: 3px solid #ffffff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Buttons */
.button-group {
  display: flex;
  gap: 20px;
  justify-content: center;
  flex-wrap: wrap;
}

.btn {
  padding: 15px 35px;
  border: none;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 160px;
  justify-content: center;
}

.btn-primary {
  background: var(--text-primary);
  color: var(--bg-primary);
  box-shadow: 0 8px 20px rgba(255, 255, 255, 0.15);
}

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

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

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

.btn-secondary:hover {
  background: var(--bg-secondary);
  transform: translateY(-2px);
}

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

.btn-outline:hover {
  background: var(--bg-secondary);
  transform: translateY(-2px);
}

/* Error Message */
.error-message {
  background: rgba(220, 53, 69, 0.15);
  color: #ff6b6b;
  padding: 15px 20px;
  border-radius: 10px;
  margin-top: 20px;
  border: 1px solid rgba(220, 53, 69, 0.2);
}

/* Features Section */
.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 40px;
  margin-top: 80px;
}

.feature {
  /* Clean minimal feature cards with subtle shadows */
  background: var(--bg-tertiary);
  padding: 40px 30px;
  border-radius: 20px;
  text-align: center;
  border: 1px solid var(--border-color);
  box-shadow: 0 20px 40px var(--shadow-color);
  transition: all 0.3s ease;
}

.feature:hover {
  transform: translateY(-8px);
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.4);
}

.feature-icon {
  font-size: 3rem;
  margin-bottom: 25px;
  opacity: 0.8;
}

.feature h3 {
  font-size: 1.3rem;
  margin-bottom: 15px;
  color: var(--text-primary);
  font-weight: 700;
}

.feature p {
  color: var(--text-muted);
  line-height: 1.6;
  font-weight: 300;
}

/* Responsive Design */
@media (max-width: 768px) {
  .container {
    padding: 40px 15px;
  }

  .header-content {
    padding: 40px 25px;
  }

  .logo h1 {
    font-size: 2.5rem;
  }

  .subtitle {
    font-size: 1rem;
  }

  .upload-section,
  .processing-section {
    padding: 35px 25px;
  }

  .upload-area {
    padding: 40px 20px;
  }

  .button-group {
    flex-direction: column;
    align-items: center;
  }

  .btn {
    width: 100%;
    max-width: 250px;
  }

  .url-input-group {
    flex-direction: column;
    gap: 15px;
  }

  .url-input {
    width: 100%;
  }
}

/* Added theme toggle button styles */
.theme-toggle {
  position: absolute;
  top: -10px;
  right: -10px;
  background: var(--glass-bg);
  border: 1px solid var(--border-color);
  border-radius: 50%;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

.theme-toggle:hover {
  background: var(--bg-secondary);
  border-color: var(--border-hover);
  transform: scale(1.1);
}

.theme-icon {
  font-size: 1.5rem;
  transition: transform 0.3s ease;
}

.theme-toggle:hover .theme-icon {
  transform: rotate(20deg);
}
