/* ==========================================================================
   AI Wallpaper Studio - Modern Dark Luxury Stylesheet (RTL Optimized)
   ========================================================================== */

:root {
  --bg-main: #0b0c10;
  --bg-surface: #14161f;
  --bg-card: rgba(26, 29, 41, 0.7);
  --bg-card-hover: rgba(35, 40, 58, 0.85);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-glow: rgba(99, 102, 241, 0.3);
  
  --accent-primary: #6366f1;
  --accent-primary-hover: #4f46e5;
  --accent-secondary: #06b6d4;
  --accent-gradient: linear-gradient(135deg, #6366f1 0%, #a855f7 50%, #ec4899 100%);
  --accent-cyber: linear-gradient(135deg, #00f0ff 0%, #7928ca 100%);
  
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --radius-full: 9999px;
  
  --font-sans: 'Vazirmatn', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  
  --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.2);
  --shadow-lg: 0 20px 40px -15px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 25px rgba(99, 102, 241, 0.25);
}

/* Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

[hidden] {
  display: none !important;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-main);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
  direction: rtl;
}

/* Ambient Background Glows */
.ambient-glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(120px);
  pointer-events: none;
  z-index: 0;
  opacity: 0.15;
}

.glow-1 {
  width: 500px;
  height: 500px;
  background: #6366f1;
  top: -100px;
  right: -100px;
}

.glow-2 {
  width: 600px;
  height: 600px;
  background: #ec4899;
  bottom: 10%;
  left: -150px;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  background: rgba(11, 12, 16, 0.75);
  border-bottom: 1px solid var(--border-color);
  padding: 1rem 0;
  transition: all 0.3s ease;
}

.header-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.brand-icon {
  width: 44px;
  height: 44px;
  background: var(--accent-gradient);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  box-shadow: 0 0 20px rgba(99, 102, 241, 0.4);
}

.brand-text h1 {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: #fff;
}

.brand-text .subtitle {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: block;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.1rem;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
  border: none;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-primary {
  background: var(--accent-gradient);
  color: #ffffff;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

/* Hero Section */
.hero-section {
  position: relative;
  z-index: 10;
  max-width: 1000px;
  margin: 3rem auto 2rem;
  padding: 0 1.5rem;
  text-align: center;
}

.hero-badge {
  display: inline-block;
  background: rgba(99, 102, 241, 0.12);
  color: #a5b4fc;
  border: 1px solid rgba(99, 102, 241, 0.3);
  padding: 0.4rem 1rem;
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 1.25rem;
}

.hero-title {
  font-size: 2.4rem;
  font-weight: 800;
  line-height: 1.35;
  margin-bottom: 1rem;
  color: #fff;
}

.gradient-text {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-desc {
  font-size: 1.05rem;
  color: var(--text-secondary);
  max-width: 700px;
  margin: 0 auto 2rem;
}

/* Search Bar */
.search-bar-wrapper {
  max-width: 650px;
  margin: 0 auto;
}

.search-input-box {
  position: relative;
  display: flex;
  align-items: center;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 0.5rem 1.2rem;
  box-shadow: var(--shadow-sm);
  transition: all 0.3s ease;
}

.search-input-box:focus-within {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25), var(--shadow-glow);
}

.search-icon {
  font-size: 1.1rem;
  margin-left: 0.75rem;
  color: var(--text-muted);
}

.search-input-box input {
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--text-primary);
}

.search-input-box input::placeholder {
  color: var(--text-muted);
}

.clear-search-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1rem;
  padding: 0.2rem 0.5rem;
  transition: color 0.2s;
}

.clear-search-btn:hover {
  color: #fff;
}

/* Progress Dashboard */
.progress-dashboard {
  margin-top: 1.5rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.1rem 1.4rem;
  box-shadow: var(--shadow-sm);
}

.progress-track-info {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 0.85rem;
}

.stat-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
}

.stat-num {
  font-size: 1.35rem;
  font-weight: 800;
  color: #fff;
  font-variant-numeric: tabular-nums;
}

