@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

:root {
  --bg-main: #f8fafc;
  --bg-card: #ffffff;
  --bg-card-hover: #f1f5f9;
  --bg-input: #f1f5f9;

  --color-text: #0f172a;
  --color-text-muted: #64748b;
  --color-text-dim: #475569;

  --color-primary: #2563eb;
  --color-primary-hover: #1d4ed8;
  --color-accent: #0ea5e9;

  --color-success: #059669;
  --color-error: #dc2626;
  --color-warning: #d97706;

  --glass-border: 1px solid rgba(0, 0, 0, 0.08);
  --glass-border-active: 1px solid rgba(37, 99, 235, 0.4);

  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 24px;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.06), 0 2px 4px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.08), 0 4px 8px rgba(0, 0, 0, 0.04);
  --shadow-glow: 0 4px 16px rgba(37, 99, 235, 0.2);
  --shadow-glow-accent: 0 4px 16px rgba(14, 165, 233, 0.2);
}

/* Base Reset & Scrollbar */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-main);
  background-image:
    radial-gradient(at 0% 0%, rgba(37, 99, 235, 0.04) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(14, 165, 233, 0.04) 0px, transparent 50%);
  background-attachment: fixed;
  color: var(--color-text);
  font-family: var(--font-sans);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-main);
}

::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.12);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.25);
}

a {
  color: var(--color-primary);
  text-decoration: none;
  font-weight: 500;
  transition: all var(--transition-fast);
}

a:hover {
  color: var(--color-accent);
}

/* Layout Container */
.app-container {
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 2.5rem 1.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

/* Header & Logo */
header {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

@media (min-width: 768px) {
  header {
    flex-direction: row;
  }
}

.logo-section {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.logo-icon {
  background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
  color: white;
  width: 48px;
  height: 48px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.5rem;
  box-shadow: var(--shadow-glow);
  position: relative;
  overflow: hidden;
}

.logo-icon::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.25), transparent);
  transform: rotate(45deg);
  animation: shine 4s infinite linear;
}

@keyframes shine {
  0% {
    transform: translate(-50%, -50%) rotate(45deg);
  }

  100% {
    transform: translate(50%, 50%) rotate(45deg);
  }
}

.logo-text h1 {
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--color-text);
}

.logo-text p {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  font-weight: 500;
  margin-top: 0.1rem;
}

/* Header Right Area (tabs + lang toggle) */
.header-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* Language Toggle */
.lang-toggle {
  display: flex;
  align-items: center;
  background: var(--bg-card);
  border: var(--glass-border);
  border-radius: 12px;
  padding: 0.25rem;
  box-shadow: var(--shadow-sm);
}

.lang-btn {
  background: transparent;
  border: none;
  color: var(--color-text-muted);
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.8rem;
  padding: 0.45rem 0.85rem;
  border-radius: 9px;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.lang-btn:hover {
  color: var(--color-text);
}

.lang-btn.active {
  background: var(--color-primary);
  color: white;
  box-shadow: var(--shadow-glow);
}

/* Tab Menu Segment Control */
.tabs-nav {
  display: flex;
  justify-content: flex-start;
  background-color: var(--bg-card);
  padding: 0.45rem;
  border-radius: 20px;
  border: var(--glass-border);
  box-shadow: var(--shadow-sm);
  max-width: 100%;
  overflow-x: auto;
  cursor: grab;
  scrollbar-width: none; /* Hide scrollbar for premium look */
  -webkit-overflow-scrolling: touch;
  user-select: none; /* Prevent text selection during drag */
  /* Premium fade out at edges */
  -webkit-mask-image: linear-gradient(to right, transparent 0%, black 5%, black 95%, transparent 100%);
  mask-image: linear-gradient(to right, transparent 0%, black 5%, black 95%, transparent 100%);
}
.tabs-nav:active, .tabs-nav.dragging {
  cursor: grabbing;
}
.tabs-nav.dragging .tab-btn {
  pointer-events: none;
  transform: scale(0.97);
  opacity: 0.85;
}
@media (min-width: 1024px) {
  .tabs-nav {
    justify-content: center;
    -webkit-mask-image: none;
    mask-image: none;
  }
}
.tabs-nav::-webkit-scrollbar {
  display: none;
}

.tab-btn {
  background: transparent;
  border: none;
  color: var(--color-text-muted);
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 1rem;
  padding: 0.75rem 1.25rem;
  border-radius: 16px;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  white-space: nowrap;
  flex-shrink: 0;
}

.tab-btn:hover {
  color: var(--color-text);
  background: var(--bg-card-hover);
}

.tab-btn.active {
  background: var(--color-primary);
  color: white;
  box-shadow: var(--shadow-glow);
}

/* Layout Grid (Ads removed) */
.main-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  max-width: 960px;
  margin: 0 auto;
  width: 100%;
}

