/* VARIABLES & RESET */
:root {
  --primary: #0066cc;
  --primary-hover: #0052a3;
  --bg: #f4f7f9;
  --card-bg: #ffffff;
  --text: #333;
  --border: #dcdfe3;
}

[data-theme="dark"] {
  --bg: #0f172a; /* Sleek Slate Dark */
  --text: #f8fafc; /* Crisp clean white text */
  --border: #334155; /* Muted slate border separation lines */
}

body {
  font-family:
    "Segoe UI",
    system-ui,
    -apple-system,
    sans-serif;
  background: linear-gradient(135deg, #e3f2fd, #fce4ec);
  margin: 0;
  padding: 20px;
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
  box-sizing: border-box;
  transition:
    background 0.4s ease,
    color 0.3s ease;
}

/* TOP NAVIGATION HEADER BAR (3-COLUMN FLEX LAYOUT) */
.top-nav-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  width: 100%;
  max-width: 1600px;
  margin-left: auto;
  margin-right: auto;
  box-sizing: border-box;
  transition: all 0.3s ease;
}

/* 3-Column Equal Width Flex Hack for perfect centering */
.nav-spacer,
.nav-title-block,
.nav-toggle-block {
  flex: 1;
}

.nav-spacer {
  display: flex;
  justify-content: flex-start;
}

.nav-title-block {
  display: flex;
  justify-content: center;
}

.nav-toggle-block {
  display: flex;
  justify-content: flex-end;
  padding-right: 10px;
}

.app-title {
  margin: 0;
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: 2px;
  text-align: center;
  text-transform: uppercase;
  color: var(--primary);
  padding-bottom: 2px;
  transition: color 0.3s ease;
}

.switch-layout {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  margin: 0;
  transition: color 0.3s ease;
}

.switch-layout input[type="checkbox"] {
  width: auto;
  cursor: pointer;
}

/* BOTTOM NAVIGATION FOOTER BAR */
.bottom-nav-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  width: 100%;
  max-width: 1600px;
  margin-left: auto;
  margin-right: auto;
  box-sizing: border-box;
  border-top: 1px dashed #242526; /* Clean, elegant separator line */
  transition: all 0.3s ease;
}

/* 3-Column Equal Width Flex Distribution */
.footer-author-block,
.footer-tagline-block,
.footer-contact-block {
  flex: 1;
}

.footer-author-block {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

.footer-tagline-block {
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: center;
}

.footer-contact-block {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  padding-right: 10px;
}

/* Typography elements */
.footer-label {
  margin: 0 0 4px 0;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 700;
  color: #666;
}

.footer-highlight {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}

.footer-tag-line {
  margin: 0;
  font-size: 0.88rem;
  color: #555;
  font-weight: 500;
  font-style: italic;
}

.footer-copy-right {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.2px;
  transition: color 0.3s ease;
}

/* Contact Anchors configuration */
.footer-links {
  display: flex;
  gap: 12px;
}

.footer-link {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--primary);
  text-decoration: none;
  transition:
    color 0.2s ease,
    transform 0.2s ease;
}

.footer-link:hover {
  color: var(--primary-hover);
  text-decoration: underline;
}

/* header $ footer mq */
@media (max-width: 1024px) {
  .top-nav-header {
    flex-direction: row; /* Keep them on the same line, but change balancing rules */
    padding: 10px 15px; /* Add comfortable padding on mobile edges */
    margin-bottom: 15px;
  }

  .bottom-nav-footer {
    flex-direction: row; /* Keep them on the same line, but change balancing rules */
    padding: 10px 15px; /* Add comfortable padding on mobile edges */
    margin-bottom: 15px;
  }

  /* Hide the invisible spacer entirely on mobile to free up horizontal space */
  .nav-spacer {
    display: none !important;
  }

  .footer-tagline-block {
    display: none !important;
  }

  /* Reset flex overrides so columns scale down naturally to content size */
  .nav-title-block,
  .nav-toggle-block {
    flex: auto;
  }

  .footer-author-block,
  .footer-contact-block {
    flex: auto;
  }

  /* Push the title to the left edge */
  .nav-title-block {
    justify-content: flex-start;
  }

  .footer-author-block {
    justify-content: flex-start;
  }

  /* Push the switch toggle to the right edge */
  .nav-toggle-block {
    justify-content: flex-end;
    padding-right: 0;
  }

  .footer-contact-block {
    align-items: flex-end;
    padding-right: 0px;
  }

  /* Slightly shrink text sizes so they scale beautifully on small screens */
  .app-title {
    font-size: 1.25rem;
  }

  .switch-layout {
    font-size: 0.8rem;
  }
}

