/* ============================================================
   AI Home Design Tool — Main Stylesheet
   ============================================================ */

:root {
  --ahdt-red:       #D4002A;
  --ahdt-red-dark:  #aa0022;
  --ahdt-red-light: #fff0f2;
  --ahdt-bg:        #f4f5f7;
  --ahdt-card:      #ffffff;
  --ahdt-border:    #e5e7eb;
  --ahdt-text:      #111827;
  --ahdt-muted:     #6b7280;
  --ahdt-shadow:    0 2px 12px rgba(0,0,0,.08);
  --ahdt-shadow-lg: 0 8px 32px rgba(0,0,0,.12);
  --ahdt-radius:    14px;
  --ahdt-radius-sm: 8px;
  --ahdt-font:      'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --ahdt-transition: .2s cubic-bezier(.4,0,.2,1);
}

/* ── Wrap ── */
.ahdt-wrap {
  font-family: var(--ahdt-font);
  font-size: 14px;
  color: var(--ahdt-text);
  background: var(--ahdt-bg);
  border-radius: var(--ahdt-radius);
  padding: 24px;
  box-sizing: border-box;
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
}

.ahdt-wrap *, .ahdt-wrap *::before, .ahdt-wrap *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ── Layout ── */
.ahdt-layout {
  display: grid;
  grid-template-columns: 420px 1fr;
  gap: 20px;
  align-items: start;
}

/* ── Card ── */
.ahdt-card {
  background: var(--ahdt-card);
  border-radius: var(--ahdt-radius);
  box-shadow: var(--ahdt-shadow);
  overflow: hidden;
  border: 1px solid var(--ahdt-border);
}

.ahdt-card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--ahdt-text);
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 16px 20px 14px;
  border-bottom: 1px solid var(--ahdt-border);
  background: #fafafa;
}

.ahdt-card-title svg {
  color: var(--ahdt-red);
  flex-shrink: 0;
}

/* ── Upload Card ── */
.ahdt-upload-card {}

.ahdt-upload-zone {
  margin: 16px 20px;
  border: 2px dashed #f4a4b0;
  border-radius: var(--ahdt-radius-sm);
  background: var(--ahdt-red-light);
  padding: 28px 16px;
  text-align: center;
  cursor: pointer;
  transition: border-color var(--ahdt-transition), background var(--ahdt-transition);
  position: relative;
  min-height: 170px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.ahdt-upload-zone:hover,
.ahdt-upload-zone.ahdt-drag-over {
  border-color: var(--ahdt-red);
  background: #ffe8ec;
}

.ahdt-upload-icon {
  margin-bottom: 10px;
  line-height: 0;
  transition: transform var(--ahdt-transition);
}

.ahdt-upload-zone:hover .ahdt-upload-icon {
  transform: translateY(-3px);
}

.ahdt-upload-label {
  font-size: 14px;
  font-weight: 500;
  color: var(--ahdt-text);
  margin-bottom: 4px;
}

.ahdt-upload-hint {
  font-size: 12px;
  color: var(--ahdt-muted);
}

/* Uploaded preview inside zone */
.ahdt-uploaded-preview {
  position: relative;
  width: 100%;
  border-radius: 8px;
  overflow: hidden;
}

.ahdt-uploaded-preview img {
  width: 100%;
  max-height: 200px;
  object-fit: cover;
  border-radius: 8px;
  display: block;
}

.ahdt-remove-img {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(0,0,0,.6);
  color: #fff;
  border: none;
  cursor: pointer;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--ahdt-transition);
}

.ahdt-remove-img:hover { background: rgba(0,0,0,.85); }

/* ── Demo Thumbs ── */
.ahdt-demo-section { padding: 0 20px 16px; }

.ahdt-demo-divider {
  text-align: center;
  position: relative;
  margin-bottom: 12px;
}

.ahdt-demo-divider::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--ahdt-border);
}

.ahdt-demo-divider span {
  position: relative;
  background: var(--ahdt-card);
  padding: 0 10px;
  font-size: 11px;
  color: var(--ahdt-muted);
  text-transform: uppercase;
  letter-spacing: .06em;
  font-weight: 500;
}

