:root {
  color-scheme: light;
  --primary-red: #e11d2e;
  --dark-red: #9f1020;
  --soft-red: #ffe8ec;
  --page-red: #fff5f6;
  --ink: #101828;
  --muted: #667085;
  --line: #f1d0d5;
  --white: #ffffff;
  --cta: #111827;
  --radius-xl: 38px;
  --radius-lg: 28px;
  --radius-md: 20px;
  --shadow-soft: 0 30px 80px rgba(159, 16, 32, 0.1);
  --shadow-card: 0 18px 45px rgba(159, 16, 32, 0.09);
  --shadow-hover: 0 24px 60px rgba(159, 16, 32, 0.15);
  font-family: "IBM Plex Sans Arabic", -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Segoe UI", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 18% 12%, rgba(225, 29, 46, 0.16), transparent 26rem),
    radial-gradient(circle at 82% 5%, rgba(159, 16, 32, 0.12), transparent 22rem),
    linear-gradient(180deg, var(--page-red) 0%, var(--white) 58%, #fffafb 100%);
}

body::before,
body::after {
  content: "";
  position: fixed;
  pointer-events: none;
  z-index: -1;
  border-radius: 999px;
  filter: blur(16px);
}

body::before {
  width: 220px;
  height: 220px;
  right: 7vw;
  top: 15vh;
  background: rgba(225, 29, 46, 0.1);
}

body::after {
  width: 170px;
  height: 170px;
  left: 9vw;
  bottom: 18vh;
  background: rgba(159, 16, 32, 0.09);
}

button,
textarea,
input {
  font: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

h1,
h2,
h3,
p {
  margin: 0;
}

svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.app-shell {
  min-height: 100vh;
  padding: clamp(14px, 3vw, 34px);
}

.site-frame {
  position: relative;
  overflow: hidden;
  max-width: 1180px;
  margin: 0 auto;
  border: 1px solid rgba(225, 29, 46, 0.08);
  border-radius: var(--radius-xl);
  background: linear-gradient(180deg, var(--page-red) 0%, var(--white) 55%, var(--white) 100%);
  box-shadow: var(--shadow-soft);
}

.site-frame::before {
  content: "";
  position: absolute;
  inset: -120px auto auto -100px;
  width: 260px;
  height: 260px;
  border-radius: 999px;
  background: rgba(225, 29, 46, 0.09);
  filter: blur(10px);
}

.primary-button:hover,
.ghost-button:hover,
button:hover:not(:disabled),
.analysis-card:hover {
  transform: translateY(-3px);
}

.section-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  margin: 0 auto 18px;
  padding: 8px 14px;
  border: 1px solid rgba(225, 29, 46, 0.13);
  border-radius: 999px;
  color: var(--dark-red);
  background: rgba(255, 232, 236, 0.74);
  font-size: 0.82rem;
  font-weight: 800;
  backdrop-filter: blur(14px);
}


.generator-section {
  padding: clamp(52px, 8vw, 86px) clamp(18px, 5vw, 62px);
}

.section-heading-main h2 {
  max-width: 720px;
  margin: 0 auto;
  color: var(--ink);
  font-size: clamp(1.8rem, 4vw, 3rem);
  line-height: 1.08;
  font-weight: 900;
  letter-spacing: -0.01em;
}


.generator-section {
  background: rgba(255, 255, 255, 0.56);
}

.section-heading-main {
  text-align: center;
  margin-bottom: 34px;
}

.section-heading-main span {
  display: inline-flex;
  margin-top: 16px;
  padding: 8px 13px;
  border: 1px solid rgba(225, 29, 46, 0.12);
  border-radius: 999px;
  color: var(--dark-red);
  background: var(--soft-red);
  font-size: 0.84rem;
  font-weight: 800;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) minmax(280px, 440px);
  gap: clamp(20px, 4vw, 42px);
  align-items: start;
}

.preview-panel,
.controls-panel {
  border: 1px solid rgba(225, 29, 46, 0.1);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.76);
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(18px);
}

.preview-panel {
  padding: clamp(12px, 2vw, 18px);
}

.phone-frame {
  width: min(100%, 410px);
  margin: 0 auto;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 24px 60px rgba(16, 24, 40, 0.14);
}

canvas {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 0;
  background: #fff;
}

.controls-panel {
  display: grid;
  gap: 16px;
  padding: clamp(16px, 3vw, 24px);
}

.drop-zone {
  min-height: 164px;
  display: grid;
  place-items: center;
  padding: 26px 22px;
  border: 1.5px dashed rgba(225, 29, 46, 0.38);
  border-radius: 26px;
  color: var(--ink);
  text-align: center;
  cursor: pointer;
  background:
    radial-gradient(circle at 50% 0%, rgba(225, 29, 46, 0.1), transparent 55%),
    rgba(255, 245, 246, 0.78);
  transition: transform 180ms ease-out, border-color 180ms ease-out, box-shadow 180ms ease-out;
}