.stat-lbl {
  font-size: 0.76rem;
  color: var(--text-muted);
}

.stat-flagship .stat-num {
  color: #c084fc;
}

.stat-ready .stat-num {
  color: #10b981;
}

.stat-pending .stat-num {
  color: #f59e0b;
}

.stat-percent .stat-num {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.progress-bar-container {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: var(--accent-gradient);
  border-radius: var(--radius-full);
  transition: width 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.5);
}

/* Status Filter Pills */
.status-filter-pills {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.8rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.status-pill:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.status-pill.active {
  background: rgba(99, 102, 241, 0.15);
  border-color: var(--accent-primary);
  color: #a5b4fc;
}

.badge-mini {
  background: rgba(0, 0, 0, 0.4);
  padding: 0.1rem 0.45rem;
  border-radius: var(--radius-full);
  font-size: 0.7rem;
}

/* Categories Nav */
.categories-nav {
  position: relative;
  z-index: 10;
  max-width: 1400px;
  margin: 1.5rem auto;
  padding: 0 1.5rem;
}

.categories-scroll-wrapper {
  display: flex;
  gap: 0.6rem;
  overflow-x: auto;
  padding: 0.5rem 0.25rem 0.75rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}

.category-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.15rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  color: var(--text-secondary);
  font-size: 0.88rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
}

.category-tab:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.2);
}

.category-tab.active {
  background: var(--accent-gradient);
  color: #ffffff;
  border-color: transparent;
  font-weight: 700;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.35);
}

.category-tab .count-badge {
  background: rgba(0, 0, 0, 0.25);
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
}

/* Gallery Section */
.gallery-section {
  position: relative;
  z-index: 10;
  max-width: 1400px;
  margin: 0 auto 5rem;
  padding: 0 1.5rem;
}

.gallery-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-color);
}

.active-category-info {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
}

.active-category-info h3 {
  font-size: 1.35rem;
  font-weight: 700;
}

.results-count {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.gallery-view-options {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.sort-segmented-control {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: rgba(24, 25, 38, 0.7);
  border: 1px solid var(--border-color);
  padding: 0.25rem 0.5rem 0.25rem 0.35rem;
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: all 0.25s ease;
}

.sort-segmented-control:hover {
  border-color: rgba(99, 102, 241, 0.4);
  box-shadow: 0 0 16px rgba(99, 102, 241, 0.15);
}

.sort-label {
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.82rem;
  white-space: nowrap;
  padding-right: 0.4rem;
}

.sort-pills-wrapper {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  background: rgba(0, 0, 0, 0.3);
  padding: 0.2rem;
  border-radius: var(--radius-full);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.sort-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: transparent;
  color: var(--text-muted);
  border: 1px solid transparent;
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-full);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
}

.sort-pill-btn:hover:not(.active) {
  color: #fff;
  background: rgba(255, 255, 255, 0.07);
}

.sort-pill-btn.active {
  background: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.25);
  box-shadow: 0 2px 10px rgba(99, 102, 241, 0.4), 0 0 12px rgba(168, 85, 247, 0.25);
  transform: scale(1.02);
}

.sort-pill-btn:active {
  transform: scale(0.97);
}

.compact-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.82rem;
  color: var(--text-muted);
  cursor: pointer;
}

/* Wallpaper Grid */
.wallpaper-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.5rem;
  transition: all 0.3s ease;
}

.wallpaper-grid.compact {
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
}

/* Wallpaper Card */
.wallpaper-card {
  position: relative;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  overflow: hidden;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
}

.wallpaper-card:hover {
  transform: translateY(-6px) scale(1.01);
  border-color: rgba(99, 102, 241, 0.4);
  box-shadow: 0 15px 30px -10px rgba(0, 0, 0, 0.7), var(--shadow-glow);
}

/* 9:16 Aspect Ratio Image Container */
.card-media {
  position: relative;
  width: 100%;
  aspect-ratio: 9 / 16;
  background-color: #12131a;
  overflow: hidden;
}