/* Ad slots */
.ad-slot-wrapper {
  background: var(--bg-card);
  border: 1px dashed rgba(0, 0, 0, 0.1);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: rgba(0, 0, 0, 0.2);
  font-size: 0.75rem;
  padding: 1rem;
  font-weight: 600;
}

.ad-slot-wrapper::before {
  content: 'ADVERTISEMENT';
  font-size: 0.6rem;
  letter-spacing: 0.12em;
  color: rgba(0, 0, 0, 0.2);
  margin-bottom: 0.5rem;
  font-weight: 700;
}

.ad-top-banner {
  width: 100%;
  min-height: 90px;
}

.ad-sidebar {
  min-height: 250px;
  height: 100%;
  position: sticky;
  top: 2rem;
}

/* Dropzone */
.dropzone-card {
  background: var(--bg-card);
  border: 2px dashed rgba(0, 0, 0, 0.12);
  border-radius: var(--radius-lg);
  padding: 4rem 2rem;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition-normal);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
  box-shadow: var(--shadow-md);
  position: relative;
}

.dropzone-card:hover,
.dropzone-card.dragover {
  border-color: var(--color-primary);
  background-color: rgba(37, 99, 235, 0.03);
  box-shadow: var(--shadow-lg), 0 0 0 4px rgba(37, 99, 235, 0.08);
}

.dropzone-icon {
  width: 72px;
  height: 72px;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.08), rgba(14, 165, 233, 0.08));
  color: var(--color-primary);
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  margin-bottom: 0.25rem;
  border: 1px solid rgba(37, 99, 235, 0.1);
  transition: all var(--transition-normal);
}

.dropzone-card:hover .dropzone-icon,
.dropzone-card.dragover .dropzone-icon {
  transform: translateY(-8px) scale(1.08);
  color: white;
  background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
  box-shadow: var(--shadow-glow);
  border-color: transparent;
}

.dropzone-text h3 {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.35rem;
  color: var(--color-text);
}

.dropzone-text p {
  color: var(--color-text-muted);
  font-size: 0.9rem;
  font-weight: 500;
}

/* Controls Grid Card */
.controls-card {
  background: var(--bg-card);
  border: var(--glass-border);
  border-radius: var(--radius-md);
  padding: 1.75rem;
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  box-shadow: var(--shadow-md);
}

@media (min-width: 768px) {
  .controls-card {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    align-items: end;
  }
}

/* Extra row container for features */
.controls-row-extra {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  padding-top: 1.25rem;
  margin-top: 0.25rem;
}

.control-group {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.control-group label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-text-dim);
  letter-spacing: -0.01em;
  display: flex;
  justify-content: space-between;
}

.control-group2 label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-text-dim);
  letter-spacing: -0.01em;
  display: flex;
}

.control-group label span {
  color: var(--color-primary);
  font-weight: 700;
}

/* Custom Select dropdowns */
.form-select {
  background-color: var(--bg-input);
  border: var(--glass-border);
  border-radius: var(--radius-sm);
  color: var(--color-text);
  font-family: var(--font-sans);
  padding: 0.75rem 1rem;
  outline: none;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.form-select:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

/* Ranges */
.form-range-wrapper {
  background-color: var(--bg-input);
  border: var(--glass-border);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  padding: 0.45rem 1rem;
}

.form-range {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: rgba(0, 0, 0, 0.1);
  outline: none;
}

.form-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
  cursor: pointer;
  transition: all var(--transition-fast);
  box-shadow: var(--shadow-glow);
}

.form-range::-webkit-slider-thumb:hover {
  transform: scale(1.25);
  box-shadow: var(--shadow-glow), 0 0 10px rgba(37, 99, 235, 0.4);
}

/* Switch */
.switch-label {
  display: flex;
  align-items: center;
  cursor: pointer;
  user-select: none;
  gap: 0.75rem;
}

