/* Theme Variables */
:root {
  /* Light Theme */
  --light-primary: #7c3aed;
  --light-primary-dark: #6d28d9;
  --light-primary-light: #a78bfa;
  --light-background: #ffffff;
  --light-background-secondary: #f3f4f6;
  --light-text: #1f2937;
  --light-text-secondary: #4b5563;
  --light-border: #e5e7eb;
  --light-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  
  /* Dark Theme */
  --dark-primary: #7c3aed;
  --dark-primary-dark: #6d28d9;
  --dark-primary-light: #a78bfa;
  --dark-background: #1f2937;
  --dark-background-secondary: #111827;
  --dark-text: #f9fafb;
  --dark-text-secondary: #d1d5db;
  --dark-border: #374151;
  --dark-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);

  /* Common Variables */
  --border-radius-sm: 0.375rem;
  --border-radius-md: 0.5rem;
  --border-radius-lg: 0.75rem;
  --border-radius-xl: 1rem;
  --transition-base: all 0.3s ease;
}

/* Dark Theme (Default) */
:root {
  --primary-color: var(--dark-primary);
  --primary-dark: var(--dark-primary-dark);
  --primary-light: var(--dark-primary-light);
  --background-start: #312e81;
  --background-end: #6d28d9;
  --text-color: var(--dark-text);
  --text-color-secondary: var(--dark-text-secondary);
  --background-color: var(--dark-background);
  --background-color-secondary: var(--dark-background-secondary);
  --border-color: var(--dark-border);
  --shadow-color: var(--dark-shadow);
}

/* Light Theme */
[data-theme="light"] {
  --primary-color: var(--light-primary);
  --primary-dark: var(--light-primary-dark);
  --primary-light: var(--light-primary-light);
  --background-start: #e0e7ff;
  --background-end: #c4b5fd;
  --text-color: var(--light-text);
  --text-color-secondary: var(--light-text-secondary);
  --background-color: var(--light-background);
  --background-color-secondary: var(--light-background-secondary);
  --border-color: var(--light-border);
  --shadow-color: var(--dark-shadow);
}

/* Theme Toggle Button */
.theme-toggle {
  position: fixed;
  top: 1rem;
  right: 1rem;
  background: var(--background-color-secondary);
  border: 2px solid var(--primary-color);
  color: var(--text-color);
  padding: 0.5rem;
  border-radius: 50%;
  cursor: pointer;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-base);
  z-index: 1000;
  box-shadow: var(--shadow-color);
}

.theme-toggle:hover {
  transform: scale(1.1);
  background: var(--primary-color);
  color: white;
}

/* Update existing styles to use theme variables */
body {
  background: linear-gradient(135deg, var(--background-start) 0%, var(--background-end) 100%);
  color: var(--text-color);
}

.blackbox {
  background-color: var(--background-color);
  box-shadow: var(--shadow-color);
}

.fancy-btn {
  background: linear-gradient(90deg, var(--primary-color), var(--primary-light));
  color: white;
  font-weight: 600;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.filter-btn {
  background: var(--background-color-secondary);
  color: var(--text-color);
  border: 1px solid var(--primary-color);
  font-weight: 500;
}

.filter-btn:hover {
  background: var(--primary-color);
  color: white;
}

input[type="number"],
select {
  background: var(--background-color-secondary);
  color: var(--text-color);
  border: 1px solid var(--border-color);
  font-weight: 500;
}

input[type="range"] {
  background: var(--background-color-secondary);
}

input[type="range"]::-webkit-slider-thumb {
  background: var(--primary-color);
  border: 2px solid var(--background-color);
}

.preview-label {
  color: var(--text-color);
  font-weight: 500;
}

.filter-instruction {
  color: var(--text-color);
  font-weight: 500;
}

.bulk-list {
  display: none; /* Hide by default */
  color: var(--text-color);
  font-weight: 500;
  margin: 1rem 0;
  padding: 1rem;
  background: var(--background-color-secondary);
  border-radius: var(--border-radius-md);
  border: 1px solid var(--border-color);
  max-height: 200px;
  overflow-y: auto;
}

.bulk-list:not(:empty) {
  display: block; /* Show only when it has content */
}

.bulk-list span {
  display: inline-block;
  position: relative;
  margin: 0 8px 8px 0;
  transition: var(--transition-base);
}

.bulk-list span:hover {
  transform: translateY(-2px);
}

.bulk-list img {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 8px;
  border: 2px solid var(--primary-color);
  box-shadow: var(--shadow-color);
  vertical-align: middle;
  transition: var(--transition-base);
}

.bulk-list img:hover {
  border-color: var(--primary-light);
  box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3);
}

