/* ==========================================================================
   DESIGN SYSTEM & VARIABLES
   ========================================================================== */
:root {
  /* Color Palette */
  --bg-main: #0a0a0f;
  --bg-card: rgba(18, 18, 29, 0.65);
  --bg-card-hover: rgba(26, 26, 41, 0.8);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-color-hover: rgba(255, 255, 255, 0.16);
  
  --primary-glow: linear-gradient(135deg, #8b5cf6 0%, #ec4899 100%);
  --primary-color: #8b5cf6;
  --secondary-color: #ec4899;
  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
  --text-inverse: #0a0a0f;
  
  --success: #10b981;
  --error: #ef4444;
  --info: #3b82f6;

  /* Theme dependent items */
  --checker-color-1: #181824;
  --checker-color-2: #101017;
  --bg-preview: #0d0d15;
  --bg-dropdown: #141420;
  --bg-spinner-core: #11111b;
  --orb-opacity: 0.45;
  --bg-header: rgba(10, 10, 15, 0.75);
  --hero-gradient: linear-gradient(135deg, #ffffff 40%, #e2e8f0 70%, #9ca3af 100%);
  --bg-toast: rgba(20, 20, 32, 0.85);
  --border-toast: rgba(255, 255, 255, 0.08);

  /* Dynamic Typography Settings */
  --font-weight-headings: 600;
  --letter-spacing-headings: -0.015em;
  --text-shadow-headings: 0 0 16px rgba(139, 92, 246, 0.12);
  --font-weight-body: 400;

  /* Font Stack */
  --font-display: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  
  /* Layout Options */
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-full: 9999px;
  
  --transition-fast: 0.15s ease;
  --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.5), 0 0 24px rgba(139, 92, 246, 0.1);
  --shadow-glow: 0 0 30px rgba(139, 92, 246, 0.25);
}

body.light-theme {
  --bg-main: #f8fafc;
  --bg-card: rgba(255, 255, 255, 0.75);
  --bg-card-hover: rgba(255, 255, 255, 0.9);
  --border-color: rgba(15, 23, 42, 0.08);
  --border-color-hover: rgba(15, 23, 42, 0.16);
  
  --text-main: #0f172a;
  --text-muted: #475569;
  --text-inverse: #ffffff;
  
  --checker-color-1: #e2e8f0;
  --checker-color-2: #f1f5f9;
  --bg-preview: #f8fafc;
  --bg-dropdown: #ffffff;
  --bg-spinner-core: #ffffff;
  --orb-opacity: 0.12;
  --bg-header: rgba(255, 255, 255, 0.85);
  --hero-gradient: linear-gradient(135deg, #0f172a 30%, #334155 70%, #64748b 100%);
  --bg-toast: rgba(255, 255, 255, 0.92);
  --border-toast: rgba(15, 23, 42, 0.08);

  /* Dynamic Typography Settings */
  --font-weight-headings: 700;
  --letter-spacing-headings: -0.03em;
  --text-shadow-headings: 0 1px 2px rgba(15, 23, 42, 0.05);
  --font-weight-body: 500;
  
  --shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 8px 24px rgba(15, 23, 42, 0.06);
  --shadow-lg: 0 16px 48px rgba(15, 23, 42, 0.08), 0 0 24px rgba(139, 92, 246, 0.03);
}

/* ==========================================================================
   BASE STYLES
   ========================================================================== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-main);
  color: var(--text-main);
  font-family: var(--font-sans);
  font-weight: var(--font-weight-body);
  line-height: 1.6;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  transition: background-color var(--transition-normal), color var(--transition-normal), font-weight var(--transition-normal);
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
}

/* Glowing Background Orbs */
.glow-orb {
  position: absolute;
  border-radius: var(--radius-full);
  filter: blur(120px);
  z-index: -1;
  opacity: var(--orb-opacity);
  pointer-events: none;
  transition: opacity var(--transition-slow);
}

.orb-1 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.3) 0%, rgba(0, 0, 0, 0) 70%);
  top: -100px;
  left: -100px;
  animation: floatOrb 15s infinite alternate ease-in-out;
}

.orb-2 {
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(236, 72, 153, 0.25) 0%, rgba(0, 0, 0, 0) 70%);
  bottom: 10%;
  right: -200px;
  animation: floatOrb 20s infinite alternate-reverse ease-in-out;
}

.orb-3 {
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(6, 182, 212, 0.2) 0%, rgba(0, 0, 0, 0) 70%);
  top: 40%;
  left: 30%;
  animation: floatOrb 18s infinite alternate ease-in-out 2s;
}

@keyframes floatOrb {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(50px, 40px) scale(1.1); }
}

/* Scrollbar Style */
::-webkit-scrollbar {
  width: 10px;
}
::-webkit-scrollbar-track {
  background: var(--bg-main);
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-full);
  border: 2px solid var(--bg-main);
  transition: var(--transition-fast);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--primary-color);
}

/* ==========================================================================
   TYPOGRAPHY
   ========================================================================== */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: var(--font-weight-headings);
  letter-spacing: var(--letter-spacing-headings);
  transition: font-weight var(--transition-normal), letter-spacing var(--transition-normal), text-shadow var(--transition-normal);
}

h1 {
  text-shadow: var(--text-shadow-headings);
}

h2, h3, h4 {
  text-shadow: none;
}

.gradient-text {
  background: var(--primary-glow);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ==========================================================================
   HEADER
   ========================================================================== */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  background: var(--bg-header);
  border-bottom: 1px solid var(--border-color);
  padding: 1.25rem 0;
  padding-top: calc(1.25rem + env(safe-area-inset-top, 0px));
  transition: background-color var(--transition-normal), border-color var(--transition-normal), padding var(--transition-normal);
}

.header-container {
  width: 90%;
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.logo-wrapper {
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  overflow: hidden;
}

.app-logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.brand-name {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-main);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* Language Selector */
.language-selector {
  position: relative;
}

.lang-toggle-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 0.5rem 0.875rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.875rem;
  transition: var(--transition-fast);
}

.lang-toggle-btn:hover, .lang-toggle-btn:focus {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--border-color-hover);
}

.flag-icon {
  font-size: 1.1rem;
}

.chevron-icon {
  transition: transform var(--transition-fast);
  opacity: 0.7;
}

.language-selector.open .chevron-icon {
  transform: rotate(180deg);
}

.lang-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--bg-dropdown);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  width: 160px;
  list-style: none;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translateY(-10px);
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 200;
}

