:root {
  --bg: #0B0C24;
  --bg-card: #151833;
  --accent: #F5A623;
  --accent-2: #FFD166;
  --text: #F0F2FA;
  --text-dim: #8B90B8;
  --border: #262B52;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
  line-height: 1.5;
}

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

/* NAVBAR */
.navbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 32px; border-bottom: 1px solid var(--border);
  position: sticky; top: 0; background: rgba(13,11,26,0.9); backdrop-filter: blur(8px); z-index: 50;
}
.logo { font-weight: 800; font-size: 1.3rem; font-family: 'Baloo 2', sans-serif; display: flex; align-items: center; }
h1, h2, h3, h4 { font-family: 'Baloo 2', sans-serif; }
.logo span { color: var(--accent); }
.navbar nav { display: flex; gap: 24px; }
.navbar nav a { color: var(--text-dim); font-weight: 500; }
.navbar nav a:hover { color: var(--text); }
.nav-right { display: flex; align-items: center; gap: 12px; }
.coin-pill {
  border: 1px solid var(--accent); color: var(--accent);
  border-radius: 20px; padding: 6px 14px; font-weight: 700; font-size: 0.9rem;
}

.btn-primary, .btn-outline, .btn-link {
  cursor: pointer; border: none; border-radius: 12px; font-weight: 700;
  padding: 10px 20px; font-size: 0.95rem; transition: transform .15s ease, opacity .15s ease;
}
.btn-primary { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #1a1305; }
.btn-primary:hover { transform: translateY(-1px); }
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }
.btn-link { background: none; color: var(--accent); text-decoration: underline; padding: 0; }

/* HERO */
.hero { text-align: center; padding: 90px 20px 60px; }
.hero h1 { font-size: 2.6rem; font-weight: 800; margin-bottom: 16px; }
.hero h1 span { color: var(--accent); }
.hero p { color: var(--text-dim); max-width: 560px; margin: 0 auto 28px; }

/* STUDIO */
.studio { padding: 40px 20px 80px; max-width: 1000px; margin: 0 auto; }
.studio h2 { text-align: center; margin-bottom: 20px; font-size: 1.8rem; }

.mode-switch { display: flex; justify-content: center; gap: 10px; margin-bottom: 30px; }
.mode-btn {
  background: var(--bg-card); border: 1px solid var(--border); color: var(--text-dim);
  padding: 10px 24px; border-radius: 30px; cursor: pointer; font-weight: 600;
}
.mode-btn.active { background: var(--accent); color: #1a1305; border-color: var(--accent); }

.studio-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 30px; }
@media (max-width: 800px) { .studio-grid { grid-template-columns: 1fr; } }

.upload-box {
  background: var(--bg-card); border: 2px dashed var(--border); border-radius: 16px;
  min-height: 220px; display: flex; align-items: center; justify-content: center;
  cursor: pointer; text-align: center; color: var(--text-dim); overflow: hidden;
  position: relative;
}
.upload-box img { width: 100%; height: 100%; object-fit: cover; }
.remove-photo-btn {
  position: absolute; top: 10px; right: 10px; width: 30px; height: 30px;
  border-radius: 50%; background: rgba(0,0,0,0.7); color: var(--text);
  border: 1px solid var(--border); cursor: pointer; font-size: 0.9rem;
}
.remove-photo-btn:hover { background: var(--accent); color: #1a1305; }
.upload-box:hover { border-color: var(--accent); }

.consent-line { display: flex; align-items: flex-start; gap: 8px; margin: 14px 0; font-size: 0.85rem; color: var(--text-dim); }
.consent-line input { margin-top: 3px; }

.studio-left h3 { margin: 20px 0 12px; font-size: 1.05rem; }
.template-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; max-height: 420px; overflow-y: auto; padding-right: 4px; }
.template-card {
  background: var(--bg-card); border: 2px solid var(--border); border-radius: 10px;
  overflow: hidden; text-align: center; cursor: pointer; font-size: 0.8rem;
}
.template-card img { width: 100%; aspect-ratio: 3/4; object-fit: cover; display: block; }
.template-card span { display: block; padding: 6px 4px; }
.template-card.selected { border-color: var(--accent); color: var(--accent); }