.bulk-list button {
  position: absolute;
  top: -8px;
  right: -8px;
  background: var(--primary-color);
  border: none;
  border-radius: 50%;
  width: 22px;
  height: 22px;
  color: white;
  font-weight: bold;
  cursor: pointer;
  box-shadow: var(--shadow-color);
  transition: var(--transition-base);
  opacity: 0;
  transform: scale(0.8);
}

.bulk-list span:hover button {
  opacity: 1;
  transform: scale(1);
}

.bulk-list button:hover {
  transform: scale(1.1);
  background: var(--primary-dark);
}

.bulk-list div {
  font-size: 11px;
  color: var(--text-color);
  text-align: center;
  max-width: 60px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-top: 4px;
  transition: var(--transition-base);
}

/* Scrollbar styling for bulk list */
.bulk-list::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.bulk-list::-webkit-scrollbar-track {
  background: var(--background-color);
  border-radius: 4px;
}

.bulk-list::-webkit-scrollbar-thumb {
  background: var(--primary-color);
  border-radius: 4px;
}

.bulk-list::-webkit-scrollbar-thumb:hover {
  background: var(--primary-dark);
}

/* Reset and base styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
  min-height: 100%;
  margin: 0;
  padding: 0;
  font-family: 'Inter', 'Segoe UI', Arial, sans-serif;
  line-height: 1.5;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: linear-gradient(135deg, var(--background-start) 0%, var(--background-end) 100%);
  color: var(--text-color);
  padding: 0;
}

/* Layout */
.main-wrapper {
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 0;
  min-width: 0;
  padding: 1rem;
  width: 100%;
}

.max-w-5xl {
  width: 100%;
  max-width: 48rem;
  margin: 0 auto;
}

