/* === Storybook Dashboard – Final Glassmorphism Design (Merged) === */

body {
  font-family: "Inter", sans-serif;
  background: transparent !important;
  min-height: 100vh;
  margin: 0;
  background: rgba(0,0,0,0.001);
}

@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* Layer 1 */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: linear-gradient(135deg, #6d5dfc, #46c2ff, #ff7eb3);
  background-size: 600% 600%;
  animation: dashboardWave1 16s ease-in-out infinite;
  z-index: -2;
}

/* Layer 2 (soft overlay, optional like index.html) */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at 20% 20%, rgba(255,255,255,0.15), transparent 60%);
  animation: dashboardWave2 12s ease-in-out infinite alternate;
  z-index: -1;
}

@keyframes dashboardWave1 {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position:   0% 50%; }
}

@keyframes dashboardWave2 {
  0%   { opacity: 0.4; }
  50%  { opacity: 0.8; }
  100% { opacity: 0.4; }
}

/* === Story Card Styles (preserved) === */
.story-card {
  transition: .2s;
  position: relative;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 1rem;
  color: #fff;
  overflow: hidden;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}
.story-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3);
}
.status-badge.completed { background-color: #28a745; }
.status-badge.processing { background-color: #ffc107; color: #000; }
.status-badge.failed { background-color: #dc3545; }

#loadingSpinner {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 50vh;
}
#loadingSpinner span { color: #fff !important; }

/* === NAVBAR === */
.glass-navbar {
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 3px 25px rgba(0, 0, 0, 0.15);
  height: 58px;
  transition: all 0.3s ease;
}

.navbar-brand {
  color: #fff !important;
  font-weight: 600;
  font-size: 1rem;
}
.logo-text small {
  opacity: 0.8;
  font-size: 0.85rem;
  font-weight: 400;
}

/* --- Search bar --- */
.search-form {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 50px;
  padding: 3px 10px;
    backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #fff;
  transition: all 0.3s ease;
  max-width: 180px;
}
.search-form:focus-within {
  background: rgba(255, 255, 255, 0.15) !important;
  border-color: rgba(255, 255, 255, 0.25) !important;
}
.search-input {
  background: transparent;
  border: none;
  outline: none;
  color: #fff;
  width: 100%;
  font-size: 0.85rem;
}
.search-input:focus {
  box-shadow: none !important;
  background: transparent !important;
}
.search-input::placeholder { color: rgba(255, 255, 255, 0.7); }

/* --- Credit badge --- */
.credit-glass {
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.25);
  padding: 4px 10px;
  border-radius: 50px;
  color: #fff;
  font-size: 0.85rem;
  font-weight: 500;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 4px;
    backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
#creditBadge i { color: darkgoldenrod; font-size: large; }

/* --- New Story Button --- */
.btn-new-story {
  background: linear-gradient(90deg, #7e6dfc, #46c2ff);
  border: none;
  color: #fff !important;
  font-weight: 500;
  padding: 6px 18px;
  border-radius: 50px;
  font-size: 0.9rem;
  box-shadow: 0 0 10px rgba(109, 93, 252, 0.3);
  transition: all 0.3s ease;
  min-height: 38px;
  align-content: center;
}
.btn-new-story:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 16px rgba(109, 93, 252, 0.5);
}

.btn-new-image {
  border: none;
  color: #fff !important;
  font-weight: 500;
  padding: 6px 18px;
  border-radius: 50px;
  font-size: 0.9rem;
  box-shadow: 0 0 10px rgba(109, 93, 252, 0.3);
  transition: all 0.3s ease;
  min-height: 38px;
  align-content: center;
}
.btn-new-image:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 16px rgba(109, 93, 252, 0.5);
}
/* --- Avatar Dropdown --- */
.glass-dropdown {
  background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 0.8rem;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
}
.glass-dropdown .dropdown-item {
  color: #2f4f4f !important;
  font-weight: 500;
}
.glass-dropdown .dropdown-item:hover {
  background: rgba(255, 255, 255, 0.25);
  color: #2f4f4f;
}
.dropdown-item {
  cursor: pointer;
  color: #2f4f4f !important;
  font-weight: 500;
}
.dropdown-item:hover {
  background: rgba(255, 255, 255, 0.25);
  color: #2f4f4f;
}
.dropdown-divider { border-color: rgba(255, 255, 255, 0.25); }
.user-profile-section{
  place-items: center !important;
    align-items: center !important;
}
#drawerEmail{
      width: 100%;
    text-align: center;
}
/* === MAIN AREA === */
main.container {
  margin-top: 115px;
  margin-bottom: 45px;
  max-width: 95%;
  background: rgba(255, 255, 255, 0.30);
    backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 1.5rem;
  padding: 2.5rem 2rem;
  color: #fff;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
  padding-top: 1rem !important;
}
.card-title { color: #2f4f4f !important; }
.card-body p { color: #2f4f4f !important; }

/* === Account Settings Modal === */
.glass-modal {
  background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 1rem;
  color: #2f4f4f;
}
.glass-modal h5 {
  color: #2f4f4f;
  font-weight: 600;
}
.glass-modal .btn-gradient {
  background: linear-gradient(90deg, #7e6dfc, #46c2ff);
  border: none;
  color: #fff;
  border-radius: 50px;
}

/* === Offcanvas Drawer === */
.offcanvas-glass {
  background: rgb(0, 0, 0, 0.7);
  /*backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px) !important;*/
  border: none;
  color: #fff;
}
.offcanvas-glass .offcanvas-header {
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}
.offcanvas-glass a, .offcanvas-glass button {
  color: #fff !important;
  text-decoration: none;
  font-weight: 500;
}
.offcanvas-glass a:hover, .offcanvas-glass button:hover { opacity: 0.85; }

/* === Mobile Responsiveness === */
@media (max-width: 992px) {
  .glass-navbar {
    height: auto;
    padding: 0.5rem 1rem;
  }
  .navbar-collapse {
    background: rgba(255, 255, 255, 0.1);
      backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
    border-radius: 0.8rem;
    margin-top: 0.5rem;
    padding: 0.8rem 1rem;
    text-align: center;
  }
  .navbar-nav {
    width: 100%;
    justify-content: center;
  }
  .search-form {
    max-width: 100%;
    margin-bottom: 0.8rem;
  }
  .btn-new-story,
  .credit-glass {
    width: 100%;
    justify-content: center;
    margin-bottom: 0.8rem;
  }
}


/* === Mobile Controls === */
.mobile-controls {
  margin-top: 0.5rem;
}
.mobile-controls .search-form {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 50px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  padding: 6px 12px;
    backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: #fff;
  font-size: 0.9rem;
}
.mobile-controls .search-input {
  background: transparent !important;
  border: none;
  color: #fff;
  width: 100%;
  outline: none;
}
.mobile-controls .search-input::placeholder {
  color: rgba(255, 255, 255, 0.7);
}
#mobileNewStoryBtn {
  font-size: 0.9rem;
  border-radius: 50px;
  box-shadow: 0 0 10px rgba(109, 93, 252, 0.3);
  transition: all 0.2s ease;
}
#mobileNewStoryBtn:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 16px rgba(109, 93, 252, 0.5);
}
/* === Mobile Search Input Fix === */
@media (max-width: 992px) {
  .mobile-controls .search-form {
    background: rgba(255, 255, 255, 0.65);
    border: 1px solid rgba(255, 255, 255, 0.4);
    color: #222;
  }

  .mobile-controls .search-input {
    color: #222 !important;
  }

  .mobile-controls .search-input::placeholder {
    color: rgba(0, 0, 0, 0.4) !important;
  }
}
.btn-outline-light:hover{
  color: #000 !important;
}

@media (max-width: 992px) {
  .navbar-brand {
    position: relative;
    text-align: center;
  }
  .navbar-toggler {
    z-index: 10;
  }
}

#profileAvatar:hover {
  opacity: 0.85;
  transition: 0.3s;
  box-shadow: 0 0 0 3px rgba(255,255,255,0.3);
  cursor: pointer;
}
#profileAvatar {
  margin-bottom: 1px !important;
}
#accountModal .text-white-50.small {
  color: rgba(0, 0, 0, 0.7) !important;
  font-size: 0.85rem;
  margin-top: -4px;
}
#mobileDrawer{
  z-index: 10000 !important;
}
#accountModal{
  z-index: 10001 !important;
}



