/* ═══ Logo GIF Maker ═══ */

.gif-maker {
  position: relative;
  z-index: 1;
  max-width: 1100px;
  margin: 0 auto;
  padding: 6.5rem 1.5rem 4rem;
}

.gif-maker-header {
  margin-bottom: 2.5rem;
}

.gif-maker-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 420px);
  gap: 2rem;
  align-items: start;
}

.gif-panel {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 1.35rem;
}

.gif-panel + .gif-panel { margin-top: 1rem; }

.gif-panel-title {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 1rem;
}

/* Upload */
.gif-upload {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  padding: 1.5rem 1rem;
  border: 1px dashed rgba(255, 26, 26, 0.25);
  border-radius: 10px;
  background: rgba(255, 26, 26, 0.03);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.gif-upload:hover,
.gif-upload.is-dragover {
  border-color: rgba(255, 26, 26, 0.5);
  background: rgba(255, 26, 26, 0.06);
}

.gif-upload input { display: none; }

.gif-upload-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: rgba(255, 26, 26, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--red);
  font-size: 1.4rem;
}

.gif-upload-text {
  font-size: 0.88rem;
  color: var(--text-soft);
  text-align: center;
}

.gif-upload-text strong { color: var(--text); }

.gif-upload-hint {
  font-size: 0.72rem;
  color: var(--muted);
}

/* Presets grid */
.gif-preset-count {
  font-size: 0.65rem;
  font-weight: 500;
  color: var(--muted);
  margin-left: 0.35rem;
}

.gif-preset-category {
  grid-column: 1 / -1;
  font-size: 0.62rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--red);
  margin: 0.65rem 0 0.2rem;
  padding: 0;
}

.gif-preset-category:first-child {
  margin-top: 0;
}

.gif-presets {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.55rem;
  max-height: 420px;
  overflow-y: auto;
  padding-right: 0.25rem;
}

.gif-presets::-webkit-scrollbar { width: 4px; }
.gif-presets::-webkit-scrollbar-thumb { background: rgba(255,26,26,0.25); border-radius: 2px; }

.gif-preset {
  padding: 0.65rem 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.02);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}

.gif-preset:hover {
  border-color: rgba(255, 26, 26, 0.3);
  background: rgba(255, 26, 26, 0.04);
}

.gif-preset.is-active {
  border-color: var(--red);
  background: rgba(255, 26, 26, 0.08);
  box-shadow: 0 0 20px rgba(255, 26, 26, 0.12);
}

.gif-preset-name {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.15rem;
}

.gif-preset-desc {
  display: block;
  font-size: 0.68rem;
  color: var(--muted);
  line-height: 1.35;
}