.blackbox {
  background-color: var(--background-color);
  border-radius: var(--border-radius-xl);
  box-shadow: var(--shadow-color);
  padding: 1.5rem;
  width: 100%;
  height: auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Typography */
.main-heading {
  text-align: center;
  font-weight: bold;
  margin-bottom: 1.5rem;
  animation: pulse 2s infinite;
  padding: 0 1rem;
  word-break: break-word;
  line-height: 1.3;
  max-width: 95%;
  margin-left: auto;
  margin-right: auto;
  font-size: clamp(1.5rem, 5vw, 2.5rem);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Drop Zone */
.drop-zone {
  background: var(--background-color-secondary);
  border: 2px dashed var(--primary-color);
  color: var(--text-color);
  font-weight: 500;
  padding: clamp(1rem, 5vw, 2.5rem);
  border-radius: var(--border-radius-lg);
  cursor: pointer;
  text-align: center;
  font-size: clamp(0.9rem, 2vw, 1.1rem);
  transition: var(--transition-base);
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 1rem 0;
  position: relative;
  overflow: hidden;
}

.drop-zone:hover {
  transform: scale(1.02);
  box-shadow: 0 0 20px var(--primary-light);
  border-color: var(--primary-light);
}

.drop-zone.dragover {
  background: var(--primary-light);
  border-color: var(--primary-color);
  color: white;
  animation: none;
}

/* Buttons */
.fancy-btn {
  background: linear-gradient(90deg, var(--primary-color), var(--primary-light));
  color: white;
  padding: 0.75rem 1.5rem;
  border-radius: var(--border-radius-lg);
  border: none;
  cursor: pointer;
  font-weight: 600;
  font-size: 1rem;
  box-shadow: 0 0 20px rgba(147, 51, 234, 0.3);
  transition: var(--transition-base);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.fancy-btn:hover {
  background: linear-gradient(90deg, var(--primary-light), var(--primary-color));
  box-shadow: 0 0 30px rgba(192, 132, 252, 0.4);
  transform: translateY(-2px);
}

.file-btn {
  color: var(--primary-color);
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
}

.file-btn:hover {
  color: var(--primary-dark);
}

/* Preview Container */
.preview-container {
  background: var(--background-color-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg);
  padding: 1rem;
  margin: 1rem 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  width: 100%;
}

.preview-label {
  text-align: center;
  font-size: 0.9rem;
  color: var(--text-color);
  margin-bottom: 0.75rem;
  font-weight: 500;
}

/* Filters */
.filter-container {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  justify-content: center;
  margin: 1.5rem 0;
  padding: 0 1rem;
}

.filter-btn {
  background: var(--background-color-secondary);
  color: var(--text-color);
  padding: 0.75rem 1.25rem;
  border-radius: var(--border-radius-md);
  cursor: pointer;
  transition: var(--transition-base);
  border: 1px solid var(--primary-color);
  font-size: 0.9rem;
  min-width: 100px;
}

.filter-btn:hover {
  background: var(--primary-color);
  transform: translateY(-2px);
}

.filter-btn.active {
  background: var(--primary-color);
  box-shadow: 0 0 10px var(--primary-light);
}

/* Sliders and Controls */
.filter-slider-container {
  display: flex;
  align-items: center;
  gap: 1rem;
  justify-content: center;
  margin: 1rem 0;
  padding: 0 1rem;
  flex-wrap: wrap;
}

input[type="range"] {
  width: 100%;
  max-width: 300px;
  height: 6px;
  background: var(--background-color-secondary);
  border-radius: 3px;
  outline: none;
  -webkit-appearance: none;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  background: var(--primary-color);
  border-radius: 50%;
  cursor: pointer;
  transition: var(--transition-base);
}

input[type="range"]::-webkit-slider-thumb:hover {
  background: var(--primary-light);
  transform: scale(1.1);
}

/* Responsive Design */
@media (max-width: 768px) {
  .blackbox {
    padding: 1rem;
    border-radius: var(--border-radius-lg);
  }

  .preview-container {
    grid-template-columns: 1fr;
  }

  .filter-container {
    gap: 0.5rem;
  }

  .filter-btn {
    padding: 0.5rem 1rem;
    min-width: 80px;
    font-size: 0.85rem;
  }

  .fancy-btn {
    padding: 0.6rem 1.2rem;
    font-size: 0.9rem;
  }
}

@media (max-width: 480px) {
  .main-wrapper {
    padding: 0.5rem;
  }

  .drop-zone {
    padding: 1rem;
    min-height: 150px;
  }

  .filter-slider-container {
    flex-direction: column;
    align-items: stretch;
  }

  input[type="range"] {
    max-width: 100%;
  }
}

/* Animations */
@keyframes pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.02);
  }
}

@keyframes subtlePulse {
  0%, 100% {
    box-shadow: 0 0 10px var(--primary-color);
  }
  50% {
    box-shadow: 0 0 30px var(--primary-light);
  }
}

/* Footer styles for important pages links */
.site-footer {
  border-top: 1px solid rgba(255,255,255,0.04);
  margin-top: 1.5rem;
  padding: 18px 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.02), transparent);
}
.site-footer .footer-link {
  color: var(--primary-light);
  text-decoration: none;
  padding: 8px 12px;
  border-radius: 8px;
  transition: var(--transition-base);
  font-weight: 600;
}
.site-footer .footer-link:hover {
  background: rgba(124,58,237,0.12);
  color: white;
  transform: translateY(-2px);
}