.language-selector.open .lang-dropdown {
  opacity: 1;
  transform: translateY(0);
  pointer-events: all;
}

.lang-dropdown li {
  padding: 0.625rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition-fast);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.lang-dropdown li:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--primary-color);
}

.lang-dropdown li.active {
  color: #fff;
  background: linear-gradient(90deg, rgba(139, 92, 246, 0.15) 0%, rgba(236, 72, 153, 0.05) 100%);
  border-left: 3px solid var(--primary-color);
}

body.light-theme .lang-dropdown li:hover {
  background: rgba(0, 0, 0, 0.04);
}

body.light-theme .lang-dropdown li.active {
  color: var(--primary-color);
  background: rgba(139, 92, 246, 0.08);
  border-left: 3px solid var(--primary-color);
}

/* ==========================================================================
   CARDS & COMMON UI LAYOUTS
   ========================================================================== */
.card {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  transition: border-color var(--transition-normal), box-shadow var(--transition-normal);
}

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

.main-container {
  width: 90%;
  max-width: 1000px;
  margin: 3.5rem auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

/* ==========================================================================
   HERO SECTION
   ========================================================================== */
.hero-section {
  text-align: center;
  max-width: 700px;
  margin: 0 auto;
}

.hero-title {
  font-size: 2.85rem;
  line-height: 1.2;
  margin-bottom: 1rem;
  font-weight: 800;
  background: var(--hero-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  transition: background var(--transition-normal);
}

.hero-subtitle {
  color: var(--text-muted);
  font-size: 1.125rem;
  max-width: 600px;
  margin: 0 auto;
}

/* ==========================================================================
   UPLOAD / DRAG & DROP ZONE
   ========================================================================== */
.workspace-section {
  position: relative;
  min-height: 400px;
  display: flex;
  flex-direction: column;
}

.upload-card {
  padding: 1.5rem;
  flex: 1;
}

.dropzone {
  border: 2px dashed rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-md);
  padding: 4.5rem 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  cursor: pointer;
  position: relative;
  transition: var(--transition-normal);
  background: rgba(255, 255, 255, 0.01);
}

.dropzone:hover, .dropzone.dragover {
  border-color: var(--primary-color);
  background: rgba(139, 92, 246, 0.03);
  box-shadow: inset 0 0 20px rgba(139, 92, 246, 0.05);
}

.dropzone.dragover {
  transform: scale(0.995);
}

body.light-theme .dropzone {
  border-color: rgba(15, 23, 42, 0.12);
  background: rgba(15, 23, 42, 0.01);
}

body.light-theme .dropzone:hover,
body.light-theme .dropzone.dragover {
  border-color: var(--primary-color);
  background: rgba(139, 92, 246, 0.03);
}

.file-input {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.upload-icon-container {
  width: 96px;
  height: 96px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.03);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.5rem;
  border: 1px solid rgba(255, 255, 255, 0.05);
  color: var(--text-main);
  transition: var(--transition-normal);
}

.dropzone:hover .upload-icon-container, .dropzone.dragover .upload-icon-container {
  color: #fff;
  background: var(--primary-glow);
  box-shadow: var(--shadow-glow);
  border-color: transparent;
  transform: translateY(-5px);
}

.dropzone h3 {
  font-size: 1.35rem;
  margin-bottom: 0.5rem;
}

.drop-formats {
  color: var(--text-muted);
  font-size: 0.875rem;
  margin-bottom: 1.75rem;
}

/* ==========================================================================
   BUTTONS
   ========================================================================== */
.btn {
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 0.95rem;
  padding: 0.75rem 1.75rem;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: var(--transition-normal);
  text-decoration: none;
}

.btn-primary {
  background: var(--primary-glow);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(139, 92, 246, 0.35);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(139, 92, 246, 0.5), var(--shadow-glow);
}

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

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

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: var(--border-color-hover);
  transform: translateY(-2px);
}

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

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--text-muted);
  transform: translateY(-2px);
}

.btn-icon svg {
  transition: transform var(--transition-fast);
}

.btn-icon:hover svg {
  transform: translateY(-1px);
}

/* ==========================================================================
   LOADING / PROCESSING CARD
   ========================================================================== */
.loading-card {
  padding: 5rem 2rem;
  display: flex;
  justify-content: center;
  align-items: center;
}

.loading-content {
  max-width: 450px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

/* Premium Spinner */
.spinner-container {
  position: relative;
  width: 80px;
  height: 80px;
  margin-bottom: 2rem;
}

.spinner {
  width: 100%;
  height: 100%;
  border-radius: var(--radius-full);
  border: 3px solid rgba(255, 255, 255, 0.03);
  border-top-color: var(--primary-color);
  border-right-color: var(--secondary-color);
  animation: spin 1s infinite linear;
}

.spinner-core {
  position: absolute;
  top: 10px;
  left: 10px;
  width: 60px;
  height: 60px;
  border-radius: var(--radius-full);
  background: var(--bg-spinner-core);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
}

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

/* Progress Bar */
.progress-container {
  width: 100%;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.progress-bar-wrapper {
  flex: 1;
  height: 8px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-full);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.03);
}

.progress-bar {
  height: 100%;
  background: var(--primary-glow);
  width: 0%;
  border-radius: var(--radius-full);
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 0 10px rgba(139, 92, 246, 0.5);
}

.progress-percentage {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  width: 45px;
  text-align: right;
  color: var(--text-main);
}

.loading-message {
  color: var(--text-muted);
  font-size: 0.95rem;
  min-height: 2.5em;
  animation: pulseText 1.5s infinite alternate;
}

@keyframes pulseText {
  0% { opacity: 0.7; }
  100% { opacity: 1; }
}

/* ==========================================================================
   EDITOR WORKSPACE
   ========================================================================== */
.editor-card {
  overflow: hidden;
}

.editor-grid {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
}

@media (max-width: 820px) {
  .editor-grid {
    grid-template-columns: 1fr;
  }
  .preview-area {
    border-right: none;
    border-bottom: 1px solid var(--border-color);
  }
}

/* Image Preview Area */
.preview-area {
  padding: 2rem;
  background: var(--bg-preview);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 420px;
  position: relative;
  border-right: 1px solid var(--border-color);
}

.comparison-container {
  position: relative;
  width: 100%;
  max-width: 100%;
  aspect-ratio: auto;
  overflow: hidden;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
  touch-action: none;
}