.switch-label2 {
  align-items: center;
  cursor: pointer;
  user-select: none;
  gap: 0.75rem;
}

.switch-input {
  display: none;
}

.switch-custom {
  position: relative;
  width: 48px;
  height: 24px;
  background-color: rgba(0, 0, 0, 0.12);
  border-radius: 12px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  transition: all var(--transition-normal);
}

.switch-custom::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background-color: #ffffff;
  transition: all var(--transition-normal);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.switch-input:checked+.switch-custom {
  background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
  border-color: transparent;
}

.switch-input:checked+.switch-custom::after {
  transform: translateX(24px);
}

.switch-text {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-text-dim);
}

/* Buttons */
.btn {
  background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  padding: 0.85rem 1.75rem;
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  box-shadow: var(--shadow-glow);
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(37, 99, 235, 0.3);
}

.btn:active {
  transform: translateY(0);
}

.btn-accent {
  background: linear-gradient(135deg, var(--color-accent), var(--color-primary));
  box-shadow: var(--shadow-glow-accent);
}

.btn-accent:hover {
  box-shadow: 0 8px 25px rgba(14, 165, 233, 0.3);
}

.btn:disabled {
  background: rgba(0, 0, 0, 0.04);
  color: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(0, 0, 0, 0.06);
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* Queue Card UI */
.queue-card {
  background: var(--bg-card);
  border: var(--glass-border);
  border-radius: var(--radius-md);
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  box-shadow: var(--shadow-md);
}

.queue-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  padding-bottom: 1rem;
}

.queue-title {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.queue-count {
  background: rgba(37, 99, 235, 0.08);
  color: var(--color-primary);
  border: 1px solid rgba(37, 99, 235, 0.15);
  font-size: 0.75rem;
  padding: 0.2rem 0.6rem;
  border-radius: 30px;
  font-weight: 700;
}

.queue-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  max-height: 400px;
  overflow-y: auto;
  padding-right: 0.3rem;
}

.queue-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: var(--bg-input);
  border: var(--glass-border);
  border-radius: 12px;
  padding: 0.85rem 1.25rem;
  gap: 1rem;
  transition: all var(--transition-fast);
}

.queue-item:hover {
  border-color: rgba(37, 99, 235, 0.2);
  background-color: rgba(37, 99, 235, 0.03);
}

.item-info {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex: 1;
  min-width: 0;
}

.item-preview {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  object-fit: cover;
  background-color: var(--bg-input);
  flex-shrink: 0;
  border: var(--glass-border);
}

.item-details {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.item-name {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--color-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.item-meta {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  display: flex;
  gap: 0.85rem;
  font-weight: 500;
  margin-top: 0.15rem;
}

.item-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.status-badge {
  padding: 0.25rem 0.65rem;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.status-pending {
  background-color: rgba(0, 0, 0, 0.04);
  color: var(--color-text-muted);
  border: 1px solid rgba(0, 0, 0, 0.06);
}

.status-processing {
  background-color: rgba(217, 119, 6, 0.1);
  color: var(--color-warning);
  border: 1px solid rgba(217, 119, 6, 0.2);
  animation: pulse 1.5s infinite;
}

.status-completed {
  background-color: rgba(5, 150, 105, 0.1);
  color: var(--color-success);
  border: 1px solid rgba(5, 150, 105, 0.2);
}

.status-failed {
  background-color: rgba(220, 38, 38, 0.1);
  color: var(--color-error);
  border: 1px solid rgba(220, 38, 38, 0.2);
}

.item-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.icon-btn {
  background: rgba(0, 0, 0, 0.03);
  border: var(--glass-border);
  color: var(--color-text-muted);
  cursor: pointer;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.icon-btn:hover {
  color: var(--color-text);
  background-color: rgba(0, 0, 0, 0.06);
  border-color: rgba(0, 0, 0, 0.12);
}

.icon-btn-danger:hover {
  color: var(--color-error);
  background-color: rgba(220, 38, 38, 0.06);
  border-color: rgba(220, 38, 38, 0.15);
}

/* Progress bar */
.progress-card {
  background: var(--bg-card);
  border: var(--glass-border);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  box-shadow: var(--shadow-md);
}

.progress-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.9rem;
  font-weight: 600;
}

.progress-bar-bg {
  width: 100%;
  height: 10px;
  background-color: rgba(0, 0, 0, 0.06);
  border-radius: 5px;
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.04);
  position: relative;
}

.progress-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--color-primary), var(--color-accent));
  border-radius: 5px;
  transition: width var(--transition-fast);
  box-shadow: var(--shadow-glow);
  position: relative;
  overflow: hidden;
}