.card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.wallpaper-card:hover .card-img {
  transform: scale(1.06);
}

/* Card Top Badges */
.card-top-badges {
  position: absolute;
  top: 0.8rem;
  right: 0.8rem;
  left: 0.8rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 2;
}

.card-category-badge {
  background: rgba(11, 12, 16, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.card-ratio-badge {
  background: rgba(0, 0, 0, 0.6);
  color: var(--text-secondary);
  font-size: 0.68rem;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
}

/* Card Bottom Overlay */
.card-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(11, 12, 16, 0.95) 0%, rgba(11, 12, 16, 0.6) 60%, transparent 100%);
  padding: 2.5rem 1rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  z-index: 2;
}

.card-title {
  font-size: 0.92rem;
  font-weight: 600;
  color: #fff;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.25rem;
}

.quick-view-text {
  font-size: 0.75rem;
  color: var(--accent-secondary);
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-weight: 500;
}

.quick-copy-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  border-radius: var(--radius-sm);
  padding: 0.3rem 0.6rem;
  font-size: 0.72rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  transition: all 0.2s;
  font-family: inherit;
}

.quick-copy-btn:hover {
  background: var(--accent-primary);
  border-color: transparent;
}

/* Empty Frame Card (Pending Generation) */
.wallpaper-card.is-pending {
  border: 1px dashed rgba(255, 255, 255, 0.15);
  background: #0d0f17;
}

.wallpaper-card.is-pending:hover {
  border-color: rgba(245, 158, 11, 0.4);
  box-shadow: 0 10px 25px -10px rgba(0, 0, 0, 0.7), 0 0 20px rgba(245, 158, 11, 0.15);
}

.card-placeholder-blueprint {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background-image: 
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 20px 20px;
  background-position: center center;
  padding: 1rem;
  text-align: center;
}

.blueprint-center-icon {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.04);
  border: 1px dashed rgba(255, 255, 255, 0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  margin-bottom: 0.75rem;
  transition: transform 0.3s ease;
}

.wallpaper-card:hover .blueprint-center-icon {
  transform: scale(1.1);
  border-color: var(--accent-primary);
}

.blueprint-label {
  font-size: 0.76rem;
  font-weight: 700;
  color: #94a3b8;
  letter-spacing: 0.5px;
}

.blueprint-hint {
  font-size: 0.68rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

/* Card Status Badges */
.card-status-badge {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.status-pending {
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.35);
  color: #fbbf24;
}

.status-ready {
  background: rgba(16, 185, 129, 0.18);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #34d399;
}

.status-flagship {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.3), rgba(168, 85, 247, 0.3));
  border: 1px solid rgba(168, 85, 247, 0.55);
  color: #e9d5ff;
  box-shadow: 0 0 10px rgba(168, 85, 247, 0.25);
}

.status-new-series {
  background: linear-gradient(135deg, rgba(236, 72, 153, 0.35), rgba(168, 85, 247, 0.4));
  border: 1px solid rgba(244, 114, 182, 0.7);
  color: #fce7f3;
  box-shadow: 0 0 14px rgba(236, 72, 153, 0.4);
  font-weight: 800;
  animation: pulseNewBadge 2.8s infinite ease-in-out;
}

@keyframes pulseNewBadge {
  0%, 100% { box-shadow: 0 0 8px rgba(236, 72, 153, 0.3); border-color: rgba(244, 114, 182, 0.6); }
  50% { box-shadow: 0 0 18px rgba(236, 72, 153, 0.7); border-color: rgba(244, 114, 182, 1); }
}

.status-secondary {
  background: rgba(100, 116, 139, 0.15);
  border: 1px solid rgba(100, 116, 139, 0.3);
  color: #94a3b8;
}

