/* ── Empty State ── */
.empty-state {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  pointer-events: none;
  user-select: none;
  padding-bottom: 100px;
}

.empty-state svg {
  width: 200px;
  height: 200px;
  color: rgba(59, 130, 246, 0.18);
  flex-shrink: 0;
}

.empty-state-text {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  max-width: 420px;
  text-align: center;
}

.empty-state-title {
  font-size: 14px;
  font-weight: 600;
  color: rgba(96, 165, 250, 0.6);
  letter-spacing: 0.01em;
}

.empty-state-sub {
  font-size: 12px;
  font-weight: 400;
  color: rgba(59, 130, 246, 0.35);
  line-height: 1.6;
}

.empty-state.hidden { display: none; }

/* ── Images Page ── */
.images-page {
  flex: 1;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

/* ── Output Feed ── */
.output-feed {
  flex: 1;
  overflow-y: auto;
  padding: 28px 40px 160px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* ── Generation Group: 2 cards per row ── */
.generation-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  width: 90%;
  margin: 0 auto;
}

/* ── Image Card ── */
.image-card {
  background: var(--bg-card);
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  transition: all 0.3s ease;
  animation: fadeInUp 0.5s ease forwards;
  opacity: 0;
  transform: translateY(20px);
}

@keyframes fadeInUp {
  to { opacity: 1; transform: translateY(0); }
}

.image-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(59, 130, 246, 0.08);
  border-color: var(--accent-dark);
}

.image-card img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
  background: linear-gradient(135deg, #0a0a0a 0%, #0d0d0d 100%);
}

/* Loading placeholder image */
.image-card.loading img {
  display: none;
}

.image-card.loading .image-card-placeholder {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: linear-gradient(135deg, #0a0a0a 0%, #0d0d0d 100%);
  position: relative;
  overflow: hidden;
}

/* Generating glow animation */
@property --bx  { syntax: "<percentage>"; initial-value: 20%; inherits: false; }
@property --by  { syntax: "<percentage>"; initial-value: 30%; inherits: false; }
@property --bx2 { syntax: "<percentage>"; initial-value: 80%; inherits: false; }
@property --by2 { syntax: "<percentage>"; initial-value: 70%; inherits: false; }
@property --bx3 { syntax: "<percentage>"; initial-value: 50%; inherits: false; }
@property --by3 { syntax: "<percentage>"; initial-value: 90%; inherits: false; }

@keyframes blueGlowAnim {
  0%, 100% { --bx: 20%; --by: 30%; --bx2: 80%; --by2: 70%; --bx3: 50%; --by3: 90%; }
  33%       { --bx: 70%; --by: 20%; --bx2: 30%; --by2: 80%; --bx3: 90%; --by3: 40%; }
  66%       { --bx: 40%; --by: 80%; --bx2: 60%; --by2: 20%; --bx3: 10%; --by3: 60%; }
}

.image-card.loading .image-card-placeholder::before {
  content: "";
  position: absolute;
  inset: 0;
  animation: blueGlowAnim 8s linear infinite;
  background-image:
    radial-gradient(circle at var(--bx, 20%) var(--by, 30%), rgba(59,130,246,0.25) 5%, transparent 35%),
    radial-gradient(circle at var(--bx2, 80%) var(--by2, 70%), rgba(59,130,246,0.15) 5%, transparent 35%),
    radial-gradient(circle at var(--bx3, 50%) var(--by3, 90%), rgba(59,130,246,0.2) 5%, transparent 35%);
}

/* ── Loading progress text ── */
.card-progress-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 16px;
  font-weight: 700;
  color: rgba(96, 165, 250, 0.85);
  letter-spacing: 0.06em;
  pointer-events: none;
  z-index: 2;
}

/* ── Card Footer ── */
.image-card-actions {
  padding: 10px 14px;
  background: rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: nowrap;
}

.image-card-info {
  flex: 1;
  min-width: 0;
}

.image-card-prompt {
  color: var(--text-muted);
  font-size: 12px;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.image-card-tags {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.image-card-model {
  background: rgba(59, 130, 246, 0.08);
  color: var(--accent);
  padding: 3px 8px;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 500;
}

.image-card-ratio {
  background: rgba(59, 130, 246, 0.06);
  color: var(--text-muted);
  padding: 3px 8px;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 500;
}

.image-download-btn {
  background: rgba(59, 130, 246, 0.06);
  border: none;
  color: var(--accent);
  padding: 6px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.2s ease;
}

.image-download-btn:hover {
  background: rgba(59, 130, 246, 0.12);
}

.image-download-btn svg {
  width: 16px;
  height: 16px;
}

/* ── Prompt Section Container (absolute bottom) ── */
.prompt-section-container {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 80px);
  max-width: 800px;
  z-index: 20;
}

/* ── Flow Prompt Panel ── */
.flow-prompt-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  min-height: 3.5rem;
  padding: 0.5rem;
  background: rgba(13, 13, 13, 0.9);
  backdrop-filter: blur(20px);
  border-radius: 0;
  box-shadow: rgba(0, 0, 0, 0.5) 0px 16px 32px -8px;
}

.flow-input-section {
  display: flex;
  align-items: center;
  flex: 1;
  min-height: 2.5rem;
}

.flow-input-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
}

.flow-prompt-input {
  flex: 1;
  padding: 0.75rem 1rem;
  background: transparent;
  border: none;
  color: var(--text);
  font-family: 'AppFont', sans-serif;
  font-size: 14px;
  outline: none;
  min-width: 0;
}

.flow-prompt-input::placeholder {
  color: var(--text-muted);
}

/* ── Send Button — transparent circle ── */
.flow-create-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  background: transparent;
  border: none;
  border-radius: 50%;
  color: var(--accent);
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.flow-create-btn:hover {
  background: rgba(59, 130, 246, 0.1);
}

.flow-create-btn svg {
  width: 18px;
  height: 18px;
}

/* ── Settings Gear (⚙ character) ── */
.simple-settings-wrap {
  position: relative;
  flex-shrink: 0;
}

.settings-gear-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  font-size: 18px;
  color: var(--accent);
  cursor: pointer;
  border-radius: 50%;
  user-select: none;
  transition: background 0.2s ease;
}

.settings-gear-icon:hover {
  background: rgba(59, 130, 246, 0.1);
}

/* ── Settings Dropdown ── */
.settings-dropdown {
  position: absolute;
  bottom: calc(100% + 10px);
  right: 0;
  width: 220px;
  background: rgba(10, 10, 10, 0.9);
  backdrop-filter: blur(16px);
  border: none;
  border-radius: var(--radius);
  padding: 6px;
  z-index: 1000;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
}

.settings-dropdown.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.settings-dropdown-header {
  display: none;
}

.settings-dropdown-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 10px;
  margin: 2px 0;
  color: var(--text);
  font-family: 'AppFont', sans-serif;
  font-size: 13px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: background 0.2s ease;
  width: 100%;
  text-align: left;
}

.settings-dropdown-item:hover {
  background: rgba(59, 130, 246, 0.06);
}

.settings-dropdown-item--readonly {
  cursor: default;
  pointer-events: none;
}

.settings-dropdown-item--readonly:hover {
  background: transparent;
}

.settings-item-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.settings-item-icon {
  width: 14px;
  height: 14px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.settings-item-value {
  color: var(--accent);
  font-size: 12px;
  font-weight: 500;
}