.ahdt-demo-thumbs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.ahdt-demo-thumb {
  cursor: pointer;
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid transparent;
  transition: border-color var(--ahdt-transition), transform var(--ahdt-transition);
  position: relative;
}

.ahdt-demo-thumb:hover { border-color: var(--ahdt-red); transform: scale(1.04); }
.ahdt-demo-thumb.active { border-color: var(--ahdt-red); }

.ahdt-demo-thumb img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  display: block;
}

.ahdt-demo-thumb span {
  display: block;
  text-align: center;
  font-size: 10px;
  font-weight: 500;
  padding: 4px 2px;
  color: var(--ahdt-muted);
  background: var(--ahdt-card);
}

/* ── Mode Toggle ── */
.ahdt-mode-toggle {
  display: flex;
  margin: 0 20px 20px;
  background: var(--ahdt-bg);
  border-radius: 30px;
  padding: 3px;
  gap: 3px;
}

.ahdt-mode-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 26px;
  border: none;
  background: transparent;
  font-family: var(--ahdt-font);
  font-size: 13px;
  font-weight: 500;
  color: var(--ahdt-muted);
  cursor: pointer;
  transition: all var(--ahdt-transition);
}

.ahdt-mode-btn.active {
  background: var(--ahdt-red);
  color: #fff;
  box-shadow: 0 2px 8px rgba(212,0,42,.3);
}

.ahdt-mode-btn:not(.active):hover { color: var(--ahdt-text); background: var(--ahdt-border); }

/* ── Options Card ── */
.ahdt-options-card {}

.ahdt-opt-group { padding: 16px 20px; }

.ahdt-opt-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--ahdt-muted);
  text-transform: uppercase;
  letter-spacing: .07em;
  margin-bottom: 10px;
}

/* ── Room Grid ── */
.ahdt-room-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
}

.ahdt-room-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 10px 6px 8px;
  border-radius: var(--ahdt-radius-sm);
  border: 1.5px solid var(--ahdt-border);
  background: #fafafa;
  cursor: pointer;
  transition: all var(--ahdt-transition);
  text-align: center;
}

.ahdt-room-btn svg { color: var(--ahdt-muted); transition: color var(--ahdt-transition); }

.ahdt-room-btn span {
  font-size: 10px;
  font-weight: 500;
  color: var(--ahdt-muted);
  line-height: 1.2;
  transition: color var(--ahdt-transition);
}

.ahdt-room-btn:hover,
.ahdt-room-btn.active {
  border-color: var(--ahdt-red);
  background: var(--ahdt-red-light);
}

.ahdt-room-btn.active svg,
.ahdt-room-btn:hover svg { color: var(--ahdt-red); }

.ahdt-room-btn.active span,
.ahdt-room-btn:hover span { color: var(--ahdt-red); }

/* ── Style Grid ── */
.ahdt-style-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.ahdt-style-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  border-radius: 20px;
  border: 1.5px solid var(--ahdt-border);
  background: #fafafa;
  font-size: 12px;
  font-weight: 500;
  color: var(--ahdt-muted);
  cursor: pointer;
  transition: all var(--ahdt-transition);
  white-space: nowrap;
}

.ahdt-style-emoji { font-size: 13px; line-height: 1; }

.ahdt-style-btn:hover,
.ahdt-style-btn.active {
  border-color: var(--ahdt-red);
  background: var(--ahdt-red-light);
  color: var(--ahdt-red);
}

/* ── Color Grid ── */
.ahdt-color-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.ahdt-color-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 8px 4px;
  border-radius: var(--ahdt-radius-sm);
  border: 1.5px solid var(--ahdt-border);
  cursor: pointer;
  transition: all var(--ahdt-transition);
  background: #fafafa;
}

.ahdt-swatch {
  width: 32px;
  height: 20px;
  border-radius: 4px;
  display: block;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.06);
}

.ahdt-color-btn span:last-child {
  font-size: 10px;
  font-weight: 500;
  color: var(--ahdt-muted);
}