/* THREE-COLUMN GRID SYSTEM (Glassmorphism Effect) */
#main-menu {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 20px;
  max-width: 1600px;
  margin: 0 auto;
  padding-top: 10px;
  padding-bottom: 10px;
  align-items: normal; /* Prevents columns from stretching vertically to match height */
  animation: fadeSlide 0.6s ease;
}

/* Fallback for smaller/mobile screens */
@media (max-width: 1024px) {
  #main-menu {
    grid-template-columns: 1fr;
  }
}

#cropper-ui {
  max-width: 600px;
  margin: 40px auto;
  padding: 30px;
  border-radius: 12px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
  backdrop-filter: blur(12px);
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-sizing: border-box;
  display: none; /* Controlled via JS */
}

/* Individual Column Wrapper Containers */
.ui-col {
  padding: 24px;
  border-radius: 12px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
  box-sizing: border-box;
  backdrop-filter: blur(12px);
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

@keyframes fadeSlide {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

h2,
h3 {
  margin-top: 0;
  margin-bottom: 12px;
  color: #1a1a1a;
}

h2 {
  border-bottom: 2px solid #eee;
  padding-bottom: 10px;
  text-align: center;
}

#controls-column > h2:first-child {
  border-bottom: 2px solid #eee;
  padding-bottom: 10px;
  text-align: center;
  color: #1a1a1a;
  margin-top: 0;
  margin-bottom: 12px;
}

/* FORM ELEMENTS & PASSPORT PANEL UI */
.form-group {
  margin-bottom: 18px;
}

.form-group label {
  margin-bottom: 8px !important; /* Forces a uniform, clean gap below text labels */
}

label {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  font-weight: 600;
  margin-bottom: 6px;
  font-size: 0.9rem;
  color: #555;
}

input[type="file"],
input[type="number"],
input[type="text"],
select {
  width: 100%;
  padding: 12px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 0.95rem;
  box-sizing: border-box;
  transition: border-color 0.2s;
  background: #fff;
}

input[type="file"] {
  padding: 8px 10px; /* Slimmer padding to keep height aligned */
  display: flex;
  align-items: center;
  cursor: pointer;
}

/* Style the native browser "Choose Files" button */
input[type="file"]::-webkit-file-upload-button {
  background: var(--primary);
  color: white;
  border: none;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  margin-right: 10px;
  transition: background 0.2s;
}

input[type="file"]::-webkit-file-upload-button:hover {
  background: var(--primary-hover);
}

/* DRAG & DROP UPLOAD ZONE STYLES  */
.drop-zone {
  margin-bottom: 18px;
}

.drop-zone-inside {
  width: 100%;
  height: 250px;
  padding: 20px 15px;
  text-align: center;
  border: 2px dashed var(--border);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.4);
  cursor: pointer;
  box-sizing: border-box;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* Hover State - Subtle lifting effect */
.drop-zone-inside:hover {
  border-color: var(--primary);
  background: rgba(255, 255, 255, 0.8);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 102, 204, 0.05);
}

/* Active Drag State - Animated pulse border when files are hovering over the window */
.drop-zone.drag-active .drop-zone-inside {
  border-color: #28a745; /* Clean green border action indicator */
  background: rgba(40, 167, 69, 0.08) !important;
  transform: scale(0.99);
  border-style: solid;
  box-shadow: 0 0 15px rgba(40, 167, 69, 0.15) !important;
}

/* Typography & Asset Controls Inside the Zone */
.drop-icon {
  font-size: 1.8rem;
  margin-bottom: 8px;
  transition: transform 0.2s ease;
}

.drop-zone-inside:hover .drop-icon {
  transform: scale(1.1);
}

.drop-zone-inside p {
  margin: 0;
  font-size: 0.88rem;
  color: #555;
  font-weight: 500;
}

.drop-zone-inside p strong {
  color: var(--primary);
  text-decoration: underline;
}

input:focus,
select:focus {
  outline: none;
  border-color: var(--primary);
}

input[type="color"] {
  height: 45px;
  cursor: pointer;
  padding: 4px;
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  appearance: none;
  -webkit-appearance: none;
}

input[type="color"]:hover {
  border-color: var(--primary);
  background: #f0f7ff;
}

input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 0;
}

input[type="color"]::-webkit-color-swatch {
  border: none;
  border-radius: 4px;
}

.dimension-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.checkbox-container {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 10px 0;
  padding: 12px;
  background: #f8f9fa;
  border: 1px solid #eee;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s;
}