/* Page container for static pages */
.static-page {
  max-width: 900px;
  margin: 2.5rem auto;
  padding: 1.25rem;
  background: var(--background-color);
  border-radius: 12px;
  box-shadow: var(--shadow-color);
  color: var(--text-color);
}
.static-page h1 { margin-bottom: 0.75rem; }
.static-page p { margin-bottom: 0.75rem; color: var(--text-color-secondary); line-height:1.6 }

/* Utility Classes */
.flex { display: flex; }
.justify-center { justify-content: center; }
.items-center { align-items: center; }
.gap-4 { gap: 1rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mt-4 { margin-top: 1rem; }
.hidden { display: none; }
.block { display: block; }
.text-center { text-align: center; }
.text-sm { font-size: 0.875rem; }
.text-gray-300 { color: var(--gray-300); }
.text-purple-300 { color: var(--primary-light); }
.text-purple-400 { color: var(--primary-light); }
.font-semibold { font-weight: 600; }
.rounded-xl { border-radius: var(--border-radius-lg); }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
.py-3 { padding-top: 0.75rem; padding-bottom: 0.75rem; }
.bg-gray-700 { background-color: var(--gray-700); }
.bg-purple-600 { background-color: var(--primary-color); }
.hover\:bg-purple-600:hover { background-color: var(--primary-color); }
.hover\:bg-gray-700:hover { background-color: var(--gray-700); }
.shadow { box-shadow: var(--shadow-md); }
.transition { transition: var(--transition-base); }

/* Signature */
.signature-container {
  margin-top: 2rem;
  margin-bottom: 1rem;
  text-align: right;
  width: 100%;
  padding: 0 1rem;
}

.signature-text {
  font-family: 'Pacifico', 'Dancing Script', cursive, sans-serif;
  font-size: clamp(1.2rem, 3vw, 2rem);
  color: var(--text-color);
  text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.2);
  letter-spacing: 2px;
  user-select: none;
  display: inline-block;
  padding-right: 0.5rem;
}

.signature-heart {
  color: #ff4d6d;
  font-size: 1.2em;
  vertical-align: middle;
  margin: 0 0.2em;
  animation: heartbeat 1.5s infinite;
}

@keyframes heartbeat {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

/* Image Preview */
img {
  max-height: 200px;
  border-radius: var(--border-radius-md);
  object-fit: contain;
  width: 100%;
  height: auto;
  box-shadow: var(--shadow-md);
}

/* Loading Overlay (presentational only) */
.loading-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, rgba(17,15,39,0.5), rgba(17,15,39,0.65));
  backdrop-filter: blur(6px) saturate(110%);
  z-index: 1200;
}
.loading-overlay.hidden { display: none; }
.loading-card {
  background: linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.02));
  border: 1px solid rgba(255,255,255,0.06);
  padding: 1.2rem 1.3rem;
  border-radius: 14px;
  min-width: 320px;
  max-width: 520px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.6), 0 2px 8px rgba(124,58,237,0.08);
  text-align: center;
  color: var(--text-color);
}
.loading-title { font-size: 1.05rem; font-weight: 700; color: var(--primary-light); margin-bottom: 0.25rem; }
.loading-sub { font-size: 0.9rem; color: var(--text-color-secondary); margin-bottom: 0.75rem; }
.progress-wrapper { width: 100%; height: 12px; background: rgba(255,255,255,0.03); border-radius: 999px; overflow: hidden; border: 1px solid rgba(255,255,255,0.02); }
.progress-bar { height: 100%; width: 0%; background: linear-gradient(90deg, var(--primary-color), var(--primary-light)); box-shadow: 0 6px 18px rgba(124,58,237,0.25); transition: width 220ms linear; }
.loading-msg { font-size: 0.9rem; margin-top: 0.6rem; color: var(--text-color-secondary); }

@media (max-width: 480px) {
  .loading-card { min-width: 260px; margin: 0 12px; }
}