/* Canvas transparent pattern grid */
.checkerboard-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  background-image: 
    linear-gradient(45deg, var(--checker-color-1) 25%, transparent 25%), 
    linear-gradient(-45deg, var(--checker-color-1) 25%, transparent 25%), 
    linear-gradient(45deg, transparent 75%, var(--checker-color-1) 75%), 
    linear-gradient(-45deg, transparent 75%, var(--checker-color-1) 75%);
  background-size: 20px 20px;
  background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
  background-color: var(--checker-color-2);
}

/* Custom background color/gradient/image layer */
.editor-bg-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  transition: background var(--transition-normal);
}

.image-foreground {
  position: relative;
  z-index: 3;
  max-width: 100%;
  max-height: 380px;
  display: block;
  object-fit: contain;
}

/* Overlaid original image container */
.comparison-overlay {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 50%; /* JS controlled */
  z-index: 4;
  overflow: hidden;
  border-right: 2px solid #ffffff;
  pointer-events: none;
}

.image-original {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 100%;
  object-fit: contain;
  max-width: none;
  pointer-events: none;
}

/* Slider Controls */
.slider-handle {
  position: absolute;
  top: 0;
  left: 50%; /* JS controlled */
  height: 100%;
  transform: translateX(-50%);
  z-index: 5;
  cursor: ew-resize;
  pointer-events: all;
  display: flex;
  justify-content: center;
  align-items: center;
  touch-action: none;
}

.slider-line {
  position: absolute;
  width: 2px;
  height: 100%;
  background: #ffffff;
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.5);
}

.slider-button {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: #ffffff;
  color: var(--text-inverse);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md), 0 0 10px rgba(0, 0, 0, 0.3);
  transition: transform var(--transition-fast);
}

.slider-handle:hover .slider-button, 
.slider-handle:active .slider-button {
  transform: scale(1.1);
  background: var(--primary-color);
  color: #fff;
}

/* Controls Panel */
.controls-panel {
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  background: rgba(18, 18, 29, 0.3);
}

.panel-header h2 {
  font-size: 1.35rem;
  font-weight: 700;
}

/* Tabs */
.tabs-header {
  display: flex;
  background: rgba(0, 0, 0, 0.2);
  padding: 4px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}

.tab-btn {
  flex: 1;
  background: transparent;
  border: none;
  padding: 0.5rem 0.25rem;
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--text-muted);
  border-radius: 6px;
  cursor: pointer;
  transition: var(--transition-fast);
  white-space: nowrap;
}

.tab-btn:hover {
  color: var(--text-main);
}

.tab-btn.active {
  background: var(--bg-card);
  color: #ffffff;
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

body.light-theme .tab-btn.active {
  background: #ffffff;
  color: var(--text-main);
  border: 1px solid var(--border-color);
}

.tabs-content {
  min-height: 120px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.tab-pane {
  display: none;
}

.tab-pane.active {
  display: block;
  animation: fadeIn 0.25s ease-out;
}

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

.info-box {
  background: rgba(255, 255, 255, 0.02);
  border: 1px dashed var(--border-color);
  padding: 1rem;
  border-radius: var(--radius-sm);
}

.info-box p {
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* Colors preset grid */
.color-presets, .gradient-presets, .image-presets {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(42px, 1fr));
  gap: 10px;
}

.preset-color, .preset-gradient, .preset-image {
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  border: 2px solid rgba(255, 255, 255, 0.15);
  cursor: pointer;
  transition: var(--transition-fast);
  position: relative;
  overflow: hidden;
}

.preset-color:hover, .preset-gradient:hover, .preset-image:hover {
  transform: scale(1.08);
  border-color: #ffffff;
  box-shadow: var(--shadow-sm);
}

.preset-color.active, .preset-gradient.active, .preset-image.active {
  border-color: var(--primary-color);
  box-shadow: 0 0 10px rgba(139, 92, 246, 0.6);
  transform: scale(1.04);
}

/* Color Picker input */
.custom-color-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.05);
}

.custom-color-wrapper input[type="color"] {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.color-picker-icon {
  font-size: 1.15rem;
  pointer-events: none;
}

/* Image presets */
.image-presets {
  grid-template-columns: repeat(auto-fill, minmax(54px, 1fr));
}

.bg-preset-item {
  background-size: cover;
  background-position: center;
}

/* Custom background image upload */
.custom-bg-upload-card {
  background: rgba(255, 255, 255, 0.03);
  border: 2px dashed rgba(255, 255, 255, 0.2);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 4px;
}

.custom-bg-upload-card:hover {
  border-color: var(--primary-color);
  background: rgba(139, 92, 246, 0.05);
}

.bg-file-input {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.custom-bg-upload-card .upload-icon {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1;
}

.custom-bg-upload-card .upload-text {
  font-size: 0.625rem;
  font-weight: 700;
  color: var(--text-muted);
  text-align: center;
}

/* Buttons under editor */
.action-buttons-group {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
  margin-top: auto;
}

.action-buttons-group .btn {
  width: 100%;
}

.action-buttons-group .btn-outline {
  margin-top: 0.5rem;
}

@media (min-width: 500px) and (max-width: 820px) {
  .action-buttons-group {
    grid-template-columns: 1fr 1fr;
  }
  .action-buttons-group .btn-outline {
    grid-column: span 2;
    margin-top: 0;
  }
}

/* ==========================================================================
   HISTORY SECTION
   ========================================================================== */
.history-section {
  padding: 1.75rem;
}

.history-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.75rem;
}

.history-title {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  font-size: 1.2rem;
  color: var(--text-main);
}

.history-icon {
  opacity: 0.8;
  color: var(--primary-color);
}

.btn-clear-history {
  background: transparent;
  border: none;
  color: var(--error);
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  transition: var(--transition-fast);
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-sm);
}

.btn-clear-history:hover {
  background: rgba(239, 68, 68, 0.08);
}

.history-list-wrapper {
  min-height: 60px;
  display: flex;
  align-items: center;
}

.history-empty {
  width: 100%;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
  padding: 1.5rem 0;
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-md);
}

.history-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 12px;
  width: 100%;
}

.history-item {
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background-size: cover;
  background-position: center;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: var(--transition-normal);
  background-color: #12121d;
  box-shadow: var(--shadow-sm);
}

.history-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  background-image: 
    linear-gradient(45deg, var(--checker-color-1) 25%, transparent 25%), 
    linear-gradient(-45deg, var(--checker-color-1) 25%, transparent 25%), 
    linear-gradient(45deg, transparent 75%, var(--checker-color-1) 75%), 
    linear-gradient(-45deg, transparent 75%, var(--checker-color-1) 75%);
  background-size: 10px 10px;
  background-position: 0 0, 0 5px, 5px -5px, -5px 0px;
  opacity: 0.5;
}

