:root {
  --bg: #ffffff;
  --panel: #ffffff;
  --panel-border: rgba(17, 24, 39, 0.12);
  --text: rgba(17, 24, 39, 0.92);
  --muted: rgba(17, 24, 39, 0.62);
  --shadow: 0 12px 36px rgba(17, 24, 39, 0.10);
  --radius: 16px;
  --radius-sm: 12px;
  --accent: #7c5cff;
  --accent-2: #23d5ab;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji",
    "Segoe UI Emoji";
  color: var(--text);
  background: var(--bg);
}

.app {
  max-width: 1400px;
  margin: 0 auto;
  padding: 28px 16px 40px;
  display: grid;
  /* gap: 14px;  */
  transform: scale(0.7); /* Reduce zoom level by 30% */
  transform-origin: top center;
  width: 100%;
}

.split-container {
  display: flex;
  flex-wrap: wrap;
  min-height: 600px;
}

.working-area {
  display: flex;
  flex-direction: column;
}

.output-area {
  display: flex;
  flex-direction: column;
  min-height: 400px;
}

.app__header {
  padding: 18px 18px 4px;
}

.app__title {
  margin: 0;
  font-size: 28px;
  letter-spacing: -0.02em;
}

.app__subtitle {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.4;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.controls {
  padding: 0;
}

.control {
  display: grid;
  gap: 8px;
}

.control--range {
  min-width: 0;
}

.actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  padding-top: 4px;
}

.label {
  font-size: 13px;
  color: var(--muted);
}

.file,
.select,
.range {
  width: 100%;
}

.file {
  padding: 10px 12px;
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.25);
  color: var(--text);
}

.select {
  padding: 10px 12px;
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.25);
  color: var(--text);
  outline: none;
}

.range {
  accent-color: var(--accent);
}

.range__row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.value {
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.panu-btn {
  border-radius: 999px;
  font-weight: 600;
  letter-spacing: 0.01em;
  transition: transform 120ms ease, filter 120ms ease;
}

.panu-btn:hover {
  filter: brightness(1.03);
  transform: translateY(-1px);
}

.panu-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.panu-btn.btn-primary {
  border: 0;
  background: linear-gradient(135deg, rgba(124, 92, 255, 0.98), rgba(35, 213, 171, 0.90));
}

.panu-btn--ghost.btn-outline-secondary {
  background: rgba(255, 255, 255, 0.75);
}

.preview {
  position: relative;
  padding: 20px; /* Increased padding */
  min-height: 400px; /* Increased minimum height */
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%); /* Added gradient background */
  border: 3px solid #cbd5e1; /* Thicker border */
  border-radius: calc(var(--radius) * 1.2); /* Larger border radius */
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1), 0 2px 8px rgba(0, 0, 0, 0.05); /* Enhanced shadow */
}

.canvas {
  width: min(100%, 980px);
  height: auto;
  border-radius: calc(var(--radius) * 0.8); /* Slightly smaller radius */
  border: 2px solid #94a3b8; /* Thicker, more prominent border */
  background: #ffffff; /* White background for contrast */
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1); /* Add shadow to canvas */
  transition: transform 0.2s ease, box-shadow 0.2s ease; /* Add hover effect */
}

.canvas:hover {
  transform: scale(1.02); /* Slight scale on hover */
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15); /* Enhanced shadow on hover */
}

.hint {
  position: absolute;
  inset: 20px; /* Increased inset */
  display: grid;
  place-items: center;
  color: #475569; /* Darker, more visible color */
  text-align: center;
  pointer-events: none;
  font-size: 16px; /* Larger font size */
  font-weight: 500; /* Medium weight */
  background: rgba(255, 255, 255, 0.9); /* Semi-transparent background */
  padding: 20px; /* Added padding */
  border-radius: calc(var(--radius-sm) * 1.5); /* Rounded corners */
  border: 1px solid #e2e8f0; /* Subtle border */
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05); /* Light shadow */
}

@media (max-width: 900px) {
  .split-container {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .control {
    grid-column: span 12;
  }

  .control--range {
    grid-column: span 12;
  }

  .actions {
    justify-content: stretch;
  }

  .panu-btn {
    flex: 1;
  }
}

/* SEO and Feature Cards */
.features-section {
  padding: 2rem 0;
}

.feature-card {
  padding: 1.5rem;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-sm);
  height: 100%;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.feature-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(17, 24, 39, 0.15);
}

.feature-card h3 {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
  color: var(--text);
}