/* Form Elements */
input[type="number"],
select {
  width: 100%;
  padding: 0.75rem;
  border-radius: var(--border-radius-md);
  background: var(--background-color-secondary);
  color: var(--text-color);
  border: 1px solid var(--border-color);
  font-size: 1rem;
  transition: var(--transition-base);
}

input[type="number"]:focus,
select:focus {
  outline: none;
  border-color: var(--primary-light);
  box-shadow: 0 0 0 2px rgba(167, 139, 250, 0.2);
}

/* Grid Layout for Advanced Mode */
.grid {
  display: grid;
  gap: 1rem;
}

@media (min-width: 640px) {
  .grid-cols-2 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .grid-cols-3 {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Loading States */
.loading {
  opacity: 0.7;
  pointer-events: none;
  position: relative;
}

.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 24px;
  height: 24px;
  margin: -12px 0 0 -12px;
  border: 2px solid var(--primary-light);
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@media (max-width: 269px) {
  .max-w-5xl {
    height: 100vh;
  }
}

html, body {
  height: 100%;
  min-height: 100%;
  margin: 0;
  padding: 0;
}

.main-wrapper {
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 0;
  min-width: 0;
  padding: 1rem;
}

.max-w-5xl {
  width: 100%;
  max-width: 48rem;
}

.bg-gray-800 {
  background-color: #1f2937;
}

.p-6 {
  padding: 1.5rem;
}

.rounded-2xl {
  border-radius: 1rem;
}

.shadow-2xl {
  box-shadow: 0 10px 40px 0 #00000040;
}

img {
  max-height: 200px;
  border-radius: 10px;
}

.drop-zone {
  border: 4px dashed #7c3aed;
  padding: 40px;
  border-radius: 18px;
  cursor: pointer;
  text-align: center;
  font-size: 1.1rem;
  color: #d1d5db;
  background: linear-gradient(to right, #2e1065, #4c1d95);
  transition: transform 0.3s, box-shadow 0.3s, border-color 0.3s;
  animation: subtlePulse 3s infinite;
  height: 26vw;
  align-items: center;
  justify-content: center;
  display: flex;
}

.drop-zone:hover {
  transform: scale(1.02);
  box-shadow: 0 0 20px #a78bfa;
}

.drop-zone.dragover {
  background-color: #4c1d95;
  border-color: #c084fc;
  animation: none;
}

@keyframes subtlePulse {
  0%, 100% {
    box-shadow: 0 0 10px #7c3aed;
  }
  50% {
    box-shadow: 0 0 30px #a78bfa;
  }
}

.file-btn {
  background-color: #9333ea;
  color: white;
  padding: 0.5rem 2rem;
  border-radius: 10px;
  cursor: pointer;
}

.file-btn:hover {
  background-color: #a855f7;
}

input[type="file"] {
  display: none;
}

.fancy-btn {
  background: linear-gradient(90deg, #7c3aed, #a855f7);
  box-shadow: 0 0 20px #9333ea;
  transition: all 0.3s;
}

.fancy-btn:hover {
  background: linear-gradient(90deg, #a855f7, #9333ea);
  box-shadow: 0 0 30px #c084fc;
  transform: scale(1.05);
}

.preview-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 1rem;
}

.preview-label {
  text-align: center;
  font-size: 0.9rem;
  color: #a78bfa;
  margin-bottom: 0.5rem;
}

.filter-btn {
  background: #4c1d95;
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  border: 1px solid #7c3aed;
}

.filter-btn:hover {
  background: #7c3aed;
  transform: translateY(-2px);
}

.filter-btn.active {
  background: #7c3aed;
  box-shadow: 0 0 10px #a78bfa;
}

.filter-container {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: center;
  margin: 1rem 0;
}

.filter-instruction {
  text-align: center;
  font-size: 0.9rem;
  color: #a78bfa;
  margin-bottom: 0.5rem;
}

.filter-slider-container {
  display: flex;
  align-items: center;
  gap: 1rem;
  justify-content: center;
  margin-bottom: 1rem;
}

.filter-slider-label {
  color: #a78bfa;
  font-size: 0.95rem;
  min-width: 90px;
  text-align: right;
}

.filter-slider-value {
  color: #c084fc;
  font-weight: bold;
  min-width: 40px;
  text-align: left;
}

.bulk-list {
  color: #a78bfa;
  font-size: 0.95rem;
  margin-bottom: 0.5rem;
}

/* Responsive adjustments */
@media (max-width: 900px) {
  .max-w-5xl {
    max-width: 100%;
  }

  .preview-container {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .main-wrapper {
    padding: 0.5rem;
  }

  .p-6 {
    padding: 1rem;
  }

  .preview-container {
    grid-template-columns: 1fr;
  }

  .drop-zone {
    padding: 20px;
    font-size: 1rem;
  }
}

.signature-container {
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
  text-align: right;
  width: 100%;
}

@media (max-width: 640px) {
  .signature-container {
    text-align: center;
    margin-top: 1rem;
  }
}

.main-wrapper > .max-w-5xl {
  margin-bottom: 0;
}

.blackbox {
  height: 100%;
  width: 100vw;
}

.main-heading {
  text-align: center;
  font-weight: bold;
  margin-bottom: 24px;
  animation: pulse 2s infinite;
  padding: 0 1rem;
  word-break: break-word;
  line-height: 1.3;
  max-width: 95%;
  margin-left: auto;
  margin-right: auto;
}

/* Responsive font sizes */
@media (max-width: 639px) {
  .main-heading {
    font-size: 1.5rem;
  }
}

@media (min-width: 640px) {
  .main-heading {
    font-size: 1.75rem;
  }
}

@media (min-width: 768px) {
  .main-heading {
    font-size: 2rem;
  }
}

@media (min-width: 1024px) {
  .main-heading {
    font-size: 2.5rem;
  }
}

/* Additional utility classes */
.flex {
  display: flex;
}

.justify-center {
  justify-content: center;
}

.items-center {
  align-items: center;
}

.gap-4 {
  gap: 1rem;
}

.mb-4 {
  margin-bottom: 1rem;
}

.mb-6 {
  margin-bottom: 1.5rem;
}

.mt-4 {
  margin-top: 1rem;
}

.hidden {
  display: none;
}

.block {
  display: block;
}

.text-center {
  text-align: center;
}

.text-sm {
  font-size: 0.875rem;
}

.text-gray-300 {
  color: #d1d5db;
}

.text-purple-300 {
  color: #d8b4fe;
}

.text-purple-400 {
  color: #c084fc;
}

.font-semibold {
  font-weight: 600;
}

.rounded-xl {
  border-radius: 0.75rem;
}

.px-4 {
  padding-left: 1rem;
  padding-right: 1rem;
}

.py-2 {
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
}

.px-6 {
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

.py-3 {
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
}

.bg-gray-700 {
  background-color: #374151;
}

.bg-purple-600 {
  background-color: #9333ea;
}

.hover\:bg-purple-600:hover {
  background-color: #9333ea;
}

.hover\:bg-gray-700:hover {
  background-color: #374151;
}

.shadow {
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
}

.transition {
  transition-property: background-color, border-color, color, fill, stroke, opacity, box-shadow, transform;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  transition-duration: 150ms;
}

/* Signature styles */
.signature-text {
  font-family: 'Pacifico', 'Dancing Script', cursive, sans-serif;
  font-size: 2rem;
  color: #fff;
  background: none;
  -webkit-background-clip: initial;
  background-clip: initial;
  -webkit-text-fill-color: initial;
  text-shadow: 2px 2px 8px #00000033;
  letter-spacing: 2px;
  user-select: none;
  display: inline-block;
  padding-right: 0.5rem;
}

.signature-highlight {
  color: var(--primary-color);
  font-weight: 600;
}

.signature-heart {
  color: #ff4d6d;
  font-size: 1.2em;
  vertical-align: middle;
  margin: 0 0.2em;
}

@media (max-width: 640px) {
  .signature-text {
    font-size: 1.2rem;
    padding-right: 0.2rem;
  }
}

/* Update text colors for better visibility */
#easyEstimate,
#estimate,
#easyAiMessage,
#aiMessage {
  color: var(--text-color);
  font-weight: 500;
}

#easyEstimate b,
#estimate b {
  color: var(--primary-color);
  font-weight: 600;
}

/* File name display styles */
#fileNameDisplay {
  color: var(--text-color);
  font-weight: 500;
  margin: 1rem 0;
  padding: 0.5rem;
  background: var(--background-color-secondary);
  border-radius: var(--border-radius-md);
  border: 1px solid var(--border-color);
}

#fileName {
  color: var(--primary-color);
  font-weight: 600;
  padding: 0.2rem 0.5rem;
  background: var(--background-color);
  border-radius: var(--border-radius-sm);
  border: 1px solid var(--border-color);
  margin-left: 0.5rem;
}

/* Compression Animation */
.compression-animation {
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--background-color);
  padding: 2rem;
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-color);
  z-index: 1000;
  text-align: center;
  border: 2px solid var(--primary-color);
}

