/* ==========================================================================
   Passport Photo Generator — Premium Upscaled & Fully Responsive Stylesheet
   Theme: Royal Blue (#1a3566), Amber Gold (#d97706), Slate, Glassmorphism
   Supported Breakpoints: 320px, 375px, 430px, 768px, 1024px, 1280px+
   ========================================================================== */

/* --- Tool Header & Badges --- */
.tool-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(26, 53, 102, 0.12);
  box-shadow: 0 4px 16px rgba(26, 53, 102, 0.05);
  font-size: 13px;
  font-weight: 600;
  color: var(--royal-dark, #122549);
  margin-bottom: 18px;
  max-width: 100%;
  text-align: center;
}

.tool-badge i {
  font-size: 15px;
  color: #059669;
  flex-shrink: 0;
}

/* --- Dropzone Base & Responsive Ergonomics --- */
.dropzone {
  position: relative;
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 2px dashed rgba(26, 53, 102, 0.22);
  border-radius: 24px;
  padding: 48px 24px;
  text-align: center;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
  box-sizing: border-box;
}

.dropzone:hover {
  background: rgba(255, 255, 255, 0.95);
  border-color: var(--royal, #1a3566);
  transform: translateY(-2px);
  box-shadow: 0 16px 36px rgba(26, 53, 102, 0.08);
}

.dropzone.dragover,
.dropzone.drag-active {
  background: rgba(238, 246, 255, 0.95);
  border-color: #2563eb;
  border-style: solid;
  transform: scale(1.01);
  box-shadow: 0 0 0 5px rgba(37, 99, 235, 0.15), 0 20px 40px rgba(37, 99, 235, 0.12);
}

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

.dz-content {
  position: relative;
  z-index: 5;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.dz-icon-wrapper {
  width: 76px;
  height: 76px;
  border-radius: 22px;
  background: linear-gradient(135deg, #1a3566 0%, #2563eb 100%);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
  box-shadow: 0 12px 24px rgba(26, 53, 102, 0.22);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s ease;
}

.dropzone:hover .dz-icon-wrapper {
  transform: translateY(-4px) scale(1.06);
  box-shadow: 0 18px 36px rgba(37, 99, 235, 0.35);
}

.dz-icon-wrapper svg {
  width: 38px;
  height: 38px;
}

.dropzone h3 {
  font-size: 22px;
  font-weight: 800;
  color: var(--royal-dark, #122549);
  margin-bottom: 6px;
  letter-spacing: -0.01em;
}

.dropzone p {
  font-size: 15px;
  color: var(--slate-600, #475569);
  margin-bottom: 18px;
  line-height: 1.5;
  max-width: 480px;
}

.dz-chips {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 22px;
  max-width: 100%;
}

.dz-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  background: rgba(26, 53, 102, 0.06);
  border: 1px solid rgba(26, 53, 102, 0.1);
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 600;
  color: var(--royal, #1a3566);
  white-space: nowrap;
}

.dz-chip i {
  font-size: 12px;
  flex-shrink: 0;
}

.dz-btn {
  pointer-events: auto;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 28px;
  font-size: 15px;
  font-weight: 700;
  border-radius: 14px;
  box-shadow: 0 8px 24px rgba(26, 53, 102, 0.22);
}

/* --- Editor Area & Studio Layout --- */
#editorArea {
  animation: fadeIn 0.3s ease;
}

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

.editor-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding: 14px 18px;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 16px;
  border: 1px solid rgba(226, 232, 240, 0.9);
}

.editor-header h3 {
  font-size: 17px;
  font-weight: 800;
  color: var(--royal-dark, #122549);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.editor-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 24px;
  align-items: start;
}

/* --- Canvas Preview Area --- */
.editor-preview {
  position: relative;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1.5px solid rgba(226, 232, 240, 0.9);
  border-radius: 20px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 440px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04);
  overflow: hidden;
}

.editor-preview canvas {
  max-width: 100%;
  max-height: 460px;
  object-fit: contain;
  border-radius: 12px;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
  background: #ffffff;
}

.loading-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 20;
  border-radius: 20px;
}

.spinner {
  width: 44px;
  height: 44px;
  border: 4px solid rgba(37, 99, 235, 0.15);
  border-top-color: #2563eb;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 16px;
}

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

.loading-overlay p {
  font-size: 15px;
  font-weight: 700;
  color: var(--royal-dark, #122549);
  margin: 0 0 6px 0;
}

.loading-subtext {
  font-size: 12.5px;
  color: var(--slate-500, #64748b);
  font-weight: 500;
  margin: 0;
}

/* --- Editor Controls Column --- */
.editor-controls {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.control-section {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: 18px;
  padding: 18px;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.03);
}

.control-section h4 {
  font-size: 14px;
  font-weight: 800;
  color: var(--royal-dark, #122549);
  margin: 0 0 12px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.btn-link-reset {
  background: none;
  border: none;
  font-size: 12px;
  font-weight: 600;
  color: #2563eb;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 6px;
}

.btn-link-reset:hover {
  text-decoration: underline;
  background: rgba(37, 99, 235, 0.08);
}

/* --- Swatches --- */
.color-swatches {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.color-swatch {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid #cbd5e1;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.2s ease;
  position: relative;
}

.color-swatch:hover {
  transform: scale(1.15);
  border-color: #2563eb;
}

.color-swatch.active {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.35);
  transform: scale(1.1);
}

.custom-color-picker-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: 4px;
}

.custom-color-picker-wrap label {
  font-size: 12px;
  font-weight: 600;
  color: var(--slate-600, #475569);
}

.custom-color-picker-wrap input[type="color"] {
  -webkit-appearance: none;
  border: 2px solid #cbd5e1;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  cursor: pointer;
  padding: 0;
  background: none;
}

.custom-color-picker-wrap input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 0;
}

.custom-color-picker-wrap input[type="color"]::-webkit-color-swatch {
  border: none;
  border-radius: 50%;
}

/* --- AI Enhance Button --- */
.btn-ai-enhance {
  width: 100%;
  background: linear-gradient(135deg, #1a3566 0%, #2563eb 100%);
  color: #ffffff;
  border: none;
  padding: 12px 16px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.25);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease;
}

.btn-ai-enhance:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.35);
}

.control-help-text {
  font-size: 11.5px;
  color: var(--slate-500, #64748b);
  margin: 8px 0 0 0;
  line-height: 1.4;
}

/* --- Range Sliders --- */
.slider-group {
  margin-bottom: 14px;
}

.slider-group:last-child {
  margin-bottom: 0;
}

.slider-group label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--slate-700, #334155);
  margin-bottom: 6px;
}

.slider-group .val-badge {
  font-size: 11.5px;
  font-weight: 700;
  color: #2563eb;
  background: rgba(37, 99, 235, 0.08);
  padding: 2px 8px;
  border-radius: 6px;
}

.slider-group input[type="range"] {
  width: 100%;
  height: 6px;
  border-radius: 4px;
  background: #e2e8f0;
  outline: none;
  -webkit-appearance: none;
}

.slider-group input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #2563eb;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.4);
  transition: transform 0.15s ease;
}

.slider-group input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

/* --- Action Buttons --- */
.action-buttons-wrap {
  display: flex;
  gap: 10px;
}

.action-buttons-wrap .btn {
  padding: 12px 18px;
  font-size: 14.5px;
  font-weight: 700;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* --- Section Headlines & Subtitles --- */
.section-headline {
  font-size: 26px;
  font-weight: 900;
  color: var(--royal-dark, #122549);
  text-align: center;
  margin-bottom: 10px;
  letter-spacing: -0.02em;
}

.section-subtitle {
  font-size: 15px;
  color: var(--slate-600, #475569);
  text-align: center;
  max-width: 680px;
  margin: 0 auto 32px;
  line-height: 1.6;
}

/* --- Info Grid & Card Containers --- */
.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
  margin-bottom: 60px;
}

.info-card {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-radius: 20px;
  border: 1px solid rgba(226, 232, 240, 0.9);
  padding: 28px 24px;
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.04);
  box-sizing: border-box;
}

.info-card-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
}

.info-card-icon {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(26, 53, 102, 0.1), rgba(37, 99, 235, 0.15));
  color: var(--royal, #1a3566);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.info-card-icon.gold {
  background: linear-gradient(135deg, rgba(217, 119, 6, 0.12), rgba(245, 158, 11, 0.2));
  color: #d97706;
}

.info-card-header h3 {
  font-size: 18px;
  font-weight: 800;
  color: var(--royal-dark, #122549);
  margin: 0;
}

/* --- Steps & Guidelines --- */
.steps-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.step-item {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.step-number {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1a3566, #2563eb);
  color: #ffffff;
  font-size: 13.5px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 10px rgba(26, 53, 102, 0.22);
}

.step-text {
  flex: 1;
}

.step-text h5 {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--slate-800, #1e293b);
  margin: 0 0 3px 0;
}

.step-text p {
  font-size: 13.5px;
  color: var(--slate-600, #475569);
  line-height: 1.5;
  margin: 0;
}

.guidelines-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.guideline-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  background: rgba(248, 250, 252, 0.85);
  border-radius: 14px;
  border: 1px solid rgba(226, 232, 240, 0.9);
}

.guideline-icon {
  font-size: 18px;
  color: #d97706;
  flex-shrink: 0;
  margin-top: 2px;
}

.guideline-text {
  font-size: 13.5px;
  color: var(--slate-700, #334155);
  line-height: 1.5;
  flex: 1;
}

.guideline-text strong {
  color: var(--slate-900, #0f172a);
}

/* --- SEO Article Block --- */
.article-block {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: 20px;
  padding: 32px;
  margin-bottom: 60px;
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.03);
}

.article-block h2 {
  font-size: 22px;
  font-weight: 800;
  color: var(--royal-dark, #122549);
  margin-top: 0;
  margin-bottom: 14px;
}

.article-block h3 {
  font-size: 17px;
  font-weight: 800;
  color: var(--royal-dark, #122549);
  margin-top: 24px;
  margin-bottom: 10px;
}

.article-block p {
  font-size: 14.5px;
  color: var(--slate-600, #475569);
  line-height: 1.7;
  margin-bottom: 14px;
}

.article-highlight-box {
  background: #eff6ff;
  border-left: 4px solid #2563eb;
  padding: 16px 20px;
  border-radius: 12px;
  margin: 20px 0;
}

.article-highlight-box h4 {
  margin: 0 0 6px 0;
  font-size: 15px;
  font-weight: 800;
  color: #1e3a8a;
  display: flex;
  align-items: center;
  gap: 8px;
}

.article-highlight-box p {
  margin: 0;
  font-size: 13.5px;
  color: #1e40af;
  line-height: 1.6;
}

/* --- FAQ Section & Accordion --- */
.faq-section {
  margin-bottom: 60px;
}

.faq-accordion {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 860px;
  margin: 0 auto;
}

.accordion-item {
  background: #ffffff;
  border: 1.5px solid rgba(226, 232, 240, 0.9);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.03);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.accordion-item:hover {
  border-color: #bfdbfe;
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.06);
}

.accordion-header {
  width: 100%;
  padding: 18px 22px;
  background: none;
  border: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  color: var(--royal-dark, #122549);
  text-align: left;
  cursor: pointer;
  outline: none;
  transition: color 0.2s ease;
}

.accordion-header:hover {
  color: #2563eb;
}

.accordion-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #64748b;
  font-size: 12px;
  flex-shrink: 0;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.2s ease, color 0.2s ease;
}

.accordion-item.active .accordion-icon {
  transform: rotate(180deg);
  background: #2563eb;
  color: #ffffff;
}

.accordion-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.accordion-body p {
  padding: 0 22px 20px 22px;
  margin: 0;
  font-size: 14px;
  color: var(--slate-600, #475569);
  line-height: 1.6;
}

/* ==========================================================================
   Comprehensive Responsive Breakpoints (Mobile, Tablet, Desktop)
   ========================================================================== */

/* --- Tablet (max-width: 900px) --- */
@media (max-width: 900px) {
  .editor-layout {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .editor-preview {
    min-height: 320px;
    padding: 16px;
  }

  .action-buttons-wrap {
    flex-direction: column;
  }
}

/* --- Mobile Devices (max-width: 480px) --- */
@media (max-width: 480px) {
  .tool-badge {
    font-size: 11px;
    padding: 5px 12px;
    gap: 6px;
    margin-bottom: 12px;
  }

  .dropzone {
    padding: 24px 14px 20px;
    border-radius: 16px;
  }

  .dz-icon-wrapper {
    width: 54px;
    height: 54px;
    border-radius: 16px;
    margin-bottom: 12px;
  }

  .dz-icon-wrapper svg {
    width: 28px;
    height: 28px;
  }

  .dropzone h3 {
    font-size: 17px;
    margin-bottom: 4px;
  }

  .dropzone p {
    font-size: 12.5px;
    margin-bottom: 12px;
  }

  .dz-chips {
    gap: 6px;
    margin-bottom: 14px;
  }

  .dz-chip {
    font-size: 10.5px;
    padding: 3px 8px;
    gap: 4px;
  }

  .dz-btn {
    width: 100%;
    max-width: 260px;
    font-size: 14px;
    padding: 11px 18px;
    border-radius: 12px;
  }

  .editor-header {
    padding: 12px 14px;
    border-radius: 14px;
  }

  .editor-preview {
    min-height: 260px;
    padding: 12px;
    border-radius: 16px;
  }

  .editor-preview canvas {
    max-height: 320px;
  }

  .control-section {
    padding: 14px;
    border-radius: 14px;
  }

  .color-swatches {
    gap: 8px;
  }

  .color-swatch {
    width: 30px;
    height: 30px;
  }

  .action-buttons-wrap .btn {
    font-size: 14px;
    padding: 12px 18px;
    border-radius: 12px;
    min-height: 44px;
  }

  .info-card {
    padding: 20px 16px;
  }

  .article-block {
    padding: 20px 16px;
  }

  .accordion-header {
    padding: 14px 16px;
    font-size: 14px;
  }

  .accordion-body p {
    padding: 0 16px 16px 16px;
    font-size: 13px;
  }
}

/* --- Accessibility & Reduced Motion --- */
@media (prefers-reduced-motion: reduce) {
  .dropzone,
  .btn-ai-enhance,
  .action-buttons-wrap .btn {
    transition: none !important;
    animation: none !important;
  }
}