.history-item-img {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: var(--transition-normal);
}

.history-item:hover {
  transform: translateY(-3px) scale(1.03);
  border-color: var(--primary-color);
  box-shadow: var(--shadow-md);
}

.history-item:hover .history-item-img {
  transform: scale(1.05);
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
.app-footer {
  border-top: 1px solid var(--border-color);
  padding: 2rem 0;
  padding-bottom: calc(2rem + env(safe-area-inset-bottom, 0px));
  background: rgba(10, 10, 15, 0.9);
  margin-top: auto;
  text-align: center;
}

.footer-container {
  width: 90%;
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.footer-container p {
  font-size: 0.875rem;
  color: var(--text-muted);
}

.footer-note {
  font-size: 0.75rem !important;
  opacity: 0.75;
}

/* ==========================================================================
   TOAST NOTIFICATION
   ========================================================================== */
.toast-container {
  position: fixed;
  bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  right: calc(24px + env(safe-area-inset-right, 0px));
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  background: var(--bg-toast);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-toast);
  color: var(--text-main);
  padding: 0.875rem 1.5rem;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.9rem;
  font-weight: 600;
  pointer-events: all;
  min-width: 250px;
  animation: slideInUp 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.toast-success {
  border-left: 4px solid var(--success);
}

.toast-success::before {
  content: '✓';
  color: var(--success);
  font-size: 1.1rem;
}

.toast-error {
  border-left: 4px solid var(--error);
}

.toast-error::before {
  content: '✕';
  color: var(--error);
  font-size: 1.1rem;
}

.toast-fade-out {
  animation: slideOutDown 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

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

/* ==========================================================================
   GLOBAL UTILITIES
   ========================================================================== */
.hidden {
  display: none !important;
}

/* Mobile responsive fixes */
@media (max-width: 600px) {
  .hero-title {
    font-size: 2.15rem;
  }
  .hero-subtitle {
    font-size: 0.95rem;
  }
  .dropzone {
    padding: 3rem 1.5rem;
  }
  .main-container {
    margin: 2rem auto;
  }
  .toast-container {
    left: 16px;
    right: 16px;
    bottom: 16px;
  }
  .toast {
    min-width: auto;
  }
}

/* ==========================================================================
   GOOGLE ADSENSE STYLING
   ========================================================================== */
.adsense-banner-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  min-height: 120px;
  background: rgba(18, 18, 29, 0.35);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  position: relative;
  overflow: hidden;
  text-align: center;
  box-shadow: var(--shadow-sm);
}

.adsense-banner-container:hover {
  border-color: var(--border-color-hover);
}

.adsense-placeholder-tag {
  font-family: var(--font-sans);
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  margin-bottom: 0.75rem;
  opacity: 0.5;
}

/* ==========================================================================
   THEME TOGGLE BUTTON STYLING
   ========================================================================== */
.theme-toggle-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-fast);
}

.theme-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--border-color-hover);
}

body.light-theme .theme-toggle-btn {
  background: rgba(0, 0, 0, 0.04);
}

body.light-theme .theme-toggle-btn:hover {
  background: rgba(0, 0, 0, 0.08);
}

.theme-toggle-btn .sun-icon {
  display: block;
}

.theme-toggle-btn .moon-icon {
  display: none;
}

body.light-theme .theme-toggle-btn .sun-icon {
  display: none;
}

body.light-theme .theme-toggle-btn .moon-icon {
  display: block;
}

/* ==========================================================================
   ENHANCED STYLES: ACCESSIBILITY, PWA, SKELETONS & SETTINGS
   ========================================================================== */

/* Keyboard Focus Accessibility */
:focus-visible {
  outline: 3px solid var(--primary-color);
  outline-offset: 3px;
}

.dropzone:focus-visible {
  border-color: var(--primary-color);
  background: rgba(139, 92, 246, 0.05);
  outline: 3px solid var(--primary-color);
  outline-offset: 4px;
}

/* Accessibility Visually Hidden */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Connection Status indicator */
.connection-status {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: var(--error);
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 700;
  transition: opacity var(--transition-normal);
}

.connection-status.offline-hidden {
  display: none;
}

.status-dot {
  width: 8px;
  height: 8px;
  background-color: var(--error);
  border-radius: var(--radius-full);
  animation: pulseDot 1.5s infinite alternate;
}

@keyframes pulseDot {
  0% { transform: scale(0.85); opacity: 0.5; }
  100% { transform: scale(1.15); opacity: 1; }
}

body.light-theme .connection-status {
  background: rgba(239, 68, 68, 0.05);
}

/* Skeleton Loading Component Grid */
.loading-grid {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  width: 100%;
  min-height: 420px;
  position: relative;
}

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

.skeleton-preview-area {
  padding: 2rem;
  background: var(--bg-preview);
  display: flex;
  align-items: center;
  justify-content: center;
  border-right: 1px solid var(--border-color);
  min-height: 420px;
}

.skeleton-image {
  width: 80%;
  height: 250px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--radius-md);
}

body.light-theme .skeleton-image {
  background: rgba(15, 23, 42, 0.03);
}

.skeleton-controls-panel {
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  background: rgba(18, 18, 29, 0.3);
  position: relative;
}

.skeleton-title {
  width: 50%;
  height: 24px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--radius-sm);
}

body.light-theme .skeleton-title {
  background: rgba(15, 23, 42, 0.03);
}

.skeleton-tabs {
  display: flex;
  gap: 8px;
  background: rgba(0, 0, 0, 0.1);
  padding: 4px;
  border-radius: var(--radius-sm);
}

.skeleton-tab {
  flex: 1;
  height: 32px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 6px;
}

body.light-theme .skeleton-tab {
  background: rgba(15, 23, 42, 0.03);
}

.skeleton-options-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.skeleton-option {
  aspect-ratio: 1;
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--radius-sm);
}

body.light-theme .skeleton-option {
  background: rgba(15, 23, 42, 0.03);
}

.pulse {
  animation: pulseAnimation 1.5s infinite ease-in-out;
}

@keyframes pulseAnimation {
  0% { opacity: 0.3; }
  50% { opacity: 0.6; }
  100% { opacity: 0.3; }
}

.loading-status-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10;
  background: rgba(10, 10, 15, 0.7);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  text-align: center;
}

body.light-theme .loading-status-overlay {
  background: rgba(248, 250, 252, 0.7);
}