/* Colors */
.gif-colors {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.gif-color {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
  position: relative;
}

.gif-color:hover { transform: scale(1.08); }

.gif-color.is-active {
  border-color: #fff;
  box-shadow: 0 0 16px currentColor;
  transform: scale(1.1);
}

.gif-color-label {
  position: absolute;
  bottom: -1.4rem;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.6rem;
  color: var(--muted);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

.gif-color.is-active .gif-color-label { opacity: 1; }

/* Color picker */
.gif-color-picker {
  margin-bottom: 1.25rem;
}

.gif-picker-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.gif-picker-field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.gif-picker-field span {
  font-size: 0.68rem;
  color: var(--muted);
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.gif-picker-field input[type="color"] {
  width: 100%;
  height: 42px;
  padding: 2px;
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  background: var(--bg);
  cursor: pointer;
}

.gif-picker-field input[type="color"]::-webkit-color-swatch-wrapper { padding: 2px; }
.gif-picker-field input[type="color"]::-webkit-color-swatch {
  border-radius: 5px;
  border: none;
}

.gif-hex-row {
  display: flex;
  gap: 0.5rem;
  align-items: flex-end;
}

.gif-hex-field {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.gif-hex-field span {
  font-size: 0.68rem;
  color: var(--muted);
  font-family: var(--font-mono);
  text-transform: uppercase;
}

.gif-hex-field input {
  padding: 0.5rem 0.65rem;
  border-radius: 6px;
  border: 1px solid var(--glass-border);
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.82rem;
}

.gif-sync-light {
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  border: 1px solid rgba(255, 26, 26, 0.3);
  background: rgba(255, 26, 26, 0.08);
  color: var(--red);
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s;
}

.gif-sync-light:hover { background: rgba(255, 26, 26, 0.14); }

.gif-sub-label {
  font-size: 0.65rem;
  color: var(--muted);
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.65rem;
}

/* Sliders */
.gif-sliders {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.gif-slider-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.gif-slider-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.35rem;
}

.gif-slider-head label {
  font-size: 0.68rem;
  color: var(--muted);
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.gif-slider-head output {
  font-size: 0.72rem;
  color: var(--red);
  font-family: var(--font-mono);
  font-weight: 500;
}

.gif-slider input[type="range"] {
  width: 100%;
  accent-color: var(--red);
  cursor: pointer;
}

.gif-slider select {
  width: 100%;
  padding: 0.45rem 0.6rem;
  border-radius: 6px;
  border: 1px solid var(--glass-border);
  background: var(--bg);
  color: var(--text);
  font-size: 0.82rem;
}

.gif-bg-types {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.4rem;
  margin-bottom: 0.85rem;
}

.gif-bg-type {
  padding: 0.5rem 0.35rem;
  border-radius: 6px;
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-soft);
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, color 0.2s;
}

.gif-bg-type:hover {
  border-color: rgba(255, 26, 26, 0.3);
  color: var(--text);
}

.gif-bg-type.is-active {
  border-color: var(--red);
  background: rgba(255, 26, 26, 0.1);
  color: var(--red);
}

.gif-bg-color-wrap {
  margin-bottom: 0.75rem;
}

.gif-bg-color-wrap[hidden],
.gif-upload[hidden] {
  display: none !important;
}

.gif-upload-sm {
  padding: 1rem;
  margin-bottom: 0.5rem;
}

.gif-bg-hint {
  font-size: 0.68rem;
  color: var(--muted);
  margin: 0;
  line-height: 1.4;
}

.gif-quality-hint {
  font-size: 0.68rem;
  color: var(--muted);
  margin: 0.35rem 0 0;
  line-height: 1.4;
}

@media (max-width: 480px) {
  .gif-bg-types { grid-template-columns: repeat(2, 1fr); }
}

.gif-option label.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.78rem;
  color: var(--text-soft);
  text-transform: none;
  letter-spacing: 0;
  font-family: var(--font-body);
  cursor: pointer;
}

/* Options row */
.gif-options {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 0.5rem;
}

.gif-option {
  flex: 1;
  min-width: 120px;
}

.gif-option label {
  display: block;
  font-size: 0.68rem;
  color: var(--muted);
  margin-bottom: 0.35rem;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.gif-option select,
.gif-option input[type="range"] {
  width: 100%;
}

.gif-option select {
  padding: 0.45rem 0.6rem;
  border-radius: 6px;
  border: 1px solid var(--glass-border);
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.82rem;
}

/* Preview */
.gif-preview-wrap {
  position: sticky;
  top: 5.5rem;
}

.gif-preview-box {
  aspect-ratio: 1;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--glass-border);
  background: #080808;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45), 0 0 40px rgba(255, 26, 26, 0.06);
}

.gif-preview-canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.gif-preview-label {
  text-align: center;
  font-size: 0.72rem;
  color: var(--muted);
  margin-top: 0.65rem;
  font-family: var(--font-mono);
}

/* Generate */
.gif-generate {
  width: 100%;
  margin-top: 1rem;
  padding: 0.85rem 1.25rem;
  border: none;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--red-deep), var(--red));
  color: #fff;
  font-family: var(--font-body);
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s, opacity 0.2s;
  box-shadow: 0 4px 24px rgba(255, 26, 26, 0.35);
}

.gif-generate:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 8px 32px rgba(255, 26, 26, 0.45);
}

.gif-generate:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.gif-progress {
  margin-top: 0.85rem;
  display: none;
}

.gif-progress.is-visible { display: block; }

.gif-progress-bar {
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.gif-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--red-deep), var(--red));
  transition: width 0.15s linear;
}

.gif-progress-text {
  font-size: 0.68rem;
  color: var(--muted);
  margin-top: 0.4rem;
  font-family: var(--font-mono);
}

.gif-cancel {
  display: block;
  width: 100%;
  margin-top: 0.55rem;
  padding: 0.5rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.gif-cancel:hover {
  background: rgba(255, 26, 26, 0.1);
  border-color: rgba(255, 26, 26, 0.35);
  color: var(--red);
}

.gif-download {
  display: none;
  width: 100%;
  margin-top: 0.65rem;
  padding: 0.7rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 26, 26, 0.35);
  background: rgba(255, 26, 26, 0.08);
  color: var(--red);
  font-weight: 600;
  font-size: 0.85rem;
  text-align: center;
  text-decoration: none;
  transition: background 0.2s;
}

.gif-download.is-visible { display: block; }

.gif-download:hover { background: rgba(255, 26, 26, 0.14); }

@media (max-width: 860px) {
  .gif-maker-grid {
    grid-template-columns: 1fr;
  }
  .gif-preview-wrap { position: static; }
  .gif-presets { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .gif-maker { padding-top: 5.5rem; }
}