.progress-bar-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg,
      rgba(255, 255, 255, 0) 0%,
      rgba(255, 255, 255, 0.35) 50%,
      rgba(255, 255, 255, 0) 100%);
  animation: shimmer 1.5s infinite linear;
  background-size: 200% 100%;
}

@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }

  100% {
    background-position: 200% 0;
  }
}

/* Sortable GIF Frames Grid */
.gif-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 1.25rem;
}

.gif-frame-card {
  position: relative;
  background-color: var(--bg-input);
  border: var(--glass-border);
  border-radius: var(--radius-md);
  padding: 0.6rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  cursor: grab;
  user-select: none;
  transition: border-color var(--transition-fast), transform var(--transition-fast), box-shadow var(--transition-fast);
}

.gif-frame-card:hover {
  border-color: var(--color-primary);
  box-shadow: 0 4px 15px rgba(37, 99, 235, 0.1);
  transform: translateY(-2px);
}

.gif-frame-card:active {
  cursor: grabbing;
}

.gif-frame-card.dragging {
  opacity: 0.5;
  background-color: var(--bg-card-hover);
  border-color: var(--color-accent);
  box-shadow: var(--shadow-glow-accent);
  transform: scale(0.95);
}

.gif-frame-img {
  width: 100%;
  height: 90px;
  object-fit: contain;
  background-color: var(--bg-main);
  border-radius: 8px;
  border: 1px solid rgba(0, 0, 0, 0.04);
}

.gif-frame-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background-color: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(4px);
  color: var(--color-text);
  font-size: 0.7rem;
  padding: 0.15rem 0.45rem;
  border-radius: 6px;
  font-weight: 700;
  border: 1px solid rgba(0, 0, 0, 0.06);
}

.gif-frame-delete {
  position: absolute;
  top: 12px;
  right: 12px;
  background-color: rgba(220, 38, 38, 0.85);
  color: white;
  border: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  line-height: 1;
}

.gif-frame-delete:hover {
  background-color: var(--color-error);
  transform: scale(1.15);
}

/* Frame Delay Control */
.gif-frame-delay-control {
  width: 100%;
  display: flex;
  align-items: center;
  background: rgba(0, 0, 0, 0.03);
  border: var(--glass-border);
  border-radius: 6px;
  padding: 0.15rem 0.35rem;
}

.gif-frame-delay-input {
  width: 100%;
  background: transparent;
  border: none;
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: 0.72rem;
  text-align: center;
  font-weight: 700;
  outline: none;
}

.gif-frame-delay-input::-webkit-inner-spin-button,
.gif-frame-delay-input::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.gif-frame-size {
  font-size: 0.7rem;
  color: var(--color-text-muted);
  font-weight: 500;
}

/* Output result card */
.result-card {
  background: var(--bg-card);
  border: 1px solid rgba(5, 150, 105, 0.2);
  border-radius: var(--radius-md);
  padding: 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
  text-align: center;
  box-shadow: var(--shadow-md);
  animation: glowPulse 3s infinite alternate;
}

@keyframes glowPulse {
  from {
    box-shadow: var(--shadow-md);
  }

  to {
    box-shadow: var(--shadow-md), 0 0 25px rgba(5, 150, 105, 0.08);
  }
}

.result-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-success);
  display: flex;
  align-items: center;
  gap: 0.6rem;
  letter-spacing: -0.01em;
}

.result-preview-box {
  max-width: 100%;
  max-height: 350px;
  border-radius: 12px;
  overflow: hidden;
  background-color: var(--bg-input);
  border: var(--glass-border);
  display: flex;
  align-items: center;
  justify-content: center;
}

.result-img {
  max-width: 100%;
  max-height: 350px;
  object-fit: contain;
}

/* SEO Content */
.seo-section {
  background: var(--bg-card);
  border: var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 3rem 2.5rem;
  box-shadow: var(--shadow-md);
}