.ahdt-color-btn:hover,
.ahdt-color-btn.active {
  border-color: var(--ahdt-red);
  background: var(--ahdt-red-light);
}

/* ── Lighting Row ── */
.ahdt-lighting-row {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}

.ahdt-light-btn {
  flex: 1;
  min-width: 80px;
  padding: 8px 8px;
  border-radius: 8px;
  border: 1.5px solid var(--ahdt-border);
  background: #fafafa;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--ahdt-muted);
  cursor: pointer;
  text-align: center;
  transition: all var(--ahdt-transition);
}

.ahdt-light-btn:hover,
.ahdt-light-btn.active {
  border-color: var(--ahdt-red);
  background: var(--ahdt-red-light);
  color: var(--ahdt-red);
}

/* ── Custom Mode ── */
.ahdt-textarea {
  width: 100%;
  border: 1.5px solid var(--ahdt-border);
  border-radius: var(--ahdt-radius-sm);
  padding: 10px 14px;
  font-family: var(--ahdt-font);
  font-size: 13px;
  color: var(--ahdt-text);
  resize: vertical;
  outline: none;
  transition: border-color var(--ahdt-transition);
  line-height: 1.5;
  background: #fafafa;
}

.ahdt-textarea:focus { border-color: var(--ahdt-red); background: #fff; }

.ahdt-select {
  width: 100%;
  padding: 9px 14px;
  border: 1.5px solid var(--ahdt-border);
  border-radius: var(--ahdt-radius-sm);
  font-family: var(--ahdt-font);
  font-size: 13px;
  color: var(--ahdt-text);
  background: #fafafa;
  outline: none;
  cursor: pointer;
  transition: border-color var(--ahdt-transition);
}

.ahdt-select:focus { border-color: var(--ahdt-red); }

/* ── Generate Button ── */
.ahdt-generate-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: calc(100% - 40px);
  margin: 0 20px 20px;
  padding: 14px 24px;
  background: var(--ahdt-red);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-family: var(--ahdt-font);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--ahdt-transition);
  box-shadow: 0 4px 16px rgba(212,0,42,.35);
  letter-spacing: .01em;
}

.ahdt-generate-btn:hover {
  background: var(--ahdt-red-dark);
  box-shadow: 0 6px 24px rgba(212,0,42,.45);
  transform: translateY(-1px);
}

.ahdt-generate-btn:active { transform: translateY(0); }

.ahdt-generate-btn:disabled {
  background: #ccc;
  box-shadow: none;
  cursor: not-allowed;
  transform: none;
}

.ahdt-demo-notice {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  color: var(--ahdt-muted);
  text-align: center;
  justify-content: center;
  margin: -12px 20px 16px;
}

.ahdt-demo-notice a { color: var(--ahdt-red); text-decoration: none; }
.ahdt-demo-notice a:hover { text-decoration: underline; }

/* ── RIGHT PANEL ── */
.ahdt-right { display: flex; flex-direction: column; gap: 20px; }

/* ── Tabs ── */
.ahdt-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--ahdt-border);
  background: #fafafa;
}

.ahdt-tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 13px 10px;
  border: none;
  background: transparent;
  font-family: var(--ahdt-font);
  font-size: 13px;
  font-weight: 500;
  color: var(--ahdt-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: all var(--ahdt-transition);
}

.ahdt-tab:hover { color: var(--ahdt-text); }

.ahdt-tab.active {
  color: var(--ahdt-red);
  border-bottom-color: var(--ahdt-red);
  background: var(--ahdt-card);
}

/* ── Tab Panes ── */
.ahdt-tab-pane { padding: 20px; }

/* ── Empty State ── */
.ahdt-empty {
  text-align: center;
  padding: 24px 16px;
}

.ahdt-empty-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 80px;
  height: 80px;
  background: var(--ahdt-red-light);
  border-radius: 50%;
  margin-bottom: 16px;
}

.ahdt-empty h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--ahdt-text);
  margin-bottom: 8px;
}

.ahdt-empty p {
  font-size: 13px;
  color: var(--ahdt-muted);
  line-height: 1.6;
  max-width: 320px;
  margin: 0 auto 20px;
}