.feature-card p {
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 0;
}

.app__footer {
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
  font-size: 0.85rem;
}

.app__footer h5 {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--text);
}

.app__footer ul {
  padding-left: 0;
}

.app__footer li {
  margin-bottom: 0.4rem;
}

.app__footer a {
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s ease;
  font-size: 0.8rem;
}

.app__footer a:hover {
  color: var(--accent);
}

.app__footer .text-center p {
  font-size: 0.75rem;
  margin-bottom: 0.25rem;
}

.image-info {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-sm);
  padding: 1rem;
}

.image-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
}

.image-actions .btn {
  min-width: 140px;
  font-weight: 500;
}

/* Modal Styles */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1050;
  overflow: auto;
}

.modal.show {
  display: block;
}

.modal-dialog {
  position: relative;
  width: auto;
  max-width: 600px;
  margin: 50px auto;
}

.modal-dialog-centered {
  display: flex;
  align-items: center;
  min-height: calc(100% - 100px);
}

.modal-content {
  border: none;
  border-radius: var(--radius);
  box-shadow: 0 20px 60px rgba(17, 24, 39, 0.3);
  background: white;
  position: relative;
  display: flex;
  flex-direction: column;
  max-height: 90vh;
  overflow: hidden;
}

.modal-header {
  background: linear-gradient(135deg, rgba(124, 92, 255, 0.1), rgba(35, 213, 171, 0.1));
  border-bottom: 1px solid var(--panel-border);
  border-radius: var(--radius) var(--radius) 0 0;
  padding: 1.5rem;
}

.modal-title {
  font-weight: 600;
  color: var(--text);
  font-size: 1.1rem;
}

.btn-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--muted);
  cursor: pointer;
  padding: 0;
  margin: 0;
  position: absolute;
  top: 1rem;
  right: 1rem;
  opacity: 0.7;
  transition: opacity 0.2s ease;
}

.btn-close:hover {
  opacity: 1;
  color: var(--text);
}

.modal-body {
  padding: 1.5rem;
  max-height: 70vh;
  overflow-y: auto;
}

.modal-body h6 {
  color: var(--accent);
  font-weight: 600;
  margin-top: 1rem;
  margin-bottom: 0.5rem;
}

.modal-body h6:first-child {
  margin-top: 0;
}

.modal-body ul {
  margin-bottom: 1rem;
}

.modal-body li {
  margin-bottom: 0.25rem;
  line-height: 1.5;
}

.modal-body strong {
  color: var(--text);
}

.modal-footer {
  background: #f8fafc;
  border-top: 1px solid var(--panel-border);
  border-radius: 0 0 var(--radius) var(--radius);
  padding: 1rem 1.5rem;
}

/* Toggle Header Styles */
#toggleHeaderBtn {
  border-radius: 15px;
  padding: 4px 10px;
  font-size: 0.8rem;
  font-weight: 500;
  transition: all 0.3s ease;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

#toggleHeaderBtn:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

#appHeader, #featuresSection {
  transition: all 0.4s ease-in-out;
  overflow: hidden;
}

#appHeader.hidden, #featuresSection.hidden {
  max-height: 0;
  opacity: 0;
  margin: 0;
  padding: 0;
}

.app.py-4 {
  transition: padding-top 0.4s ease-in-out;
}

.app.compact {
  padding-top: 1rem;
}

/* Mobile Menu Styles */
@media (max-width: 991.98px) {
  .navbar-collapse {
    background: white;
    padding: 0.64rem;
    border-radius: 5px;
    box-shadow: 0 2.4px 8px rgba(0, 0, 0, 0.064);
    margin-top: 0.32rem;
  }
  
  .navbar-nav {
    text-align: center;
  }
  
  .navbar-nav .nav-link {
    margin: 0.16rem 0;
    display: inline-block;
  }
}

/* Reduce overall navbar size by 40% total */
.navbar {
  padding-top: 0.64rem !important;
  padding-bottom: 0.64rem !important;
}

.navbar-brand {
  font-size: 0.96rem !important;
}

.navbar-brand img {
  height: 19.2px !important;
}

.navbar-nav .nav-link {
  font-size: 0.68rem !important;
  padding: 0.32rem 0.64rem !important;
  margin: 0 0.24rem !important;
}

.navbar-toggler {
  padding: 0.2rem 0.4rem !important;
  font-size: 0.7rem !important;
}

.navbar-toggler-icon {
  width: 0.96em !important;
  height: 0.96em !important;
}

/* SEO and Feature Cards */