/* Error Boundary Styling */
.error-card {
  padding: 4rem 2rem;
  display: flex;
  justify-content: center;
  align-items: center;
}

.error-content {
  max-width: 450px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.error-icon-container {
  width: 80px;
  height: 80px;
  border-radius: var(--radius-full);
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: var(--error);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.5rem;
}

.error-content h3 {
  font-size: 1.35rem;
  margin-bottom: 0.5rem;
  color: var(--text-main);
}

.error-message {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 2rem;
}

.error-actions {
  display: flex;
  gap: 1rem;
  width: 100%;
  justify-content: center;
}

@media (max-width: 480px) {
  .error-actions {
    flex-direction: column;
    gap: 0.75rem;
  }
  .error-actions .btn {
    width: 100%;
  }
}

/* Export Settings Panel Styling */
.settings-panel {
  background: rgba(0, 0, 0, 0.15);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

body.light-theme .settings-panel {
  background: rgba(0, 0, 0, 0.03);
}

.settings-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  transition: all var(--transition-normal);
}

.settings-label {
  font-family: var(--font-sans);
  font-size: 0.825rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.settings-select {
  width: 100%;
  background: var(--bg-dropdown);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 0.625rem 0.875rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color var(--transition-fast);
  outline: none;
}

.settings-select:hover, .settings-select:focus {
  border-color: var(--border-color-hover);
}

.settings-slider-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.settings-val {
  font-family: var(--font-display);
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--primary-color);
}

.settings-range {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-full);
  outline: none;
}

body.light-theme .settings-range {
  background: rgba(0, 0, 0, 0.08);
}

.settings-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--primary-color);
  cursor: pointer;
  box-shadow: 0 0 8px rgba(139, 92, 246, 0.5);
  transition: transform var(--transition-fast), background var(--transition-fast);
}

.settings-range::-webkit-slider-thumb:hover {
  transform: scale(1.2);
  background: var(--secondary-color);
}

/* ==========================================================================
   PRICING BADGE & UPGRADE BUTTON
   ========================================================================== */
.pricing-status-container {
  display: flex;
  align-items: center;
  gap: 10px;
}

.pricing-badge {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  padding: 0.4rem 0.8rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
}

.pricing-badge.free {
  border-left: 3px solid var(--info);
}

.pricing-badge.pro {
  border: 1px solid rgba(139, 92, 246, 0.3);
  background: linear-gradient(90deg, rgba(139, 92, 246, 0.15) 0%, rgba(236, 72, 153, 0.05) 100%);
  color: #ffffff;
  box-shadow: 0 0 10px rgba(139, 92, 246, 0.15);
}

.pricing-badge.pro::before {
  content: '👑';
  font-size: 0.9rem;
}

body.light-theme .pricing-badge {
  background: rgba(0, 0, 0, 0.03);
}

body.light-theme .pricing-badge.pro {
  color: var(--primary-color);
  background: rgba(139, 92, 246, 0.08);
  border: 1px solid rgba(139, 92, 246, 0.2);
}

.btn-upgrade {
  font-size: 0.8rem;
  padding: 0.45rem 0.9rem;
  border-radius: var(--radius-sm);
  background: var(--primary-glow);
  color: #ffffff;
  font-weight: 700;
  box-shadow: 0 4px 10px rgba(139, 92, 246, 0.2);
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-upgrade:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(139, 92, 246, 0.35);
}

/* ==========================================================================
   WATERMARK WARNING BANNER
   ========================================================================== */
.watermark-warning {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.2);
  padding: 0.875rem 1rem;
  border-radius: var(--radius-md);
  margin-top: 1rem;
  margin-bottom: 0.5rem;
}

body.light-theme .watermark-warning {
  background: rgba(245, 158, 11, 0.05);
}

.warning-icon {
  font-size: 1.15rem;
  line-height: 1;
}

.warning-text {
  font-size: 0.825rem;
  line-height: 1.4;
  color: #f59e0b;
  font-weight: 600;
  margin: 0;
}

/* ==========================================================================
   PAYMENT MODAL OVERLAY & CONTAINER
   ========================================================================== */
.payment-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(10, 10, 15, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.payment-modal-container {
  width: 100%;
  max-width: 840px;
  max-height: 92vh;
  min-height: 480px;
  background: #11111a;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow-y: auto;
  position: relative;
  display: grid;
  grid-template-columns: 1.1fr 1.25fr;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.6), 0 0 40px rgba(139, 92, 246, 0.1);
}

@media (max-width: 768px) {
  .payment-modal-container {
    grid-template-columns: 1fr;
    max-width: 480px;
    height: 90vh;
    overflow-y: auto;
  }
  .checkout-benefits {
    border-right: none;
    border-bottom: 1px solid var(--border-color);
    padding: 1.75rem !important;
  }
  .checkout-form-container {
    padding: 1.75rem !important;
  }
}

body.light-theme .payment-modal-container {
  background: #ffffff;
  box-shadow: 0 24px 64px rgba(15, 23, 42, 0.15);
}

.modal-close-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  cursor: pointer;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  transition: var(--transition-fast);
}

.modal-close-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: rotate(90deg);
}

body.light-theme .modal-close-btn {
  background: rgba(0, 0, 0, 0.03);
}