.drop-zone:hover,
.drop-zone.is-dragging {
  transform: translateY(-3px);
  border-color: var(--primary-red);
  box-shadow: 0 18px 38px rgba(225, 29, 46, 0.12);
}

.drop-zone input {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  opacity: 0;
  pointer-events: none;
}

.drop-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 18px;
  color: var(--primary-red);
  background: var(--white);
  box-shadow: 0 12px 28px rgba(225, 29, 46, 0.14);
}

.drop-zone strong {
  display: block;
  margin-top: 14px;
  font-size: 1.08rem;
  font-weight: 900;
}

.drop-zone span:last-child,
.hint,
.empty-state,
.export-status {
  color: var(--muted);
  line-height: 1.75;
  font-size: 0.92rem;
}

.field-stack {
  display: grid;
  gap: 9px;
}

.label-row,
.section-heading,
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.label-row label,
.section-heading h2 {
  font-weight: 900;
}

.label-row span,
.section-heading span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 750;
}

textarea {
  width: 100%;
  min-height: 118px;
  resize: vertical;
  padding: 15px 16px;
  border: 1px solid rgba(225, 29, 46, 0.13);
  border-radius: 20px;
  outline: none;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.88);
  line-height: 1.75;
  transition: border-color 180ms ease-out, box-shadow 180ms ease-out;
}

textarea:focus {
  border-color: rgba(225, 29, 46, 0.44);
  box-shadow: 0 0 0 5px rgba(225, 29, 46, 0.08);
}

.toolbar {
  flex-wrap: wrap;
  align-items: center;
}

button {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 900;
  transition: transform 180ms ease-out, box-shadow 180ms ease-out, opacity 180ms ease-out;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.52;
}

.primary-button {
  flex: 1 1 220px;
  color: var(--white);
  background: linear-gradient(135deg, var(--primary-red), var(--dark-red));
  box-shadow: 0 18px 34px rgba(225, 29, 46, 0.22);
}

.ghost-button {
  flex: 0 0 auto;
  color: var(--ink);
  border: 1px solid rgba(225, 29, 46, 0.12);
  background: rgba(255, 255, 255, 0.78);
}

.export-status {
  min-height: 22px;
}

.analysis-panel {
  display: grid;
  gap: 12px;
  padding-top: 4px;
}

.analysis-list {
  display: grid;
  gap: 10px;
}

.analysis-card {
  display: grid;
  grid-template-columns: 68px 1fr;
  gap: 12px;
  align-items: center;
  padding: 10px;
  border: 1px solid rgba(225, 29, 46, 0.1);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 12px 30px rgba(159, 16, 32, 0.06);
}

.analysis-card.is-selected {
  border-color: rgba(225, 29, 46, 0.28);
  background: rgba(255, 245, 246, 0.86);
}

.analysis-card.is-muted {
  opacity: 0.68;
}

.analysis-card img {
  width: 68px;
  height: 68px;
  object-fit: cover;
  border-radius: 16px;
}

.analysis-meta {
  min-width: 0;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 6px 10px;
}

.analysis-meta strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.92rem;
  font-weight: 900;
}

.analysis-meta span {
  color: var(--dark-red);
  font-size: 0.78rem;
  font-weight: 850;
}

.image-actions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.pin-button,
.delete-button,
.icon-button {
  min-height: 32px;
  padding: 0 11px;
  border: 1px solid rgba(225, 29, 46, 0.13);
  color: var(--dark-red);
  background: var(--white);
  font-size: 0.75rem;
  box-shadow: none;
}

.icon-button {
  width: 34px;
  padding: 0;
}

.pin-button.is-active {
  color: var(--white);
  border-color: var(--primary-red);
  background: var(--primary-red);
}

.is-hidden,
.preview-topbar,
.layout-controls,
.settings-grid,
.angle-select,
.layout-select,
.compact-button,
.layout-card {
  display: none !important;
}

@media (max-width: 920px) {
  .site-frame {
    border-radius: 28px;
  }

  .workspace {
    grid-template-columns: 1fr;
  }

  .preview-panel {
    order: 2;
  }
}

@media (max-width: 560px) {
  .app-shell {
    padding: 10px;
  }

  .site-frame {
    border-radius: 22px;
  }

  .generator-section {
    padding: 44px 14px;
  }

  .controls-panel,
  .preview-panel {
    border-radius: 22px;
  }

  .phone-frame {
    width: min(100%, 360px);
    border-radius: 18px;
  }

  .toolbar,
  .label-row,
  .section-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .primary-button,
  .ghost-button {
    width: 100%;
    flex: 1 1 100%;
  }

  .analysis-card {
    grid-template-columns: 60px 1fr;
  }

  .analysis-card img {
    width: 60px;
    height: 60px;
  }
}
