/* ===========================================================
   BMP -> JPG Converter — Styles
   Scoped with .bmp2jpg- prefix so it can be safely embedded
   inside any existing website / shortcode without conflicts.
   =========================================================== */

#bmp2jpg-app, #bmp2jpg-app * {
  box-sizing: border-box;
}

#bmp2jpg-app {
  --bj-primary: #f59e0b;
  --bj-primary-dark: #d97706;
  --bj-accent: #ef4444;
  --bj-bg: #0f1220;
  --bj-bg-soft: #181a2e;
  --bj-card: #1d2038;
  --bj-border: #2c2f4a;
  --bj-text: #f2f0eb;
  --bj-text-muted: #a5a2c3;
  --bj-danger: #ef4444;
  --bj-success: #22c55e;

  font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  min-height: 100vh;
  width: 100%;
  display: flex;
  flex-direction: column;
  background: radial-gradient(circle at 85% 10%, #3a2a1f 0%, var(--bj-bg) 45%) fixed;
  color: var(--bj-text);
  line-height: 1.5;
}

/* ---------------- Header ---------------- */
.bmp2jpg-header {
  padding: 18px 28px;
  border-bottom: 1px solid var(--bj-border);
  background: rgba(15, 18, 32, 0.85);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 20;
}

.bmp2jpg-header-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
}

.bmp2jpg-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.bmp2jpg-logo {
  flex-shrink: 0;
  display: flex;
}

.bmp2jpg-brand-text h1 {
  font-size: 1.3rem;
  margin: 0;
  font-weight: 700;
  letter-spacing: 0.2px;
}

.bmp2jpg-brand-text p {
  margin: 2px 0 0;
  font-size: 0.8rem;
  color: var(--bj-text-muted);
}

.bmp2jpg-badges {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.bmp2jpg-badge {
  font-size: 0.75rem;
  background: var(--bj-bg-soft);
  border: 1px solid var(--bj-border);
  padding: 6px 12px;
  border-radius: 999px;
  color: var(--bj-text-muted);
  white-space: nowrap;
}

/* ---------------- Main layout ---------------- */
.bmp2jpg-main {
  flex: 1;
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

/* ---------------- Drop zone ---------------- */
.bmp2jpg-dropzone {
  border: 2.5px dashed var(--bj-border);
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(245,158,11,0.07), rgba(239,68,68,0.03));
  padding: 60px 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.25s ease;
  min-height: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.bmp2jpg-dropzone.bmp2jpg-dragover {
  border-color: var(--bj-primary);
  background: linear-gradient(180deg, rgba(245,158,11,0.18), rgba(239,68,68,0.08));
  transform: scale(1.005);
}

.bmp2jpg-dropzone-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.bmp2jpg-dropzone-icon {
  color: var(--bj-primary);
  margin-bottom: 8px;
  animation: bmp2jpg-float 3s ease-in-out infinite;
}

@keyframes bmp2jpg-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.bmp2jpg-dropzone h2 {
  margin: 0;
  font-size: 1.4rem;
  font-weight: 700;
}

.bmp2jpg-dropzone p {
  margin: 0;
  color: var(--bj-text-muted);
}

.bmp2jpg-hint {
  font-size: 0.8rem;
  margin-top: 10px !important;
}

/* ---------------- Buttons ---------------- */
.bmp2jpg-btn {
  font-size: 0.92rem;
  font-weight: 600;
  padding: 11px 20px;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  transition: transform 0.15s ease, filter 0.15s ease, opacity 0.15s ease;
  white-space: nowrap;
}

.bmp2jpg-btn:active {
  transform: scale(0.97);
}

.bmp2jpg-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.bmp2jpg-btn-primary {
  background: linear-gradient(135deg, var(--bj-primary), var(--bj-accent));
  color: #fff;
  box-shadow: 0 6px 18px rgba(245, 158, 11, 0.35);
}

.bmp2jpg-btn-primary:hover:not(:disabled) {
  filter: brightness(1.08);
}

.bmp2jpg-btn-ghost {
  background: transparent;
  border: 1.5px solid var(--bj-border);
  color: var(--bj-text);
}

.bmp2jpg-btn-ghost:hover {
  border-color: var(--bj-primary);
  color: var(--bj-primary);
}

.bmp2jpg-btn-danger {
  background: rgba(239, 68, 68, 0.12);
  color: #fca5a5;
  border: 1.5px solid rgba(239, 68, 68, 0.4);
}

.bmp2jpg-btn-danger:hover {
  background: rgba(239, 68, 68, 0.2);
}

.bmp2jpg-btn-small {
  font-size: 0.78rem;
  padding: 7px 12px;
  border-radius: 8px;
}

/* ---------------- Settings bar ---------------- */
.bmp2jpg-settings {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  background: var(--bj-bg-soft);
  border: 1px solid var(--bj-border);
  border-radius: 14px;
  padding: 16px 20px;
}

.bmp2jpg-setting {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 180px;
}

.bmp2jpg-setting label {
  font-size: 0.8rem;
  color: var(--bj-text-muted);
  font-weight: 600;
}

.bmp2jpg-setting input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  min-width: 200px;
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--bj-primary), var(--bj-accent));
  outline: none;
  cursor: pointer;
}

.bmp2jpg-setting input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--bj-primary-dark);
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,0.4);
}

.bmp2jpg-setting input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--bj-primary-dark);
  cursor: pointer;
}