.template-card.skeleton { cursor: default; }
.template-card.skeleton .thumb {
  width: 100%; aspect-ratio: 3/4;
  background: linear-gradient(90deg, var(--bg-card) 25%, var(--border) 50%, var(--bg-card) 75%);
  background-size: 200% 100%; animation: shimmer 1.4s infinite;
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

.studio-right { background: var(--bg-card); border: 1px solid var(--border); border-radius: 16px; padding: 24px; }
.studio-right label { font-size: 0.85rem; color: var(--text-dim); display: block; margin-bottom: 6px; }
.studio-right select {
  width: 100%; padding: 10px; border-radius: 8px; background: var(--bg);
  border: 1px solid var(--border); color: var(--text); margin-bottom: 18px;
}
.cost-box {
  display: flex; justify-content: space-between; align-items: center;
  background: var(--bg); border-radius: 10px; padding: 12px 16px; margin-bottom: 18px;
  color: var(--text-dim); font-size: 0.9rem;
}
.cost-box strong { color: var(--accent); font-size: 1.1rem; }
.btn-generate { width: 100%; padding: 14px; font-size: 1.05rem; }
.status-line { text-align: center; margin-top: 10px; font-size: 0.85rem; color: var(--text-dim); min-height: 18px; }

.result-box { margin-top: 20px; text-align: center; }
.result-box img, .result-box video { width: 100%; border-radius: 12px; margin-bottom: 12px; }

/* PRICING */
.pricing { padding: 60px 20px; text-align: center; background: var(--bg-card); }
.pricing h2 { font-size: 1.8rem; margin-bottom: 6px; }
.pricing .sub { color: var(--text-dim); margin-bottom: 30px; }
.pricing-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; max-width: 900px; margin: 0 auto; }
@media (max-width: 800px) { .pricing-grid { grid-template-columns: repeat(2, 1fr); } }
.price-card {
  background: var(--bg); border: 1px solid var(--border); border-radius: 16px;
  padding: 28px 12px 24px; position: relative; overflow: hidden;
}
.price-card.popular { border-color: var(--accent); }
.badge {
  position: absolute; top: -12px; left: 50%; transform: translateX(-50%);
  background: var(--accent); color: #1a1305; font-size: 0.7rem; font-weight: 700;
  padding: 3px 10px; border-radius: 10px;
}
.bonus-badge {
  position: absolute; top: 10px; right: -32px; transform: rotate(45deg);
  background: linear-gradient(120deg, #4ADE80, #22C55E); color: #052e12;
  font-size: 0.62rem; font-weight: 800; padding: 3px 38px;
  letter-spacing: 0.3px;
}
.price-card .coins { font-size: 1.4rem; font-weight: 800; margin: 10px 0 4px; }
.coins-old { font-size: 0.9rem; font-weight: 600; color: var(--text-dim); text-decoration: line-through; margin-right: 4px; }
.price-card .price { color: var(--accent); font-weight: 700; margin-bottom: 14px; }
.ad-line { margin-top: 24px; color: var(--text-dim); font-size: 0.9rem; }

/* GALLERY */
.gallery { padding: 60px 20px; max-width: 1000px; margin: 0 auto; }
.gallery-head { text-align: center; margin-bottom: 20px; }
.gallery-head h2 { margin-bottom: 6px; }
.gallery-note { font-size: 0.82rem; color: var(--text-dim); }
.gallery-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
@media (max-width: 800px) { .gallery-grid { grid-template-columns: repeat(2, 1fr); } }
.empty-state { grid-column: 1 / -1; text-align: center; color: var(--text-dim); }
.gallery-card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px;
  overflow: hidden; position: relative;
}
.gallery-card img, .gallery-card video { width: 100%; aspect-ratio: 3/4; object-fit: cover; display: block; }
.gallery-card .type-badge {
  position: absolute; top: 8px; left: 8px; background: rgba(0,0,0,0.6);
  color: var(--text); font-size: 0.7rem; padding: 2px 8px; border-radius: 8px;
}
.gallery-card .gcard-actions {
  display: flex; gap: 6px; padding: 8px;
}
.gallery-card .gcard-actions button {
  flex: 1; font-size: 0.75rem; padding: 6px; border-radius: 6px;
  background: var(--bg); border: 1px solid var(--border); color: var(--text-dim); cursor: pointer;
}
.gallery-card .gcard-actions button:hover { color: var(--accent); border-color: var(--accent); }

/* MODAL */
.modal {
  position: fixed; inset: 0; background: rgba(0,0,0,0.6);
  display: flex; align-items: center; justify-content: center; z-index: 100;
}
.modal[hidden] { display: none !important; } /* hidden attribute हमेशा जीतना चाहिए, वरना modal पेज लोड होते ही दिख जाता है */

.photo-tips-link {
  display: block; width: 100%; text-align: left; background: none;
  border: none; color: var(--accent-2); font-size: 0.85rem; font-weight: 600;
  padding: 0 0 10px; cursor: pointer;
}
.photo-tips-link:hover { text-decoration: underline; }

.tips-box { width: 380px; max-height: 80vh; overflow-y: auto; text-align: left; }
.tips-box h3 { text-align: center; margin-bottom: 12px; }
.tips-note { font-size: 0.82rem; color: var(--text-dim); margin-bottom: 16px; text-align: center; }
.tips-good, .tips-avoid { font-size: 1rem; margin: 14px 0 8px; font-weight: 700; }
.tips-good { color: #4ADE80; }
.tips-avoid { color: #FF6B6B; }
.tips-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 4px; }
.tips-tile {
  background: var(--bg); border: 1.5px solid var(--border); border-radius: 12px;
  padding: 12px 8px; text-align: center; display: flex; flex-direction: column;
  align-items: center; gap: 6px;
}
.tips-tile svg { width: 34px; height: 34px; }
.tips-tile span { font-size: 0.72rem; color: var(--text-dim); line-height: 1.3; }
.tips-grid.good .tips-tile { border-color: rgba(74,222,128,0.3); }
.tips-grid.good .tips-tile svg { color: #4ADE80; }
.tips-grid.avoid .tips-tile { border-color: rgba(255,107,107,0.3); }
.tips-grid.avoid .tips-tile svg { color: #FF6B6B; }
.tips-box .btn-primary { width: 100%; margin-top: 16px; }
.modal-box {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 16px;
  padding: 30px; width: 320px; text-align: center; position: relative;
}
.modal-close { position: absolute; top: 10px; right: 14px; background: none; border: none; color: var(--text-dim); font-size: 1.3rem; cursor: pointer; }
.modal .btn-primary { width: 100%; margin-top: 16px; }
.modal .hint { font-size: 0.75rem; color: var(--text-dim); margin-top: 12px; }

.footer { text-align: center; padding: 30px; color: var(--text-dim); font-size: 0.85rem; border-top: 1px solid var(--border); }
