:root {
  --bg-dark: #0B0B0D;
  --bg-card: #121214;
  --bg-card-hover: #18181B;
  --border-color: rgba(212, 178, 90, 0.15);
  --border-color-hover: rgba(212, 178, 90, 0.35);
  --border-color-active: #B8943F;
  
  --primary: #D4B25A;
  --primary-hover: #E2C46B;
  --primary-glow: rgba(212, 178, 90, 0.25);
  
  --secondary: #B8943F;
  --secondary-hover: #D4B25A;
  --secondary-glow: rgba(184, 148, 63, 0.2);
  
  --accent: #ea580c;
  --success: #10b981;
  --warning: #f59e0b;
  
  --text-main: #F3F3F3;
  --text-muted: #A7A7A7;
  --text-dark: #0B0B0D;
  
  --font-display: 'Outfit', 'Inter', system-ui, -apple-system, sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;
  
  --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.6);
  --glow-shadow: 0 0 20px rgba(212, 178, 90, 0.1);
}

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

body {
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: var(--font-body);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* Background glowing circles for depth */
body::before {
  content: '';
  position: absolute;
  top: -10%;
  left: 15%;
  width: 40vw;
  height: 40vw;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(212, 178, 90, 0.04) 0%, transparent 70%);
  z-index: -1;
  pointer-events: none;
  filter: blur(50px);
}

body::after {
  content: '';
  position: absolute;
  bottom: 10%;
  right: 10%;
  width: 45vw;
  height: 45vw;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(184, 148, 63, 0.03) 0%, transparent 70%);
  z-index: -1;
  pointer-events: none;
  filter: blur(60px);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

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

::-webkit-scrollbar-thumb {
  background: rgba(212, 178, 90, 0.2);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(212, 178, 90, 0.4);
}

/* Typography elements */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.02em;
}

p {
  line-height: 1.6;
}

/* Glassmorphism utility card */
.glass-panel {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  box-shadow: var(--glass-shadow);
  transition: var(--transition-smooth);
}

.glass-panel:hover {
  border-color: var(--border-color-hover);
}

/* Glowing text and details */
.glow-text-primary {
  text-shadow: 0 0 12px rgba(212, 178, 90, 0.35);
}

.glow-text-secondary {
  text-shadow: 0 0 12px rgba(184, 148, 63, 0.35);
}

/* Container limits */
.app-container {
  max-width: 1300px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem;
}

/* Header design */
.app-header {
  text-align: center;
  margin-bottom: 3rem;
  position: relative;
}

.app-title {
  font-size: 2.8rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
  background: linear-gradient(135deg, #ffffff 40%, var(--primary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
  letter-spacing: -0.03em;
}

.app-subtitle {
  color: var(--text-muted);
  font-size: 1.1rem;
  font-weight: 400;
}

/* Dashboard grid layout */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 2rem;
  align-items: start;
  margin-bottom: 3rem;
}

@media (max-width: 968px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}

/* Workspace section */
.preview-section {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.preview-container {
  position: relative;
  width: 100%;
  min-height: 400px;
  border-radius: 12px;
  background: #0B0B0D;
  border: 1px solid var(--border-color);
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  transition: var(--transition-smooth);
}

.preview-container.dragover {
  border-color: var(--primary);
  background: rgba(212, 178, 90, 0.03);
  box-shadow: 0 0 25px rgba(212, 178, 90, 0.1);
}

/* Image wrapper containing the crop overlay */
.image-wrapper {
  position: relative;
  max-width: 100%;
  max-height: 550px;
  display: inline-block;
}

.image-wrapper img {
  display: block;
  max-width: 100%;
  max-height: 550px;
  object-fit: contain;
  user-select: none;
  pointer-events: none;
}

/* Custom crop overlays styling */
.crop-overlay-root {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.crop-region-box {
  position: absolute;
  border: 1px dashed rgba(184, 148, 63, 0.7);
  background: rgba(184, 148, 63, 0.03);
  box-shadow: inset 0 0 8px rgba(184, 148, 63, 0.05);
  display: flex;
  justify-content: center;
  align-items: center;
  transition: var(--transition-smooth);
}

.crop-region-box::before {
  content: attr(data-label);
  position: absolute;
  padding: 2px 6px;
  background: rgba(18, 18, 20, 0.95);
  border: 1px solid rgba(184, 148, 63, 0.35);
  border-radius: 4px;
  color: #F3F3F3;
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  opacity: 0.85;
  white-space: nowrap;
  pointer-events: none;
  box-shadow: 0 2px 8px rgba(0,0,0,0.5);
}

/* Button style */
.btn {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.75rem 1.5rem;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: var(--transition-smooth);
  position: relative;
  overflow: hidden;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  color: var(--bg-dark);
  box-shadow: 0 4px 15px rgba(212, 178, 90, 0.2);
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(212, 178, 90, 0.35);
  color: var(--bg-dark);
}

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

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

.btn-secondary {
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-main);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.btn-secondary:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(212, 178, 90, 0.25);
}

.btn-accent {
  background: var(--accent);
  color: #fff;
}

.btn-accent:hover {
  background: #e11d48;
}

/* Loading animations */
.loading-pulse {
  animation: pulse 1.5s infinite ease-in-out;
}

@keyframes pulse {
  0%, 100% {
    opacity: 0.6;
  }
  50% {
    opacity: 1;
    transform: scale(1.02);
  }
}

/* Extracted items styles */
.results-container {
  margin-top: 3.5rem;
  padding: 2rem;
  border-radius: 16px;
  border: 1px solid var(--border-color);
  animation: fadeInUp 0.5s ease-out;
}

.results-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1.5rem;
}

.asset-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1rem;
  border-radius: 12px;
  background: rgba(24, 24, 27, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.05);
  transition: var(--transition-smooth);
  position: relative;
  overflow: hidden;
}

.asset-card:hover {
  border-color: var(--primary-glow);
  background: rgba(212, 178, 90, 0.03);
  transform: translateY(-4px);
}

.asset-preview-box {
  width: 100%;
  aspect-ratio: 1;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  margin-bottom: 0.75rem;
  position: relative;
  /* Checkerboard transparency background */
  background-image: 
    linear-gradient(45deg, #18181B 25%, transparent 25%), 
    linear-gradient(-45deg, #18181B 25%, transparent 25%), 
    linear-gradient(45deg, transparent 75%, #18181B 75%), 
    linear-gradient(-45deg, transparent 75%, #18181B 75%);
  background-size: 16px 16px;
  background-position: 0 0, 0 8px, 8px -8px, -8px 0px;
}

.asset-preview-box img {
  max-width: 90%;
  max-height: 90%;
  object-fit: contain;
  transition: transform 0.3s ease;
}

.asset-card:hover .asset-preview-box img {
  transform: scale(1.15);
}

.asset-meta {
  width: 100%;
  text-align: center;
  margin-bottom: 0.75rem;
}

.asset-title {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 0.25rem;
}

.asset-dimensions {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.download-single-btn {
  width: 100%;
  padding: 0.4rem;
  font-size: 0.8rem;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.download-single-btn:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

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