.compression-animation.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

.compression-spinner {
  width: 50px;
  height: 50px;
  border: 4px solid var(--background-color-secondary);
  border-top: 4px solid var(--primary-color);
  border-radius: 50%;
  margin: 0 auto 1rem;
  animation: spin 1s linear infinite;
}

.compression-text {
  color: var(--text-color);
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.compression-progress {
  width: 200px;
  height: 4px;
  background: var(--background-color-secondary);
  border-radius: 2px;
  margin: 0 auto;
  overflow: hidden;
}

.compression-progress-bar {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--primary-color), var(--primary-light));
  animation: progress 2s ease-in-out infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes progress {
  0% { width: 0%; }
  50% { width: 100%; }
  100% { width: 0%; }
}

@keyframes fadeIn {
  from { opacity: 0; transform: translate(-50%, -60%); }
  to { opacity: 1; transform: translate(-50%, -50%); }
}

/* Add overlay when compressing */
.compression-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  z-index: 999;
}

.compression-overlay.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

/* Download Animation */
.download-animation {
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--background-color);
  padding: 2rem;
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-color);
  z-index: 1000;
  text-align: center;
  border: 2px solid var(--primary-color);
}

.download-animation.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

.download-icon {
  width: 60px;
  height: 60px;
  margin: 0 auto 1rem;
  position: relative;
}