/* Example row in empty state */
.ahdt-example-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  max-width: 480px;
  margin: 0 auto;
}

.ahdt-ex-item {
  border-radius: 8px;
  overflow: hidden;
  border: 1.5px solid var(--ahdt-border);
  cursor: pointer;
  transition: transform var(--ahdt-transition), border-color var(--ahdt-transition);
}

.ahdt-ex-item:hover { transform: scale(1.04); border-color: var(--ahdt-red); }

.ahdt-ex-item img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  display: block;
}

.ahdt-ex-item span {
  display: block;
  font-size: 11px;
  font-weight: 500;
  color: var(--ahdt-muted);
  text-align: center;
  padding: 5px 4px;
}

/* ── Loading ── */
.ahdt-loading {
  padding: 50px 20px;
  text-align: center;
}

.ahdt-spinner-ring {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 4px solid var(--ahdt-red-light);
  border-top-color: var(--ahdt-red);
  animation: ahdt-spin 0.9s linear infinite;
  margin: 0 auto 18px;
}

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

.ahdt-loading-text {
  font-size: 15px;
  font-weight: 600;
  color: var(--ahdt-text);
  margin-bottom: 6px;
}

.ahdt-loading-sub {
  font-size: 12px;
  color: var(--ahdt-muted);
  margin-bottom: 18px;
}

.ahdt-progress-bar {
  max-width: 240px;
  height: 6px;
  background: var(--ahdt-border);
  border-radius: 3px;
  overflow: hidden;
  margin: 0 auto;
}

.ahdt-progress-fill {
  height: 100%;
  background: var(--ahdt-red);
  border-radius: 3px;
  width: 0%;
  transition: width 0.4s ease;
}

/* ── Result ── */
.ahdt-result {}

/* 3-panel comparison grid (like the screenshot: small | large | small) */
.ahdt-compare-grid {
  display: grid;
  grid-template-columns: 1fr 1.6fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}

.ahdt-compare-item {
  border-radius: 10px;
  overflow: hidden;
  position: relative;
  background: var(--ahdt-bg);
  aspect-ratio: 3/4;
}

.ahdt-compare-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .4s ease;
}

.ahdt-compare-item:hover img { transform: scale(1.04); }

.ahdt-compare-badge {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  white-space: nowrap;
  border: 1.5px solid rgba(255,255,255,.5);
}

.ahdt-badge-origin { background: rgba(0,0,0,.6); color: #fff; }
.ahdt-badge-pro    { background: var(--ahdt-red); color: #fff; border-color: rgba(255,255,255,.3); }
.ahdt-badge-alt    { background: rgba(255,255,255,.85); color: #333; border-color: var(--ahdt-border); }

/* Shimmer on main result */
.ahdt-shimmer {
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 40%, rgba(255,255,255,.6) 50%, transparent 60%);
  background-size: 200% 100%;
  animation: ahdt-shimmer 1.8s ease infinite;
  pointer-events: none;
}

@keyframes ahdt-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Result info tags */
.ahdt-result-info {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.ahdt-info-tag {
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 500;
  background: var(--ahdt-bg);
  color: var(--ahdt-muted);
  border: 1px solid var(--ahdt-border);
  text-transform: capitalize;
}

/* Action buttons */
.ahdt-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.ahdt-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: 8px;
  font-family: var(--ahdt-font);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--ahdt-transition);
  text-decoration: none;
  border: 1.5px solid transparent;
}

.ahdt-btn-primary {
  background: var(--ahdt-red);
  color: #fff;
  border-color: var(--ahdt-red);
}

.ahdt-btn-primary:hover {
  background: var(--ahdt-red-dark);
  border-color: var(--ahdt-red-dark);
  color: #fff;
}

.ahdt-btn-outline {
  background: transparent;
  color: var(--ahdt-text);
  border-color: var(--ahdt-border);
}

.ahdt-btn-outline:hover {
  border-color: var(--ahdt-red);
  color: var(--ahdt-red);
  background: var(--ahdt-red-light);
}

/* ── History ── */
.ahdt-history-empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--ahdt-muted);
}