/* Mobile credit badge in navbar */
.credit-mobile-badge {
  display: flex;
  align-items: center;
  justify-content: center;

  background: rgba(255,255,255,0.15);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);

  padding: 4px 10px;
  height: 32px;
  border-radius: 20px;

  font-size: 14px;
  font-weight: 600;
  color: #fff;

  margin-right: 10px;
}

.credit-mobile-badge i {
  margin-right: 4px;
  color: darkgoldenrod;
}


/* ==========================================================
   PREMIUM LOW CREDITS ALERT POPUP
========================================================== */

.low-credits-modal {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  background: rgba(0,0,0,0.55);
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.low-credits-modal.d-none {
  display: none;
}

.low-credits-content {
  background: rgba(255,255,255,0.12);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 22px;
  width: 90%;
  max-width: 420px;
  padding: 30px;
  text-align: center;
  color: #fff;
  font-size: 15px;
  position: relative;
  animation: popUpFade 0.35s ease-out;
}

@keyframes popUpFade {
  from { opacity: 0; transform: translateY(40px) scale(0.95); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.low-credits-icon {
  font-size: 48px;
  margin-bottom: 12px;
}

.low-credits-close {
  background: none;
  border: none;
  font-size: 28px;
  color: #fff;
  cursor: pointer;
  position: absolute;
  top: 12px;
  right: 16px;
}

.low-credits-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 20px;
}

.btn-gradient-alert {
  /*background: linear-gradient(41deg, #d6d6d6, #6f4bff);*/

  padding: 10px 30px;
  font-weight: 600;
  color: #fff !important;
  transition: var(--transition-medium);
  box-shadow: 0 0 20px rgba(109, 93, 252, 0.5);
  background: linear-gradient(90deg, #7e6dfc, #46c2ff);
    border: none;
    border-radius: 50px;
}


.btn-gradient-alert:hover {
  transform: translateY(-4px);
  box-shadow: 0 0 30px rgba(109, 93, 252, 0.8);
}


/* ============================
   ONBOARDING FULLSCREEN POPUP
============================= */

/* =======================================
    Elegant Onboarding Popup
======================================= */

.onboard-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 10001;
  display: flex;
  align-items: center;
  justify-content: center;
}

.onboard-box {
  background: rgba(255,255,255,0.14);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 18px;
  padding: 35px 30px;
  width: 90%;
  max-width: 420px;
  color: #fff;
  text-align: center;
  animation: fadeIn 0.3s ease;
  position: relative;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

.on-title {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.on-desc {
  font-size: 0.95rem;
  opacity: 0.9;
  margin-bottom: 20px;
}

.on-options {
  text-align: left;
  margin-bottom: 20px;
}

.on-option {
  display: block;
  padding: 10px 12px;
  margin-bottom: 10px;
  background: rgba(255,255,255,0.12);
  border-radius: 12px;
  cursor: pointer;
  border: 1px solid rgba(255,255,255,0.25);
  font-size: 0.9rem;
}
.on-option:hover {
  background: rgba(255,255,255,0.20);
}

.on-option input {
  margin-right: 10px;
}

.on-btn-primary {
  background: linear-gradient(90deg, #7e6dfc, #46c2ff);
  border: none;
  padding: 10px 25px;
  border-radius: 50px;
  color: #fff;
  width: 100%;
  font-weight: 600;
  font-size: 0.95rem;
  transition: 0.3s;
}

.on-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 15px rgba(109,93,252,0.5);
}

.onboard-skip-btn {
  background: none;
  border: none;
  color: #fff;
  opacity: 0.7;
  font-size: 0.85rem;
  position: absolute;
  top: 12px;
  right: 18px;
}
.onboard-skip-btn:hover { opacity: 1; }


.onboard-sub {
  font-size: 1rem;
  margin-bottom: 25px;
  opacity: 0.9;
}


.explore-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 12px 12px 14px 12px;  
  background: linear-gradient(to top, rgba(0,0,0,0.85), rgba(0,0,0,0));
  color: #fff;
}

.explore-overlay h4 {
  font-size: 14px;
  margin: 0;
  font-weight: 600;
}

.explore-overlay p {
  font-size: 10px;
  margin: 0;
  opacity: 0.8;
}

.explore-overlay span {
  font-size: 10px;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 4px;
}


/* ==========================================================
   SKELETON LOADING FOR STORY CARDS
========================================================== */

.skeleton-card {
  background: rgba(255,255,255,0.15);
  border-radius: 1rem;
  overflow: hidden;
  position: relative;
  height: 330px;
}

.skeleton-thumb {
  height: 65%;
  background: linear-gradient(
    90deg,
    rgba(255,255,255,0.05) 0%,
    rgba(255,255,255,0.15) 50%,
    rgba(255,255,255,0.05) 100%
  );
  background-size: 200% 100%;
  animation: shimmer 1.3s infinite;
}

.skeleton-text {
  height: 12px;
  margin: 10px 12px;
  border-radius: 6px;
  background: rgba(255,255,255,0.14);
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}


.story-card.hidden-card {
  opacity: 0;
  transition: opacity 0.4s ease;
}

.story-card.visible-card {
  opacity: 1;
}

#creditBadge{
  cursor: pointer;
}