.bmp2jpg-color-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.bmp2jpg-color-row input[type="color"] {
  width: 42px;
  height: 34px;
  border: 1.5px solid var(--bj-border);
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
  padding: 2px;
}

.bmp2jpg-chip {
  font-size: 0.75rem;
  padding: 7px 12px;
  border-radius: 8px;
  border: 1.5px solid var(--bj-border);
  background: transparent;
  color: var(--bj-text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
}

.bmp2jpg-chip:hover {
  border-color: var(--bj-primary);
  color: var(--bj-primary);
}

/* ---------------- Toolbar ---------------- */
.bmp2jpg-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  background: var(--bj-bg-soft);
  border: 1px solid var(--bj-border);
  border-radius: 14px;
  padding: 14px 18px;
}

.bmp2jpg-toolbar-stats {
  font-size: 0.9rem;
  color: var(--bj-text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
}

#fileCount {
  color: var(--bj-text);
  font-weight: 700;
}

.bmp2jpg-dot {
  opacity: 0.5;
}

.bmp2jpg-toolbar-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* ---------------- Results grid ---------------- */
.bmp2jpg-results {
  flex: 1;
}

.bmp2jpg-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 18px;
}

.bmp2jpg-card {
  background: var(--bj-card);
  border: 1px solid var(--bj-border);
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: bmp2jpg-fadein 0.35s ease;
}

@keyframes bmp2jpg-fadein {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.bmp2jpg-thumb {
  position: relative;
  width: 100%;
  height: 160px;
  background: #14162a;
  display: flex;
  align-items: center;
  justify-content: center;
}

.bmp2jpg-thumb img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.bmp2jpg-thumb .bmp2jpg-spinner {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 3px solid rgba(255,255,255,0.15);
  border-top-color: var(--bj-primary);
  animation: bmp2jpg-spin 0.8s linear infinite;
}

@keyframes bmp2jpg-spin {
  to { transform: rotate(360deg); }
}

.bmp2jpg-status-icon {
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 0.9rem;
  background: rgba(0,0,0,0.5);
  border-radius: 50%;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.bmp2jpg-card-body {
  padding: 12px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.bmp2jpg-filename {
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bmp2jpg-meta {
  font-size: 0.75rem;
  color: var(--bj-text-muted);
  display: flex;
  justify-content: space-between;
  gap: 6px;
}

.bmp2jpg-meta .bmp2jpg-save {
  color: var(--bj-success);
  font-weight: 700;
}

.bmp2jpg-card-actions {
  margin-top: auto;
  display: flex;
  gap: 8px;
}

.bmp2jpg-card-actions .bmp2jpg-btn {
  flex: 1;
  text-align: center;
}

.bmp2jpg-error-text {
  color: #fca5a5;
  font-size: 0.78rem;
}

/* ---------------- Empty state / features ---------------- */
.bmp2jpg-empty {
  text-align: center;
  padding: 10px 10px 30px;
}

.bmp2jpg-empty h3 {
  font-size: 1.15rem;
  margin-bottom: 20px;
  color: var(--bj-text-muted);
  font-weight: 600;
}

.bmp2jpg-features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.bmp2jpg-feature {
  background: var(--bj-bg-soft);
  border: 1px solid var(--bj-border);
  border-radius: 14px;
  padding: 22px 16px;
}

.bmp2jpg-feature-icon {
  font-size: 1.8rem;
  margin-bottom: 10px;
}

.bmp2jpg-feature h4 {
  margin: 0 0 6px;
  font-size: 0.95rem;
}

.bmp2jpg-feature p {
  margin: 0;
  font-size: 0.8rem;
  color: var(--bj-text-muted);
}

/* ---------------- Footer ---------------- */
.bmp2jpg-footer {
  text-align: center;
  padding: 16px;
  font-size: 0.75rem;
  color: var(--bj-text-muted);
  border-top: 1px solid var(--bj-border);
}

/* ---------------- Toast ---------------- */
.bmp2jpg-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #111328;
  border: 1px solid var(--bj-border);
  color: var(--bj-text);
  padding: 12px 20px;
  border-radius: 10px;
  font-size: 0.85rem;
  box-shadow: 0 10px 30px rgba(0,0,0,0.4);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 999;
  max-width: 90vw;
  text-align: center;
}

.bmp2jpg-toast.bmp2jpg-show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.bmp2jpg-toast.bmp2jpg-error {
  border-color: rgba(239,68,68,0.5);
  color: #fca5a5;
}

.bmp2jpg-toast.bmp2jpg-success {
  border-color: rgba(34,197,94,0.5);
  color: #86efac;
}

/* ---------------- Responsive ---------------- */
@media (max-width: 640px) {
  .bmp2jpg-header { padding: 14px 16px; }
  .bmp2jpg-main { padding: 16px; }
  .bmp2jpg-dropzone { padding: 40px 14px; min-height: 220px; }
  .bmp2jpg-dropzone h2 { font-size: 1.1rem; }
  .bmp2jpg-settings { flex-direction: column; align-items: stretch; }
  .bmp2jpg-setting input[type="range"] { min-width: 0; }
  .bmp2jpg-toolbar { flex-direction: column; align-items: stretch; }
  .bmp2jpg-toolbar-actions { justify-content: stretch; }
  .bmp2jpg-toolbar-actions .bmp2jpg-btn { flex: 1; }
  .bmp2jpg-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
}