.ahdt-history-empty svg { display: block; margin: 0 auto 12px; }
.ahdt-history-empty p { font-size: 13px; line-height: 1.6; }

.ahdt-history-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.ahdt-history-item {
  border-radius: 8px;
  overflow: hidden;
  position: relative;
  cursor: pointer;
  border: 1.5px solid var(--ahdt-border);
  transition: border-color var(--ahdt-transition), transform var(--ahdt-transition);
}

.ahdt-history-item:hover { border-color: var(--ahdt-red); transform: scale(1.03); }

.ahdt-history-item img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  display: block;
}

.ahdt-history-meta {
  padding: 6px 8px;
  background: var(--ahdt-card);
}

.ahdt-history-meta strong {
  display: block;
  font-size: 10px;
  font-weight: 600;
  color: var(--ahdt-text);
  text-transform: capitalize;
}

.ahdt-history-meta span {
  font-size: 9.5px;
  color: var(--ahdt-muted);
}

/* ── Tips ── */
.ahdt-tips-list { display: flex; flex-direction: column; gap: 14px; }

.ahdt-tip {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px;
  border-radius: 8px;
  background: #fafafa;
  border: 1px solid var(--ahdt-border);
}

.ahdt-tip-icon {
  font-size: 20px;
  line-height: 1;
  flex-shrink: 0;
  margin-top: 2px;
}

.ahdt-tip strong {
  font-size: 13px;
  font-weight: 600;
  display: block;
  margin-bottom: 4px;
}

.ahdt-tip p {
  font-size: 12px;
  color: var(--ahdt-muted);
  line-height: 1.5;
}

/* ── Gallery Card ── */
.ahdt-gallery-card {}

.ahdt-gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 16px 20px;
}

.ahdt-gallery-item {
  border-radius: 8px;
  overflow: hidden;
  position: relative;
  cursor: pointer;
  aspect-ratio: 4/3;
}

.ahdt-gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .4s ease;
}

.ahdt-gallery-item:hover img { transform: scale(1.08); }

.ahdt-gallery-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,.65) 0%, transparent 60%);
  display: flex;
  align-items: flex-end;
  padding: 8px;
  opacity: 0;
  transition: opacity var(--ahdt-transition);
}

.ahdt-gallery-item:hover .ahdt-gallery-overlay { opacity: 1; }

.ahdt-gallery-overlay span {
  font-size: 11px;
  font-weight: 600;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0,0,0,.4);
}

/* ── Toast ── */
.ahdt-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #1f2937;
  color: #fff;
  padding: 11px 20px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  box-shadow: var(--ahdt-shadow-lg);
  opacity: 0;
  pointer-events: none;
  transition: all .25s ease;
  z-index: 9999;
  max-width: 90vw;
  text-align: center;
}

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