.seo-article h2 {
  font-size: 1.6rem;
  font-weight: 800;
  margin-bottom: 1.25rem;
  letter-spacing: -0.03em;
  color: var(--color-text);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.seo-article h2::before {
  content: '';
  display: inline-block;
  width: 4px;
  height: 24px;
  background: linear-gradient(to bottom, var(--color-primary), var(--color-accent));
  border-radius: 2px;
}

.seo-article h3 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-top: 2rem;
  margin-bottom: 0.85rem;
  color: var(--color-primary);
  letter-spacing: -0.02em;
}

.seo-article p {
  color: var(--color-text-dim);
  font-size: 0.95rem;
  line-height: 1.85;
  margin-bottom: 1.25rem;
  text-align: justify;
}

.seo-article ul {
  margin-left: 1.5rem;
  margin-bottom: 1.25rem;
  color: var(--color-text-dim);
  font-size: 0.95rem;
  line-height: 1.85;
}

.seo-article li {
  margin-bottom: 0.6rem;
}

/* Modals */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(8px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.modal-overlay.open {
  display: flex;
  animation: fadeInModal var(--transition-fast) forwards;
}

.modal-card {
  background: var(--bg-card);
  border: var(--glass-border);
  border-radius: var(--radius-lg);
  max-width: 650px;
  width: 100%;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.15);
  animation: slideUpModal var(--transition-normal) forwards;
}

.modal-header {
  padding: 1.5rem 2rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h3 {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--color-text);
  letter-spacing: -0.02em;
}

.modal-close {
  background: rgba(0, 0, 0, 0.04);
  border: var(--glass-border);
  color: var(--color-text-muted);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  cursor: pointer;
  line-height: 1;
  transition: all var(--transition-fast);
}

.modal-close:hover {
  color: var(--color-text);
  background-color: rgba(0, 0, 0, 0.08);
  border-color: rgba(0, 0, 0, 0.15);
}

.modal-body {
  padding: 2rem;
  overflow-y: auto;
  font-size: 0.95rem;
  color: var(--color-text-dim);
  line-height: 1.8;
}

.modal-body h4 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--color-text);
  margin-top: 1.5rem;
  margin-bottom: 0.6rem;
  letter-spacing: -0.01em;
}

/* Footer */
footer {
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  padding: 2.5rem 1.5rem;
  text-align: center;
  color: var(--color-text-muted);
  font-size: 0.85rem;
  font-weight: 500;
  margin-top: auto;
}

.footer-nav {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin-bottom: 1.25rem;
}

.footer-nav a {
  color: var(--color-text-muted);
  transition: color var(--transition-fast);
}

.footer-nav a:hover {
  color: var(--color-primary);
}

/* ==========================================================================
   CRITICAL RULES – Tab content visibility & utility classes
   ========================================================================== */

/* Tab content panels */
.tool-section {
  display: none;
  animation: fadeIn 0.35s ease forwards;
}

.tool-section.active {
  display: block;
}

/* Utility: hidden toggle */
.hidden {
  display: none !important;
}

/* File input overlay */
.file-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  z-index: 5;
}