.checkbox-container:hover {
  background: #f0f2f5;
}

.checkbox-container label {
  cursor: pointer;
  user-select: none;
  margin-bottom: 0;
  display: block;
  width: 100%;
}
.checkbox-container input[type="checkbox"] {
  cursor: pointer;
  width: 18px;
  height: 18px;
}

/* Passport Feature Card Layout Tweaks */
.passport-badge {
  display: inline-block;
  background: #e6f2ff;
  color: var(--primary);
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: bold;
  margin-bottom: 10px;
}

/* BUTTONS */
button {
  width: 100%;
  padding: 14px;
  border-radius: 8px;
  border: none;
  background: var(--primary);
  color: white;
  font-weight: bold;
  font-size: 1rem;
  cursor: pointer;
  transition:
    transform 0.1s,
    background 0.2s,
    box-shadow 0.2s;
  margin-top: 15px;
  margin-bottom: 15px;
}

button:active {
  transform: scale(0.98);
}
button:hover {
  background: var(--primary-hover);
  box-shadow: 0 0 15px rgba(0, 102, 204, 0.4);
}

.btn-secondary {
  background: #6c757d;
}

.btn-secondary:hover {
  background: #5a6268;
}

.btn-skip {
  background: #dc3545;
}

.btn-skip:hover {
  background: #c82333;
}

.btn-reset {
  background: #64748b !important; /* Cool Slate Gray */
  font-size: 0.95rem !important;
  padding: 14px 10px !important;
  box-shadow: 0 4px 6px rgba(100, 116, 139, 0.15);
}

.btn-reset:hover {
  background: #475569 !important; /* Deeper Darker Slate */
  box-shadow: 0 0 12px rgba(100, 116, 139, 0.4) !important;
}

/*passport btn*/
.btn-passport {
  background: #28a745;
  box-shadow: 0 4px 6px rgba(40, 167, 69, 0.2);
}

.btn-passport:hover {
  background: #218838;
  box-shadow: 0 0 15px rgba(40, 167, 69, 0.4);
}

/* IMAGE CROPPER & STATUS UI */
.crop-container {
  width: 100%;
  max-height: 60vh;
  margin-bottom: 20px;
  background: #eee;
  border: 1px solid #ccc;
  border-radius: 8px;
  overflow: hidden;
}

img {
  display: block;
  max-width: 100%;
}

/* #filter {
  transition: size 0.2s ease;
}

#filter[size]:not([size="1"]) {
  position: absolute;
  z-index: 100;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
  height: 200px;
  width: 200px;
} */

.color-pad-row {
  display: flex;
  gap: 10px;
  align-items: center;
}

#paddingInput {
  flex: 1;
  padding: 10px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
}

#paddingInput:focus {
  border-color: var(--primary);
  box-shadow: 0 0 8px rgba(0, 102, 204, 0.3);
}

#status {
  margin-top: 15px;
  font-weight: bold;
  color: var(--primary);
  text-align: center;
}

#paddingInput,
#polaroidText,
#caption,
#color-disclaimer {
  transition:
    opacity 0.3s ease,
    transform 0.3s ease;
}

#polaroidText {
  margin-top: 10px;
  border-style: dashed;
}

/* General Workspace Tips Container */
.instruction-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.instruction-header h3 {
  margin: 0;
  font-size: 0.95rem;
  color: #1a1a1a;
  padding-bottom: 5px;
  padding-top: 5px;
}

.tip-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255, 255, 255, 0.8);
  padding: 10px 12px;
  border-radius: 8px;
  margin-bottom: 8px;
  border: 1px solid rgba(0, 0, 0, 0.03);
}

.tip-card p {
  margin: 0;
  font-size: 0.82rem;
  color: #555;
  line-height: 1.4;
}

.tip-badge {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  text-transform: uppercase;
  flex-shrink: 0;
}

.webp-badge {
  background: #e6f7ff;
  color: #1890ff;
  border: 1px solid #bae7ff;
}

.batch-badge {
  background: #f6ffed;
  color: #52c41a;
  border: 1px solid #b7eb8f;
}

.effects-badge {
  background: #fff0f6;
  color: #612feb;
  border: 1px solid #adffff;
}

/* Recipe Combos & Presets */
.recipes-panel > :first-child {
  margin-top: 15px;
  font-size: 0.95rem;
  margin-bottom: 10px;
  color: var(--primary);
}

.combos-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.combo-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.6);
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px dashed rgba(0, 0, 0, 0.08);
  transition:
    border-color 0.2s,
    background 0.2s;
}

.combo-pill:hover {
  border-color: var(--primary);
  background: rgba(255, 255, 255, 0.9);
}