.ahdt-toast.ahdt-toast-error { background: #991b1b; }
.ahdt-toast.ahdt-toast-success { background: #166534; }

/* ── Error Banner ── */
.ahdt-error-banner {
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 13px;
  color: #991b1b;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 12px;
}

/* ── Responsive ── */
@media (max-width: 960px) {
  .ahdt-layout {
    grid-template-columns: 1fr;
  }
  .ahdt-compare-grid {
    grid-template-columns: 1fr 1fr;
  }
  .ahdt-compare-item:last-child {
    grid-column: 1 / -1;
    aspect-ratio: 16/9;
  }
}

@media (max-width: 640px) {
  .ahdt-wrap { padding: 12px; }
  .ahdt-room-grid { grid-template-columns: repeat(3, 1fr); }
  .ahdt-color-grid { grid-template-columns: repeat(4, 1fr); }
  .ahdt-compare-grid { grid-template-columns: 1fr; }
  .ahdt-compare-item { aspect-ratio: 16/9; }
  .ahdt-gallery-grid { grid-template-columns: repeat(2, 1fr); }
  .ahdt-history-grid { grid-template-columns: repeat(2, 1fr); }
  .ahdt-example-row { grid-template-columns: repeat(2, 1fr); }
  .ahdt-actions { flex-direction: column; }
  .ahdt-action-btn { justify-content: center; }
  .ahdt-generate-btn { font-size: 14px; }
}

@media (max-width: 420px) {
  .ahdt-demo-thumbs { grid-template-columns: repeat(2, 1fr); }
  .ahdt-room-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ============================================================
   AUTH MODAL
   ============================================================ */

/* Overlay */
.ahdt-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(10, 10, 20, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  padding: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease;
}

.ahdt-modal-overlay.open {
  opacity: 1;
  pointer-events: all;
}

/* Card */
.ahdt-modal {
  background: #fff;
  border-radius: 18px;
  width: 100%;
  max-width: 460px;
  max-height: 92vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 24px 64px rgba(0,0,0,.28), 0 0 0 1px rgba(0,0,0,.06);
  transform: translateY(24px) scale(.97);
  transition: transform .28s cubic-bezier(.34,1.56,.64,1);
  scrollbar-width: thin;
}

.ahdt-modal-overlay.open .ahdt-modal {
  transform: translateY(0) scale(1);
}

/* Close button */
.ahdt-modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: none;
  background: rgba(0,0,0,.07);
  color: #555;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--ahdt-transition), color var(--ahdt-transition);
  z-index: 2;
}

.ahdt-modal-close:hover { background: rgba(0,0,0,.14); color: #111; }

/* Hero header */
.ahdt-modal-hero {
  background: linear-gradient(135deg, #D4002A 0%, #8b0000 100%);
  padding: 32px 28px 24px;
  text-align: center;
  color: #fff;
}

.ahdt-modal-hero-icon {
  width: 64px;
  height: 64px;
  background: rgba(255,255,255,.18);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 14px;
  border: 2px solid rgba(255,255,255,.3);
}

.ahdt-modal-heading {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 7px;
  letter-spacing: -.01em;
  color: #fff;
}

.ahdt-modal-sub {
  font-size: 13px;
  color: rgba(255,255,255,.82);
  line-height: 1.55;
  margin-bottom: 18px;
}

/* Benefits list */
.ahdt-modal-benefits {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px 12px;
  text-align: left;
  margin-top: 4px;
}

.ahdt-benefit {
  font-size: 12px;
  color: rgba(255,255,255,.9);
  display: flex;
  align-items: center;
  gap: 6px;
}

.ahdt-benefit-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  background: rgba(255,255,255,.22);
  border-radius: 50%;
  font-size: 10px;
  font-weight: 700;
  flex-shrink: 0;
}

/* Modal tab bar */
.ahdt-modal-tabs {
  display: flex;
  border-bottom: 1px solid var(--ahdt-border);
  background: #f9f9f9;
}

.ahdt-mtab {
  flex: 1;
  padding: 13px 10px;
  border: none;
  background: transparent;
  font-family: var(--ahdt-font);
  font-size: 14px;
  font-weight: 600;
  color: var(--ahdt-muted);
  cursor: pointer;
  border-bottom: 2.5px solid transparent;
  margin-bottom: -1px;
  transition: all var(--ahdt-transition);
}

.ahdt-mtab:hover { color: var(--ahdt-text); }

.ahdt-mtab.active {
  color: var(--ahdt-red);
  border-bottom-color: var(--ahdt-red);
  background: #fff;
}

/* Panes */
.ahdt-mpane { padding: 24px 28px; }
.ahdt-mpane:not(.active):not([style*="display"]) { display: none; }

/* ── WordPress login form inside modal ── */
.ahdt-mpane #ahdt-login-form,
.ahdt-mpane #loginform {
  max-width: 100%;
}

.ahdt-mpane #ahdt-login-form p,
.ahdt-mpane #loginform p,
.ahdt-mpane #loginform .user-pass-wrap {
  margin-bottom: 14px;
}

.ahdt-mpane #ahdt-login-form label,
.ahdt-mpane #loginform label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--ahdt-muted);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 6px;
  font-family: var(--ahdt-font);
}