/* Modal Left (Benefits) */
.checkout-benefits {
  padding: 2.25rem 2rem;
  background: rgba(18, 18, 29, 0.3);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

body.light-theme .checkout-benefits {
  background: rgba(0, 0, 0, 0.01);
}

.checkout-benefits h2 {
  font-size: 2.15rem;
  margin-bottom: 0.25rem;
}

.checkout-sub {
  font-size: 0.95rem;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 1.75rem;
}

.price-tag {
  display: flex;
  flex-direction: column;
  margin-bottom: 2rem;
}

.price-val {
  font-family: var(--font-display);
  font-size: 3rem;
  font-weight: 800;
  line-height: 1;
  background: var(--primary-glow);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.price-once {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 0.35rem;
}

.benefits-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.benefits-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
  font-weight: 600;
}

.benefit-check {
  color: var(--success);
  font-weight: bold;
}

/* Modal Right (Form) */
.checkout-form-container {
  padding: 2.25rem 2rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1rem;
}

/* Interactive Card Display */
.credit-card-wrapper {
  perspective: 1000px;
  margin-bottom: 0.5rem;
}

.interactive-card {
  width: 100%;
  aspect-ratio: 1.586/1; /* Credit Card Ratio */
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
  border-radius: 12px;
}

.interactive-card.flipped {
  transform: rotateY(180deg);
}

.card-front, .card-back {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  border-radius: 12px;
  padding: 1.25rem;
  color: #ffffff;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.card-front {
  background: linear-gradient(135deg, #1e1e2f 0%, #111119 100%);
  z-index: 2;
}

body.light-theme .card-front {
  background: linear-gradient(135deg, #2b2d42 0%, #1a1b24 100%);
}

.card-back {
  background: linear-gradient(135deg, #111119 0%, #1e1e2f 100%);
  transform: rotateY(180deg);
  padding: 1.25rem 0; /* Stripe stretches edge-to-edge */
}

body.light-theme .card-back {
  background: linear-gradient(135deg, #1a1b24 0%, #2b2d42 100%);
}

.card-chip {
  width: 38px;
  height: 28px;
  background: linear-gradient(135deg, #f5d061 0%, #e2b43b 100%);
  border-radius: 4px;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.5);
}

.card-logo {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.15rem;
  font-style: italic;
  letter-spacing: -0.05em;
  opacity: 0.8;
}

.card-number-display {
  font-family: monospace;
  font-size: 1.15rem;
  letter-spacing: 0.15em;
  word-spacing: 0.1em;
  margin: 1rem 0;
  color: #fff;
  opacity: 0.95;
}

.card-row {
  display: flex;
  justify-content: space-between;
}

.card-label {
  font-size: 0.55rem;
  color: #8e92a2;
  font-weight: 600;
  margin-bottom: 2px;
  text-transform: uppercase;
}

.card-name-display, .card-expiry-display {
  font-family: monospace;
  font-size: 0.8rem;
  text-transform: uppercase;
}

/* Card Back specifics */
.card-magnetic-strip {
  width: 100%;
  height: 36px;
  background: #000000;
  margin-top: 10px;
}

.card-cvc-bar {
  padding: 0 1.25rem;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.cvc-label {
  font-size: 0.55rem;
  color: #8e92a2;
  margin-bottom: 2px;
}

.card-cvc-display {
  width: 100%;
  height: 32px;
  background: #ffffff;
  color: #000000;
  font-family: monospace;
  font-size: 0.95rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 8px;
  border-radius: 4px;
}

/* Checkout Form details */
.payment-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.payment-form .form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.payment-form label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
}

.payment-form input {
  background: var(--bg-dropdown);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 0.625rem 0.875rem;
  border-radius: var(--radius-sm);
  font-family: monospace;
  font-size: 0.95rem;
  outline: none;
  transition: border-color var(--transition-fast);
}

.payment-form input::placeholder {
  color: rgba(255, 255, 255, 0.15);
  font-family: monospace;
}

body.light-theme .payment-form input::placeholder {
  color: rgba(0, 0, 0, 0.2);
}

.payment-form input:focus {
  border-color: var(--primary-color);
}

.payment-form .form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.btn-pay-now {
  margin-top: 8px;
  height: 46px;
  position: relative;
}

/* Pay Button Spinner */
.pay-btn-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: #ffffff;
  animation: spin 0.8s infinite linear;
}

.secure-checkout-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 0.7rem;
  color: var(--text-muted);
  opacity: 0.8;
  font-weight: 600;
  text-align: center;
}

/* ==========================================================================
   PAYMENT SUCCESS STATE OVERLAY
   ========================================================================== */
.payment-success-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #11111a;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  text-align: center;
  gap: 1rem;
}

body.light-theme .payment-success-overlay {
  background: #ffffff;
}

.success-icon-wrapper {
  margin-bottom: 0.5rem;
}

.checkmark-circle {
  stroke-dasharray: 166;
  stroke-dashoffset: 166;
  stroke-width: 2;
  stroke-miterlimit: 10;
  stroke: var(--success);
  fill: none;
  animation: stroke 0.6s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}

.checkmark-svg {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  display: block;
  stroke-width: 2;
  stroke: #ffffff;
  stroke-miterlimit: 10;
  box-shadow: inset 0px 0px 0px var(--success);
  animation: fillSuccess 0.4s ease-in-out 0.4s forwards, scale 0.3s ease-in-out 0.9s both;
}

.checkmark-check {
  transform-origin: 50% 50%;
  stroke-dasharray: 48;
  stroke-dashoffset: 48;
  animation: stroke 0.3s cubic-bezier(0.65, 0, 0.45, 1) 0.8s forwards;
}

@keyframes stroke {
  100% { stroke-dashoffset: 0; }
}
@keyframes fillSuccess {
  100% { box-shadow: inset 0px 0px 0px 40px var(--success); }
}

.payment-success-overlay h2 {
  font-size: 1.75rem;
  color: var(--text-main);
}

.payment-success-overlay p {
  color: var(--text-muted);
  max-width: 400px;
  font-size: 0.925rem;
  line-height: 1.5;
}

/* Scale Animation */
.animate-scale {
  animation: scaleUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes scaleUp {
  from { transform: scale(0.92); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

/* ==========================================================================
   GOOGLE PAY BUTTON & DIVIDER STYLING
   ========================================================================== */
.google-pay-container {
  display: flex;
  justify-content: center;
  margin-bottom: 0.5rem;
  width: 100%;
}

.google-pay-container .gpay-card-info-container {
  width: 100% !important;
}

.checkout-divider {
  display: flex;
  align-items: center;
  width: 100%;
  margin: 1rem 0;
  gap: 12px;
}

.checkout-divider .divider-line {
  flex: 1;
  height: 1px;
  background: var(--border-color);
}

.checkout-divider .divider-text {
  font-family: var(--font-sans);
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}


/* ==========================================================================
   GOOGLE AUTH & SYNCHRONIZATION STYLING
   ========================================================================== */
.user-profile-container {
  position: relative;
  display: flex;
  align-items: center;
}

.btn-login {
  background: rgba(66, 133, 244, 0.08);
  border: 1px solid rgba(66, 133, 244, 0.2);
  color: #4285f4;
  padding: 0.5rem 0.875rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  transition: var(--transition-fast);
}

.btn-login:hover {
  background: rgba(66, 133, 244, 0.15);
  border-color: rgba(66, 133, 244, 0.4);
}

.user-info {
  position: relative;
}

.user-avatar-btn {
  background: none;
  border: 2px solid var(--border-color);
  padding: 2px;
  border-radius: var(--radius-full);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-fast);
}

.user-avatar-btn:hover, .user-avatar-btn:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 10px rgba(139, 92, 246, 0.3);
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  object-fit: cover;
}

.user-dropdown {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  background: var(--bg-dropdown);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  width: 240px;
  padding: 0.75rem 0;
  z-index: 110;
  animation: dropdownSlide 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes dropdownSlide {
  from { opacity: 0; transform: translateY(-8px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.user-dropdown-header {
  padding: 0.5rem 1.25rem 0.75rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.user-dropdown-header .user-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-main);
}

.user-dropdown-header .user-email {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  color: var(--text-muted);
  word-break: break-all;
}

.user-dropdown-menu {
  list-style: none;
  padding-top: 0.5rem;
}

.user-dropdown-menu .dropdown-item {
  padding: 0.625rem 1.25rem;
  font-family: var(--font-sans);
  font-size: 0.875rem;
  color: var(--text-main);
  cursor: pointer;
  display: flex;
  align-items: center;
  transition: var(--transition-fast);
}

.user-dropdown-menu .dropdown-item:hover {
  background: rgba(239, 68, 68, 0.08);
  color: #ef4444;
}

/* Modal Synchronization Banner */
.checkout-sync-banner {
  background: rgba(139, 92, 246, 0.06);
  border: 1px dashed rgba(139, 92, 246, 0.25);
  border-radius: var(--radius-md);
  padding: 1rem;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 1.25rem;
  text-align: left;
}

.sync-banner-icon {
  color: var(--primary-color);
  flex-shrink: 0;
  animation: pulseSync 2s infinite ease-in-out;
}

@keyframes pulseSync {
  0% { transform: scale(1); opacity: 0.8; }
  50% { transform: scale(1.1); opacity: 1; filter: drop-shadow(0 0 4px var(--primary-color)); }
  100% { transform: scale(1); opacity: 0.8; }
}

.sync-banner-text {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sync-banner-text .sync-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--text-main);
}

.sync-banner-text .sync-desc {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.35;
}

body.light-theme .checkout-sync-banner {
  background: rgba(139, 92, 246, 0.04);
  border-color: rgba(139, 92, 246, 0.15);
}

/* Light Theme Header Buttons adjustments */
body.light-theme .lang-toggle-btn {
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(15, 23, 42, 0.08);
}

body.light-theme .lang-toggle-btn:hover {
  background: rgba(0, 0, 0, 0.08);
  border-color: rgba(15, 23, 42, 0.16);
}

body.light-theme .btn-login {
  background: rgba(66, 133, 244, 0.06);
  border-color: rgba(66, 133, 244, 0.3);
  color: #1a73e8; /* Standard Google Blue for light themes, higher contrast */
}

body.light-theme .btn-login:hover {
  background: rgba(66, 133, 244, 0.12);
  border-color: rgba(66, 133, 244, 0.5);
}

body.light-theme .user-avatar-btn {
  border-color: rgba(15, 23, 42, 0.1);
}

body.light-theme .user-avatar-btn:hover {
  border-color: var(--primary-color);
}

/* Mobile Header Actions and Icon-only Fallbacks */
@media (max-width: 680px) {
  .brand-name {
    font-size: 1.2rem;
  }
  .header-actions {
    gap: 0.375rem;
  }
  .btn-upgrade span,
  .btn-login span,
  .lang-toggle-btn #current-lang-text,
  .lang-toggle-btn .chevron-icon {
    display: none !important;
  }
  .btn-upgrade,
  .btn-login,
  .lang-toggle-btn {
    padding: 0.5rem;
    justify-content: center;
    border-radius: var(--radius-sm);
  }
  .pricing-badge {
    padding: 0.4rem 0.5rem;
  }
  .pricing-badge .badge-text {
    font-size: 0.75rem;
  }
}
@media (max-width: 480px) {
  .brand-name {
    font-size: 1.05rem;
  }
  .logo-wrapper {
    width: 36px;
    height: 36px;
  }
  .brand {
    gap: 0.4rem;
  }
  .pricing-status-container {
    gap: 4px;
  }
}

/* SEO Info Section Styles */
.seo-info-section {
  padding: 2.5rem;
  margin-top: 1.5rem;
}

.seo-info-container {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.seo-title {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.5rem;
}

.seo-subtitle {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-main);
  margin-top: 1rem;
  margin-bottom: 0.25rem;
}

.seo-text {
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--text-muted);
}

.seo-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding-left: 1.25rem;
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.5;
}

.seo-list li strong {
  color: var(--text-main);
}

/* Light / Dark Mode Adjustments */
body.light-theme .seo-title,
body.light-theme .seo-subtitle,
body.light-theme .seo-list li strong {
  color: #1e1b4b; /* Deep Indigo for better contrast */
}

body.light-theme .seo-text,
body.light-theme .seo-list li,
body.light-theme .seo-list {
  color: #4b5563; /* Slate grey */
}

/* ==========================================================================
   MAGIC BRUSH (TOUCH-UP) STYLES
   ========================================================================== */
.brush-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  z-index: 10;
  cursor: none; /* Hide default cursor so we draw custom size circle */
}

.brush-controls-container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding: 0.5rem 0;
}

.brush-tool-selector {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.brush-tool-selector .btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem;
}

.brush-tool-selector .btn.active {
  background: var(--primary-color);
  color: #fff;
  border-color: var(--primary-color);
  box-shadow: 0 0 12px rgba(139, 92, 246, 0.4);
}

.brush-size-group {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.brush-size-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brush-size-val {
  font-weight: 600;
  color: var(--primary-color);
  font-size: 0.9rem;
}

.brush-size-slider {
  -webkit-appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: var(--border-color);
  outline: none;
}

.brush-size-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--primary-color);
  cursor: pointer;
  border: 2px solid #fff;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-fast);
}