/* Spinner */
.spinner {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Result action buttons */
.result-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.result-actions .btn {
  min-width: 180px;
}

/* Keyframe Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInModal {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes slideUpModal {
  from {
    opacity: 0;
    transform: translateY(30px) scale(0.96);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes pulse {

  0%,
  100% {
    opacity: 0.6;
  }

  50% {
    opacity: 1;
  }
}



/* ==========================================================================
   Convert Mega Menu Styles
   ========================================================================== */
.header-nav {
  position: relative;
  z-index: 1000;
}

.dropdown {
  position: relative;
  display: inline-block;
}

.dropbtn {
  background: transparent;
  border: var(--glass-border);
  background-color: var(--bg-card);
  color: var(--color-text);
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.6rem 1rem;
  border-radius: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: all var(--transition-fast);
  box-shadow: var(--shadow-sm);
}

.dropbtn:hover {
  background-color: var(--bg-card-hover);
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.dropdown-content.mega-menu {
  display: none;
  position: absolute;
  top: 110%;
  right: 0;
  background-color: var(--bg-card);
  width: max-content;
  min-width: 450px;
  box-shadow: var(--shadow-lg);
  border-radius: 16px;
  border: var(--glass-border);
  padding: 1.5rem;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  animation: fadeUp 0.2s ease-out forwards;
}

.dropdown:hover .dropdown-content.mega-menu {
  display: grid;
}

.mega-column h4 {
  font-size: 0.8rem;
  color: var(--color-primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.75rem;
  border-bottom: 2px solid var(--bg-main);
  padding-bottom: 0.4rem;
}

.mega-column a {
  display: block;
  padding: 0.4rem 0;
  color: var(--color-text-dim);
  font-weight: 500;
  font-size: 0.9rem;
  transition: color 0.2s;
}

.mega-column a:hover {
  color: var(--color-primary);
  padding-left: 4px;
}

/* ==========================================================================
   Universal Converter Tab Styles (Screenshot Match)
   ========================================================================== */
.univ-header-wrapper {
  text-align: center;
  margin-bottom: 2.5rem;
  padding-top: 1rem;
}

.univ-title {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--color-text);
  margin-bottom: 0.5rem;
}

.univ-subtitle {
  font-size: 1.1rem;
  color: var(--color-text-muted);
}

.univ-subtitle span {
  display: inline-block;
  background: var(--color-primary);
  color: white;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: bold;
  vertical-align: middle;
  margin-left: 8px;
}

.univ-dropzone-container {
  display: flex;
  justify-content: center;
}

.univ-dropzone-card {
  background: #f8fafc;
  border: 2px dashed #cbd5e1;
  border-radius: 16px;
  padding: 3rem 2rem;
  width: 100%;
  max-width: 600px;
  text-align: center;
  position: relative;
  transition: all var(--transition-fast);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.univ-dropzone-card.drag-over {
  border-color: var(--color-primary);
  background: rgba(37, 99, 235, 0.05);
}

.univ-choose-btn {
  background-color: #6366f1; /* purple-blue like screenshot */
  color: white;
  font-size: 1.1rem;
  padding: 0.75rem 2rem;
  border-radius: 8px;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 6px rgba(99, 102, 241, 0.3);
  transition: transform 0.2s, box-shadow 0.2s;
  z-index: 2;
}

.univ-choose-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(99, 102, 241, 0.4);
}

.univ-file-limit {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  margin-top: 0.5rem;
}

.univ-terms-notice {
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

.univ-drag-area {
  margin-top: 2rem;
  padding: 2rem;
  background: white;
  border-radius: 12px;
  width: 100%;
  border: 1px dashed #e2e8f0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  pointer-events: none;
}

.univ-drag-icon {
  background: var(--color-primary);
  color: white;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.univ-drag-area h3 {
  font-size: 1.25rem;
  color: var(--color-text-dim);
}

#univInput {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  z-index: 1;
}

/* Responsive */
@media (max-width: 768px) {
  .tab-btn {
    padding: 0.65rem 1.25rem;
    font-size: 0.85rem;
    gap: 0.4rem;
  }

  .dropzone-card {
    padding: 2rem 1rem;
  }

  .controls-card {
    padding: 1.25rem;
  }

  .controls-row-extra {
    grid-template-columns: 1fr;
  }

  .main-layout {
    grid-template-columns: 1fr;
  }

  .ad-sidebar {
    display: none;
  }

  .seo-section {
    padding: 2rem 1.25rem;
  }

  .header-right {
    flex-direction: column;
    width: 100%;
    gap: 0.8rem;
  }

  .lang-toggle {
    order: -1;
    align-self: stretch;
    justify-content: center;
  }
  
  .lang-btn {
    flex: 1;
    text-align: center;
  }

  /* Fix Mega Menu on Mobile */
  .header-nav {
    width: 100%;
  }

  .dropdown {
    width: 100%;
    position: static; /* allow full width absolute child */
  }

  .dropbtn {
    width: 100%;
    justify-content: center;
  }

  .dropdown-content.mega-menu {
    min-width: 100%;
    width: 100%;
    left: 0;
    right: 0;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    padding: 1.25rem;
  }

  /* Fix Typography and Sizes on Mobile */
  .univ-title {
    font-size: 1.75rem;
  }

  .univ-subtitle {
    font-size: 0.95rem;
  }

  .logo-text h1 {
    font-size: 1.4rem;
    text-align: center;
  }
  
  .logo-text p {
    font-size: 0.8rem;
    text-align: center;
  }

  .logo-section {
    flex-direction: column;
    text-align: center;
    gap: 0.8rem;
  }

  .logo-icon {
    width: 56px;
    height: 56px;
    font-size: 1.8rem;
  }

  .result-actions {
    flex-direction: column;
    width: 100%;
  }

  .result-actions .btn {
    width: 100%;
  }
}