/* Image Opacity Online - Modern Material UI 3 (M3) Styles */

.opacity-controls {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* M3 Mode Selector Tabs */
.mode-selector {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  background: rgba(15, 23, 42, 0.85);
  padding: 5px;
  border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(12px);
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.3);
  margin-bottom: 4px;
}

.mode-btn {
  padding: 8px 14px;
  background: transparent;
  border: none;
  border-radius: 9999px;
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
}

.mode-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.mode-btn.active {
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.45);
  font-weight: 700;
}

/* M3 Background Fill Cards */
.bg-fill-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 4px;
}

.bg-fill-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 8px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.bg-fill-btn:hover {
  border-color: rgba(99, 102, 241, 0.4);
  color: var(--text-primary);
  background: rgba(30, 41, 59, 0.7);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}

.bg-fill-btn.active {
  border-color: #6366f1;
  background: rgba(99, 102, 241, 0.12);
  color: #ffffff;
  box-shadow: 0 0 16px rgba(99, 102, 241, 0.3), inset 0 0 0 1px #6366f1;
}

.bg-preview-swatch {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.25);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.bg-fill-btn:hover .bg-preview-swatch {
  transform: scale(1.1);
}

.bg-fill-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: inherit;
}

.bg-fill-badge {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.06);
  padding: 2px 6px;
  border-radius: 9999px;
}

.bg-fill-btn.active .bg-fill-badge {
  color: #a5b4fc;
  background: rgba(99, 102, 241, 0.25);
}

.blur-preview {
  background: radial-gradient(circle at 30% 30%, #818cf8 0%, #38bdf8 50%, #4f46e5 100%);
  filter: blur(0.5px);
}

.checker-pattern {
  background-image: linear-gradient(45deg, #2a2a38 25%, transparent 25%),
                    linear-gradient(-45deg, #2a2a38 25%, transparent 25%),
                    linear-gradient(45deg, transparent 75%, #2a2a38 75%),
                    linear-gradient(-45deg, transparent 75%, #2a2a38 75%);
  background-size: 10px 10px;
  background-position: 0 0, 0 5px, 5px -5px, -5px 0px;
  background-color: #1a1a24;
}

/* Canvas Viewport */
.canvas-container {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 480px;
  max-height: 680px;
  background-color: #0b0f19;
  background-image: linear-gradient(45deg, #141c2e 25%, transparent 25%),
                    linear-gradient(-45deg, #141c2e 25%, transparent 25%),
                    linear-gradient(45deg, transparent 75%, #141c2e 75%),
                    linear-gradient(-45deg, transparent 75%, #141c2e 75%);
  background-size: 16px 16px;
  background-position: 0 0, 0 8px, 8px -8px, -8px 0px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.5);
  user-select: none;
}

#opacity-canvas {
  max-width: 100%;
  max-height: 100%;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6);
  transition: transform 0.05s ease-out;
  transform-origin: center center;
  border-radius: 4px;
}

/* Responsive */
.steps-grid,
.features-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

@media (max-width: 1024px) {
  .steps-grid,
  .features-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .steps-grid,
  .features-grid {
    grid-template-columns: 1fr;
  }
  .mode-selector {
    grid-template-columns: 1fr;
    border-radius: 16px;
  }
  .bg-fill-grid {
    grid-template-columns: 1fr;
  }
}