.brush-size-slider::-webkit-slider-thumb:hover {
  transform: scale(1.15);
}

.brush-preview-circle-container {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 80px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-md);
  margin-top: 0.25rem;
}

.brush-preview-circle {
  border-radius: 50%;
  background: rgba(139, 92, 246, 0.3);
  border: 1.5px solid var(--primary-color);
  transition: width 0.1s ease, height 0.1s ease;
}

.brush-action-row {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
}

.brush-action-row .btn-icon-only {
  width: 38px;
  height: 38px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
}

/* Custom Brush cursor element created in JS */
.custom-brush-cursor {
  position: fixed;
  pointer-events: none;
  border-radius: 50%;
  border: 1.5px solid #fff;
  box-shadow: 0 0 4px rgba(0, 0, 0, 0.5);
  background: rgba(139, 92, 246, 0.15);
  transform: translate(-50%, -50%);
  z-index: 10000;
  display: none;
}

/* ==========================================================================
   BATCH WORKSPACE STYLES
   ========================================================================== */
.batch-card {
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.batch-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 1.25rem;
}

.batch-progress-container {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  width: 100%;
  max-width: 320px;
}

.batch-progress-text {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
  text-align: right;
}

.batch-progress-bar-wrapper {
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: var(--border-color);
  overflow: hidden;
}