.combo-pill p {
  margin: 0;
  font-size: 0.82rem;
  color: #444;
  font-weight: 500;
}

.combo-pill em {
  font-size: 0.75rem;
  color: #777;
  font-style: normal;
  margin-left: 4px;
}

.combo-tag {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  flex-shrink: 0;
  width: 55px;
  text-align: center;
}

.tag-aesthetic {
  background: #fff0f6;
  color: #eb2f96;
}

.tag-retro {
  background: #fff7e6;
  color: #fa8c16;
}

.tag-modern {
  background: #f5f5f5;
  color: #595959;
}

.tag-cyber {
  background: #f3e8ff;
  color: #9333ea;
}

/* Preview Container Setup */
.preview-box {
  width: 100%;
  height: 350px; /* Constrained height to keep preview completely under control */
  background: #f0f0f0;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 1px dashed #444;
  padding: 5px;
  box-sizing: border-box;
}

#preview-column > h3:first-child {
  margin-top: 0;
  margin-bottom: 12px;
  font-size: 1.5rem;
  text-align: center;
  color: #1a1a1a;
  padding-bottom: 10px;
  border-bottom: 2px solid #eee;
}

#previewCanvas {
  max-width: 100%;
  max-height: 100%;
  border-radius: 6px;
  object-fit: contain;
}

#colorlabel {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  font-weight: 600;
  margin-bottom: 6px;
  font-size: 0.9rem;
  color: #555;
}

.hidden {
  display: none !important;
}

.theme-toggle-container {
  padding-right: 10px;
  margin-top: 5px;
}

/* dark theme */
body.dark-mode-gradient {
  background: linear-gradient(135deg, #0f172a, #1e1b4b) !important;
}

/* Glass containers attribute */
[data-theme="dark"] .ui-col,
[data-theme="dark"] #cropper-ui {
  background: rgba(15, 23, 42, 0.65) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3) !important;
}

/* Text */
[data-theme="dark"] h2,
[data-theme="dark"] h3,
[data-theme="dark"] label,
[data-theme="dark"] #colorlabel,
[data-theme="dark"] .app-title {
  color: #f1f5f9 !important;
}

/* Inputs */
[data-theme="dark"] input[type="text"],
[data-theme="dark"] input[type="number"],
[data-theme="dark"] select,
[data-theme="dark"] .tip-card {
  background: #1e293b !important;
  color: #fff !important;
  border-color: #334155 !important;
}

/* Input File */
[data-theme="dark"] input[type="file"] {
  background: #1e293b !important;
  color: #94a3b8 !important;
  border-color: #334155 !important;
}

[data-theme="dark"] input[type="file"]::-webkit-file-upload-button {
  color: #f8fafc;
}

[data-theme="dark"] .checkbox-container,
[data-theme="dark"] .combo-pill {
  background: rgba(30, 41, 59, 0.5) !important;
  border-color: #334155 !important;
}

[data-theme="dark"] p,
[data-theme="dark"] em,
[data-theme="dark"] #preview-column > p {
  color: #94a3b8 !important; /* Soft light slate silver for high-contrast reading */
}

[data-theme="dark"] .combo-pill {
  background: rgba(30, 41, 59, 0.6) !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
}

[data-theme="dark"] .combo-pill p,
[data-theme="dark"] .tip-card p {
  color: #e2e8f0 !important;
}

[data-theme="dark"] .combo-pill:hover {
  background: #1e293b !important;
  border-color: var(--primary) !important;
}

[data-theme="dark"] .btn-reset {
  background: #334155 !important;
  border: 1px solid rgba(255, 255, 255, 0.05) !important;
}

[data-theme="dark"] .btn-reset:hover {
  background: #475569 !important;
}

[data-theme="dark"] .drop-zone-inside {
  background: rgba(30, 41, 59, 0.3);
  border-color: #334155;
}

[data-theme="dark"] .drop-zone-inside:hover {
  background: rgba(30, 41, 59, 0.6);
  border-color: var(--primary);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] .drop-zone-inside p {
  color: #94a3b8;
}

/* Active Drag State for Dark Theme */
[data-theme="dark"] .drop-zone.drag-active .drop-zone-inside {
  background: rgba(40, 167, 69, 0.12) !important;
  border-color: #2ea74f;
}

/* footer */
[data-theme="dark"] .bottom-nav-footer {
  border-top-color: var(--border);
}

[data-theme="dark"] .footer-label {
  color: #64748b;
}

[data-theme="dark"] .app-tag-line {
  color: #94a3b8;
}