.ahdt-mpane #ahdt-login-form input[type="text"],
.ahdt-mpane #ahdt-login-form input[type="password"],
.ahdt-mpane #loginform input[type="text"],
.ahdt-mpane #loginform input[type="password"],
.ahdt-mpane #loginform .input {
  width: 100% !important;
  padding: 11px 14px !important;
  border: 1.5px solid var(--ahdt-border) !important;
  border-radius: 9px !important;
  font-family: var(--ahdt-font) !important;
  font-size: 14px !important;
  color: var(--ahdt-text) !important;
  background: #fafafa !important;
  outline: none !important;
  transition: border-color var(--ahdt-transition) !important;
  box-shadow: none !important;
  box-sizing: border-box !important;
}

.ahdt-mpane #ahdt-login-form input[type="text"]:focus,
.ahdt-mpane #ahdt-login-form input[type="password"]:focus,
.ahdt-mpane #loginform input[type="text"]:focus,
.ahdt-mpane #loginform input[type="password"]:focus,
.ahdt-mpane #loginform .input:focus {
  border-color: var(--ahdt-red) !important;
  background: #fff !important;
}

/* WP hide-password button */
.ahdt-mpane .wp-pwd { position: relative; }
.ahdt-mpane .wp-hide-pw {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--ahdt-muted);
  padding: 4px;
}

/* Remember me */
.ahdt-mpane .forgetmenot label {
  text-transform: none !important;
  font-size: 13px !important;
  font-weight: 400 !important;
  letter-spacing: 0 !important;
  display: flex !important;
  align-items: center !important;
  gap: 6px !important;
  cursor: pointer;
  color: var(--ahdt-muted) !important;
}

/* Submit button */
.ahdt-mpane #ahdt-login-submit,
.ahdt-mpane #wp-submit {
  display: block !important;
  width: 100% !important;
  padding: 13px 24px !important;
  background: var(--ahdt-red) !important;
  color: #fff !important;
  border: none !important;
  border-radius: 10px !important;
  font-family: var(--ahdt-font) !important;
  font-size: 15px !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  transition: background var(--ahdt-transition) !important;
  box-shadow: 0 4px 14px rgba(212,0,42,.3) !important;
  letter-spacing: .01em !important;
  margin-top: 4px !important;
}

.ahdt-mpane #ahdt-login-submit:hover,
.ahdt-mpane #wp-submit:hover {
  background: var(--ahdt-red-dark) !important;
}

/* Lost password link */
.ahdt-mpane #nav,
.ahdt-mpane .login-links,
.ahdt-mpane p#nav {
  text-align: center;
  margin-top: 10px !important;
  font-size: 12px !important;
}

.ahdt-mpane #nav a { color: var(--ahdt-red); text-decoration: none; font-size: 12px; }
.ahdt-mpane #nav a:hover { text-decoration: underline; }

/* Switch tab link */
.ahdt-modal-switch {
  text-align: center;
  font-size: 13px;
  color: var(--ahdt-muted);
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--ahdt-border);
}

.ahdt-modal-switch a,
.ahdt-switch-tab {
  color: var(--ahdt-red);
  text-decoration: none;
  font-weight: 500;
  cursor: pointer;
}

.ahdt-modal-switch a:hover,
.ahdt-switch-tab:hover { text-decoration: underline; }

/* Register pane */
.ahdt-register-wrap { text-align: center; }

.ahdt-register-intro {
  font-size: 14px;
  color: var(--ahdt-muted);
  line-height: 1.6;
  margin-bottom: 22px;
}

.ahdt-modal-reg-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px 24px;
  background: var(--ahdt-red);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-family: var(--ahdt-font);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background var(--ahdt-transition);
  box-shadow: 0 4px 14px rgba(212,0,42,.3);
  letter-spacing: .01em;
}

.ahdt-modal-reg-btn:hover { background: var(--ahdt-red-dark); color: #fff; }

/* Responsive modal */
@media (max-width: 500px) {
  .ahdt-modal-hero { padding: 24px 20px 18px; }
  .ahdt-mpane { padding: 20px 20px; }
  .ahdt-modal-benefits { grid-template-columns: 1fr; }
  .ahdt-modal-heading { font-size: 19px; }
}