.batch-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
  border-radius: 3px;
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.batch-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1.25rem;
  min-height: 200px;
}

.batch-item-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform var(--transition-normal), border-color var(--transition-normal);
}

.batch-item-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-color-hover);
}

.batch-item-preview-wrapper {
  aspect-ratio: 4/3;
  position: relative;
  background: #0f0f15;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-bottom: 1px solid var(--border-color);
}

.batch-item-preview {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.batch-item-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  z-index: 5;
}

.batch-spinner {
  width: 28px;
  height: 28px;
  border: 3px solid rgba(139, 92, 246, 0.1);
  border-top-color: var(--primary-color);
  border-radius: 50%;
  animation: spin 1s infinite linear;
}

.batch-item-overlay-text {
  font-size: 0.75rem;
  font-weight: 500;
  color: #fff;
}

.batch-item-details {
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  flex: 1;
}

.batch-item-filename {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.batch-item-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: auto;
}

.batch-item-actions .btn {
  flex: 1;
  padding: 0.5rem;
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
}

.batch-item-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 2px 6px;
  border-radius: 10px;
  font-size: 0.65rem;
  font-weight: 600;
  z-index: 6;
}

.batch-item-badge.completed {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.batch-item-badge.failed {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.batch-actions-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--border-color);
  padding-top: 1.25rem;
  margin-top: 0.5rem;
}

/* ==========================================================================
   E-BÜLTEN (NEWSLETTER) SIGNUP STYLES
   ========================================================================== */
.newsletter-section {
  padding: 2.25rem;
  margin-top: 1.5rem;
}

.newsletter-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.75rem;
}

.newsletter-info {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex: 1;
  min-width: 280px;
}

.newsletter-icon {
  color: var(--primary-color);
  flex-shrink: 0;
  animation: pulse-icon 2s infinite ease-in-out;
}

.newsletter-text-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.newsletter-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-main);
}

.newsletter-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.newsletter-form {
  display: flex;
  gap: 0.75rem;
  width: 100%;
  max-width: 440px;
  flex-shrink: 0;
}

.newsletter-input {
  flex: 1;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-main);
  font-size: 0.9rem;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.newsletter-input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15);
}

.btn-newsletter-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0 1.5rem;
  white-space: nowrap;
  font-weight: 600;
}

@keyframes pulse-icon {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.05);
    opacity: 0.85;
  }
}

@media (max-width: 768px) {
  .newsletter-container {
    flex-direction: column;
    align-items: stretch;
  }
  .newsletter-form {
    max-width: 100%;
  }
  .batch-header {
    flex-direction: column;
    align-items: stretch;
  }
  .batch-progress-container {
    max-width: 100%;
  }
}

/* ==========================================================================
   MOBILE UX RESPONSIVENESS AND ENHANCEMENT MEDIAS
   ========================================================================== */
@media (max-width: 600px) {
  .main-container {
    width: 94%;
    margin: 1rem auto;
    gap: 1.5rem;
  }
  .preview-area {
    padding: 0.75rem;
    min-height: 320px;
  }
  .controls-panel {
    padding: 1rem;
    gap: 1rem;
  }
  .tabs-header {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
    justify-content: flex-start;
  }
  .tab-btn {
    flex: 0 0 auto;
    padding: 0.5rem 0.85rem;
  }
  .seo-info-section {
    padding: 1.25rem;
  }
  .seo-title {
    font-size: 1.35rem;
  }
  .seo-subtitle {
    font-size: 1.15rem;
  }
  .seo-text {
    font-size: 0.88rem;
  }
}

@media (max-width: 480px) {
  .newsletter-form {
    flex-direction: column;
    gap: 0.65rem;
  }
  .btn-newsletter-submit {
    padding: 0.85rem 1rem;
    width: 100%;
    justify-content: center;
  }
}

/* ==========================================================================
   ADVANCED IMAGE UTILITY SUITE STYLES (NEATBG)
   ========================================================================== */

/* 1. Global Tool Navigation Bar */
.tool-navigation-bar {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin: 1.5rem auto 2.5rem auto;
  max-width: 900px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  padding: 0.5rem;
  border-radius: var(--radius-lg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 10;
}

.tool-nav-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-main);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast) ease;
}

.tool-nav-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.05);
}

.tool-nav-btn.active {
  color: #ffffff;
  background: var(--primary-glow);
  box-shadow: var(--shadow-glow);
}

.tool-icon {
  font-size: 1.1rem;
}

/* 2. Crop Overlay & Interactive Box */
.crop-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 5;
}

.crop-box {
  box-sizing: border-box;
}

/* Corner/Edge handles styling */
.crop-handle {
  width: 12px;
  height: 12px;
  background: #ffffff;
  border: 2px solid #6366f1;
  border-radius: 50%;
  position: absolute;
  transition: transform 0.15s ease;
  box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.crop-handle:hover {
  transform: scale(1.3);
}

/* 3. Dimension Custom Inputs Row */
.dimension-inputs-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.dimension-input-wrapper {
  position: relative;
  flex: 1;
}

.dimension-unit {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.75rem;
  color: var(--text-muted);
  pointer-events: none;
}

.dimension-separator {
  color: var(--text-muted);
  font-weight: bold;
}

/* 4. Batch Converter settings styling */
.batch-converter-settings {
  animation: slideDown 0.3s ease forwards;
}

/* Mobile responsive navigation adjustment */
@media (max-width: 768px) {
  .tool-navigation-bar {
    width: 94%;
    overflow-x: auto;
    justify-content: flex-start;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
  }
  .tool-nav-btn {
    flex: 0 0 auto;
    padding: 0.6rem 1rem;
    font-size: 0.85rem;
  }
}

/* WebView & APK Touch selection overrides */
.tool-navigation-bar,
.tool-nav-btn,
.brand,
.lang-toggle-btn,
.btn,
.tab-btn,
.preset-color,
.preset-gradient,
.preset-image,
.dropzone {
  user-select: none;
  -webkit-user-select: none;
}