.card-id-badge {
  background: rgba(0, 0, 0, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #94a3b8;
  font-size: 0.68rem;
  font-family: var(--font-mono);
  padding: 0.18rem 0.5rem;
  border-radius: var(--radius-sm);
}

/* Load More Wrapper */
.load-more-wrapper {
  display: flex;
  justify-content: center;
  margin: 2.5rem 0 1rem;
}

.load-more-btn {
  padding: 0.75rem 2rem;
  font-size: 0.95rem;
  border-radius: var(--radius-full);
}

/* Phone Mockup Placeholder State */
.phone-placeholder-state {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #090a0f;
  background-image: 
    linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 24px 24px;
  background-position: center center;
  padding: 2rem 1.5rem;
  text-align: center;
  z-index: 3;
}

.phone-placeholder-state[hidden],
.phone-placeholder-state.is-hidden {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.placeholder-icon {
  font-size: 3.2rem;
  margin-bottom: 0.8rem;
  animation: pulseIcon 2s infinite ease-in-out;
}

@keyframes pulseIcon {
  0%, 100% { transform: scale(1); opacity: 0.85; }
  50% { transform: scale(1.08); opacity: 1; }
}

.placeholder-badge {
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.35);
  color: #fbbf24;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-full);
  margin-bottom: 0.75rem;
}

.placeholder-specs {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 4rem 1.5rem;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px dashed var(--border-color);
  max-width: 500px;
  margin: 2rem auto;
}

.empty-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.empty-state h3 {
  font-size: 1.3rem;
  margin-bottom: 0.5rem;
}

.empty-state p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
}

/* ==========================================================================
   Lightbox Dialog & Modal
   ========================================================================== */