.download-icon::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 20px;
  height: 20px;
  border: 4px solid var(--primary-color);
  border-radius: 50%;
  animation: downloadPulse 1.5s ease-in-out infinite;
}

.download-icon::after {
  content: '';
  position: absolute;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 30px;
  background: var(--primary-color);
  animation: downloadArrow 1.5s ease-in-out infinite;
}

.download-text {
  color: var(--text-color);
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.download-progress {
  width: 200px;
  height: 4px;
  background: var(--background-color-secondary);
  border-radius: 2px;
  margin: 0 auto;
  overflow: hidden;
}

.download-progress-bar {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--primary-color), var(--primary-light));
  animation: downloadProgress 2s ease-in-out;
}

@keyframes downloadPulse {
  0% { transform: translateX(-50%) scale(1); opacity: 1; }
  50% { transform: translateX(-50%) scale(1.2); opacity: 0.5; }
  100% { transform: translateX(-50%) scale(1); opacity: 1; }
}

@keyframes downloadArrow {
  0% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(10px); }
  100% { transform: translateX(-50%) translateY(0); }
}

@keyframes downloadProgress {
  0% { width: 0%; }
  100% { width: 100%; }
}

/* Download overlay */
.download-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  z-index: 999;
}

.download-overlay.active {
  display: block;
  animation: fadeIn 0.3s ease;
} 