.lightbox-dialog {
  border: none;
  background: transparent;
  padding: 0;
  max-width: 100vw;
  max-height: 100vh;
  width: 100%;
  height: 100%;
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.lightbox-dialog:not([open]) {
  display: none;
}

.lightbox-dialog::backdrop,
.guide-dialog::backdrop {
  background: rgba(5, 6, 9, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.lightbox-content {
  position: relative;
  background: #10121a;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  width: 95%;
  max-width: 1100px;
  max-height: 90vh;
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.8), 0 0 35px rgba(99, 102, 241, 0.2);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: modalScaleUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalScaleUp {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.modal-btn.close-btn {
  position: absolute;
  top: 1rem;
  left: 1rem;
  z-index: 50;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-btn.close-btn:hover {
  background: #ef4444;
  border-color: #ef4444;
  transform: rotate(90deg) scale(1.05);
}

/* Floating Navigation Arrows - Hidden in favor of header/bar controls */
.nav-arrow {
  display: none;
}

/* Lightbox Body (Split Screen) */
.lightbox-body {
  display: grid;
  grid-template-columns: 370px 1fr;
  height: 100%;
  max-height: 90vh;
  overflow: hidden;
}

/* Details Column */
.details-column {
  padding: 2rem 2.2rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.details-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-left: 2.8rem; /* Clear space for close button on top-left */
}

.header-tag-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.modal-nav-bar {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.nav-step-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.75rem;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.nav-step-btn:hover {
  background: var(--accent-primary);
  border-color: transparent;
  color: #fff;
  transform: translateY(-1px);
}

/* Left/Right Column: Phone Mockup Frame */
.preview-column {
  background: #090a0f;
  padding: 2rem 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-left: 1px solid var(--border-color);
  overflow-y: auto;
}

.phone-frame-container {
  position: relative;
  width: 250px;
  aspect-ratio: 9 / 19.5;
  border-radius: 38px;
  border: 5px solid #282a36;
  outline: 2px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.9), 0 0 25px rgba(0, 0, 0, 0.5);
  overflow: hidden;
  background: #000;
}

.phone-speaker-notch {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  width: 70px;
  height: 18px;
  background: #000;
  border-radius: 12px;
  z-index: 10;
}

.modal-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  user-select: none;
  z-index: 2;
}

/* Lockscreen Overlay */
.lockscreen-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 2.6rem 1.2rem 1.2rem;
  z-index: 5;
  color: #ffffff;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8), 0 0 20px rgba(0, 0, 0, 0.6);
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.lockscreen-overlay.hidden {
  opacity: 0;
}

.lockscreen-top {
  text-align: center;
}

.lockscreen-date {
  font-size: 0.78rem;
  font-weight: 500;
  margin-bottom: 0.15rem;
}

.lockscreen-clock {
  font-size: 2.8rem;
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  letter-spacing: -1px;
}

.lockscreen-widget {
  display: inline-block;
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(6px);
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
  font-size: 0.68rem;
  margin-top: 0.4rem;
}

.lockscreen-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
}

.phone-action-btn {
  width: 34px;
  height: 34px;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(8px);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
}

.home-indicator {
  position: absolute;
  bottom: -4px;
  left: 50%;
  transform: translateX(-50%);
  width: 90px;
  height: 4px;
  background: #ffffff;
  border-radius: 2px;
  opacity: 0.8;
}

.preview-toolbar {
  display: flex;
  gap: 0.5rem;
  margin-top: 1.2rem;
}

.pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.85rem;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  color: var(--text-secondary);
  font-size: 0.78rem;
  cursor: pointer;
  text-decoration: none;
  font-family: inherit;
  transition: all 0.2s;
}

.pill-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

.pill-btn.active {
  background: rgba(99, 102, 241, 0.2);
  color: #a5b4fc;
  border-color: rgba(99, 102, 241, 0.4);
}

/* Right Column: Details & Prompts */
.details-column {
  padding: 2.2rem 2.5rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.details-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.category-pill-tag {
  background: rgba(99, 102, 241, 0.15);
  color: #a5b4fc;
  border: 1px solid rgba(99, 102, 241, 0.3);
  padding: 0.3rem 0.8rem;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 600;
}

.index-indicator {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.modal-title {
  font-size: 1.6rem;
  font-weight: 800;
  color: #fff;
  line-height: 1.3;
}

.meta-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.modal-tags-section {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-top: 0.25rem;
}

.modal-tags-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.modal-tags-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.tag-chip {
  background: rgba(129, 140, 248, 0.12);
  border: 1px solid rgba(129, 140, 248, 0.28);
  color: #c7d2fe;
  padding: 0.28rem 0.7rem;
  border-radius: 9999px;
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
}

.tag-chip:hover {
  background: rgba(129, 140, 248, 0.25);
  border-color: rgba(129, 140, 248, 0.6);
  color: #ffffff;
  transform: translateY(-1px);
}

.badge {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-color);
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.badge-success {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.25);
  color: #6ee7b7;
}

.badge-warning {
  background: rgba(245, 158, 11, 0.15);
  border-color: rgba(245, 158, 11, 0.35);
  color: #fbbf24;
}

.badge-flagship {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.25), rgba(168, 85, 247, 0.3));
  border: 1px solid rgba(168, 85, 247, 0.5);
  color: #e9d5ff;
  box-shadow: 0 0 10px rgba(168, 85, 247, 0.2);
}

/* Safe Zone Tip Callout */
.info-callout {
  display: flex;
  gap: 0.85rem;
  background: rgba(30, 41, 59, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-right: 3px solid var(--accent-secondary);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
}

.callout-icon {
  font-size: 1.25rem;
  line-height: 1;
}

.callout-text strong {
  display: block;
  font-size: 0.84rem;
  color: #e2e8f0;
  margin-bottom: 0.2rem;
}

.callout-text p {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.45;
}

/* Prompt Box */
.prompt-section {
  background: #0b0c11;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.prompt-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid var(--border-color);
}

.prompt-title-group {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: #cbd5e1;
}

.copy-actions-group {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.copy-success-tag {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #6ee7b7;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-sm);
  animation: fadeInTag 0.2s ease;
}

@keyframes fadeInTag {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}

.copy-prompt-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--accent-primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 0.4rem 0.85rem;
  font-size: 0.8rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s ease;
}

.copy-prompt-btn:hover {
  background: var(--accent-primary-hover);
  transform: translateY(-1px);
}

.copy-prompt-btn.copied {
  background: #10b981;
}

.prompt-code-box {
  padding: 1.1rem;
  max-height: 160px;
  overflow-y: auto;
  font-family: var(--font-mono);
  font-size: 0.86rem;
  line-height: 1.6;
  color: #38bdf8;
  background: #07080c;
  word-break: break-word;
  white-space: pre-wrap;
  user-select: all;
}

/* How to use */
.how-to-use-box {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
}

.how-to-use-box h4 {
  font-size: 0.88rem;
  font-weight: 700;
  margin-bottom: 0.6rem;
  color: #e2e8f0;
}

.how-to-use-box ol {
  padding-right: 1.2rem;
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.how-to-use-box code {
  background: rgba(255, 255, 255, 0.1);
  padding: 0.15rem 0.35rem;
  border-radius: 4px;
  font-family: var(--font-mono);
  color: #f43f5e;
}

/* ==========================================================================
   Guide Modal
   ========================================================================== */

.guide-dialog {
  border: none;
  background: transparent;
  padding: 0;
  max-width: 100vw;
  max-height: 100vh;
  width: 100%;
  height: 100%;
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.guide-dialog:not([open]) {
  display: none;
}

.guide-content {
  position: relative;
  background: #141620;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  width: 90%;
  max-width: 650px;
  max-height: 85vh;
  padding: 2.2rem 2rem;
  overflow-y: auto;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8);
  animation: modalScaleUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.guide-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
}

.guide-icon {
  font-size: 1.8rem;
}

.guide-header h3 {
  font-size: 1.25rem;
  font-weight: 700;
}

.guide-body {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.guide-card {
  display: flex;
  gap: 1rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem 1.15rem;
}

.guide-card-icon {
  font-size: 1.8rem;
  line-height: 1;
}

.guide-card h4 {
  font-size: 0.95rem;
  margin-bottom: 0.3rem;
  color: #fff;
}

.guide-card p {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}

.toast {
  background: rgba(16, 185, 129, 0.95);
  backdrop-filter: blur(10px);
  color: #ffffff;
  padding: 0.65rem 1.4rem;
  border-radius: var(--radius-full);
  font-size: 0.88rem;
  font-weight: 600;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
  animation: toastFadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1), toastFadeOut 0.3s ease 2.2s forwards;
}

@keyframes toastFadeIn {
  from {
    opacity: 0;
    transform: translateY(15px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes toastFadeOut {
  from {
    opacity: 1;
    transform: translateY(0);
  }
  to {
    opacity: 0;
    transform: translateY(-10px);
  }
}

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */

@media (max-width: 900px) {
  .lightbox-body {
    grid-template-columns: 1fr;
    overflow-y: auto;
    max-height: 85vh;
  }

  .preview-column {
    border-left: none;
    border-bottom: 1px solid var(--border-color);
    padding: 1.5rem;
  }

  .phone-frame-container {
    width: 200px;
  }

  .details-column {
    padding: 1.5rem;
  }

  .nav-arrow {
    display: none; /* Hide floating arrows on small screen, touch swipe & onscreen bottom buttons used */
  }
}

@media (max-width: 600px) {
  .hero-title {
    font-size: 1.7rem;
  }

  .header-actions .btn span:not(.icon) {
    display: none;
  }

  .header-actions .btn {
    padding: 0.5rem 0.7rem;
  }

  .wallpaper-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }

  .card-top-badges {
    top: 0.5rem;
    right: 0.5rem;
    left: 0.5rem;
  }

  .card-category-badge {
    font-size: 0.65rem;
    padding: 0.2rem 0.5rem;
  }

  .card-overlay {
    padding: 1.5rem 0.6rem 0.6rem;
  }

  .card-title {
    font-size: 0.8rem;
  }

  .quick-copy-btn {
    display: none; /* Keep card clean on small mobile */
  }
}
