/* ============================================================
   Khyalai Storybook — Whimsical Arabic Children's Book Styles
   ============================================================ */

/* --- Google Fonts --- */
@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@400;500;700;800;900&family=Amiri:ital,wght@0,400;0,700;1,400&display=swap');

/* --- Design Tokens --- */
:root {
  /* Base Pastels */
  --sb-cream: #FFF8F0;
  --sb-cream-dark: #F5EDE3;
  --sb-light-blue: #E8F4FD;
  --sb-light-green: #E8F5E9;
  --sb-lavender-base: #F3E5F5;
  /* Renamed to avoid conflict */
  --sb-peach: #FFF3E0;

  /* Accent Colors (Restored/Updated for Light Theme) */
  --sb-coral: #FF7043;
  /* Updated */
  --sb-sky: #64B5F6;
  --sb-golden: #FFD54F;
  --sb-mint: #4DB6AC;
  /* Updated */
  --sb-lavender: #9575CD;
  /* New accent lavender */

  /* Text Colors */
  --sb-text-primary: #3E2723;
  --sb-text-body: #5D4037;
  /* Updated */
  --sb-text-muted: #8D6E63;

  /* Shadows & Borders */
  --sb-shadow-soft: 0 4px 20px rgba(62, 39, 35, 0.08);
  --sb-shadow-card: 0 8px 32px rgba(62, 39, 35, 0.10);
  --sb-shadow-image: 0 6px 24px rgba(62, 39, 35, 0.12);
  --sb-border-radius: 20px;

  /* Typography */
  --sb-font-heading: 'Tajawal', 'Outfit', sans-serif;
  /* Kept new fonts */
  --sb-font-body: 'Tajawal', sans-serif;
  /* Kept new fonts */

  /* Spacing */
  --sb-page-padding: clamp(1rem, 5vw, 4rem);

  /* Dark mode specific variables removed */
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  /* Removed dark-bg from html */
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body.storybook-body {
  direction: rtl;
  text-align: right;
  font-family: var(--sb-font-body);
  color: var(--sb-text-body);
  /* Changed to body text color */
  background:
    radial-gradient(ellipse at 20% 0%, rgba(206, 147, 216, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 100%, rgba(100, 181, 246, 0.08) 0%, transparent 50%),
    linear-gradient(180deg, #FFF8F0 0%, #FEFCF9 40%, #F5F0EB 100%);
  /* Restored light gradient */
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.sb-navbar {
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.sb-hero-premium {
  background: radial-gradient(circle at 70% 30%, rgba(99, 102, 241, 0.15), transparent 60%);
  border-radius: 40px;
  padding: clamp(3rem, 10vw, 8rem) 2rem;
}

.sb-hero-title-premium {
  color: white !important;
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.sb-hero-desc-premium {
  color: var(--sb-text-silver) !important;
  opacity: 0.8;
}

.sb-card {
  background: var(--sb-dark-card);
  border: 1px solid rgba(255, 255, 255, 0.05);
  color: white;
}

.sb-feature-card {
  background: var(--sb-dark-card) !important;
  border-color: rgba(255, 255, 255, 0.05) !important;
  color: white !important;
}

.sb-feature-title {
  color: white !important;
}

.sb-story-card {
  background: var(--sb-dark-card) !important;
  border-color: rgba(255, 255, 255, 0.05) !important;
}

.sb-story-title {
  color: white !important;
}

/* --- Storybook Wrapper --- */
.storybook-wrapper {
  max-width: 1100px;
  margin: 0 auto;
  padding: var(--sb-page-padding);
  animation: sb-fadeIn 0.8s ease-out;
}

/* --- Header / Title Section --- */
.storybook-header {
  text-align: center;
  padding: 2.5rem 1.5rem 2rem;
  margin-bottom: 2rem;
  position: relative;
}

.storybook-header::before,
.storybook-header::after {
  content: '✦';
  position: absolute;
  top: 0.5rem;
  font-size: 1.5rem;
  color: var(--sb-golden);
  animation: sb-twinkle 2.5s ease-in-out infinite;
}

.storybook-header::before {
  right: 10%;
  animation-delay: 0s;
}

.storybook-header::after {
  left: 10%;
  animation-delay: 1.2s;
}

.storybook-title {
  font-family: var(--sb-font-heading);
  font-weight: 900;
  font-size: clamp(1.8rem, 5vw, 3rem);
  line-height: 1.4;
  margin-bottom: 0.5rem;
  display: inline-block;
  background: linear-gradient(135deg, #FF6B8A 0%, #E040A0 25%, #AB47BC 50%, #42A5F5 75%, #26C6DA 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: #FF6B8A;
  /* Fallback for very old browsers */
}

.storybook-subtitle {
  font-family: var(--sb-font-heading);
  font-weight: 500;
  font-size: clamp(1rem, 2.5vw, 1.3rem);
  color: var(--sb-text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.storybook-subtitle .emoji-icon {
  font-size: 1.4em;
}

/* --- Storybook Page Container (the "book page") --- */
.storybook-page {
  background: #FFFFFF;
  border-radius: var(--sb-border-radius);
  box-shadow: var(--sb-shadow-card);
  padding: 0 !important;
  /* Force zero padding for full-bleed look */
  margin-bottom: 3rem;
  border: 1px solid rgba(62, 39, 35, 0.04);
  position: relative;
  overflow: hidden;
}

/* Decorative corner flourishes */
.storybook-page::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 80px;
  height: 80px;
  background: radial-gradient(circle at top right, rgba(255, 213, 79, 0.15), transparent 70%);
  pointer-events: none;
}

.storybook-page::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 80px;
  height: 80px;
  background: radial-gradient(circle at bottom left, rgba(100, 181, 246, 0.12), transparent 70%);
  pointer-events: none;
}

/* --- Story Section (one "page" of the story) --- */
.story-section {
  padding: 1.5rem 0;
}

.story-section+.story-section {
  border-top: 2px dashed rgba(62, 39, 35, 0.06);
}

/* Two-column grid: text on right (RTL natural), image on left */
.story-section-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(1.5rem, 3vw, 2.5rem);
  align-items: start;
}

/* --- Page Number Badge --- */
.page-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  font-family: var(--sb-font-heading);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--sb-sky);
  background: var(--sb-light-blue);
  padding: 0.35rem 1rem;
  border-radius: 50px;
  margin-bottom: 1rem;
}

/* --- Story Illustration (Cartoonized Photo) --- */
/* Image is first in HTML source. On desktop RTL grid, we reorder. */
.story-illustration-wrapper {
  order: 2;
  /* In RTL grid, order 2 places it on the left */
  position: relative;
}

.story-illustration {
  width: 100%;
  height: auto;
  border-radius: 16px;
  box-shadow: var(--sb-shadow-image);
  border: 4px solid var(--sb-cream);
  display: block;
  transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94), box-shadow 0.4s ease;
  aspect-ratio: 4/3;
  object-fit: cover;
}

.story-illustration:hover {
  transform: translateY(-4px) scale(1.01);
  box-shadow: 0 12px 40px rgba(62, 39, 35, 0.16);
}

/* Decorative frame accent */
.story-illustration-wrapper::after {
  content: '';
  position: absolute;
  inset: -6px;
  border-radius: 20px;
  border: 2px dashed rgba(255, 213, 79, 0.3);
  pointer-events: none;
}

/* --- Story Text Column --- */
.story-text-wrapper {
  order: 1;
  /* In RTL grid, order 1 places it on the right */
}

.story-text {
  font-family: var(--sb-font-body);
  font-size: clamp(1.15rem, 2vw, 1.35rem);
  line-height: 2.1;
  color: var(--sb-text-body);
  text-indent: 1.5rem;
}

.story-text p {
  margin-bottom: 1.2rem;
}

.story-text p:last-child {
  margin-bottom: 0;
}

/* --- Page Divider (between story sections) --- */
.page-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 1rem 0;
  color: var(--sb-golden);
  font-size: 1.2rem;
  opacity: 0.6;
}

.page-divider::before,
.page-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 213, 79, 0.4), transparent);
}

/* --- Character Banner (photo + child name at top) --- */
.character-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 2rem;
  padding: 1.2rem 2rem;
  background: linear-gradient(135deg, var(--sb-peach), var(--sb-light-blue));
  border-radius: 50px;
}

.character-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid white;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.character-name {
  font-family: var(--sb-font-heading);
  font-weight: 800;
  font-size: 1.2rem;
  color: var(--sb-text-primary);
}

/* --- Footer --- */
.storybook-footer {
  text-align: center;
  padding: 2rem 1rem 1rem;
  margin-top: 1rem;
}

.storybook-footer-brand {
  font-family: var(--sb-font-heading);
  font-weight: 700;
  font-size: 1rem;
  color: var(--sb-text-muted);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  opacity: 0.7;
  transition: opacity 0.3s ease;
}

.storybook-footer-brand:hover {
  opacity: 1;
}

.storybook-footer-brand .brand-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--sb-golden);
  display: inline-block;
}

.storybook-footer-tagline {
  font-family: var(--sb-font-heading);
  font-size: 0.85rem;
  color: var(--sb-text-muted);
  opacity: 0.5;
  margin-top: 0.4rem;
}

/* --- Animations --- */
@keyframes sb-fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

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

@keyframes sb-twinkle {

  0%,
  100% {
    opacity: 0.4;
    transform: scale(0.9);
  }

  50% {
    opacity: 1;
    transform: scale(1.1);
  }
}

/* Stagger animation for story sections */
.story-section {
  opacity: 0;
  animation: sb-fadeIn 0.6s ease-out forwards;
}

.story-section:nth-child(1) {
  animation-delay: 0.2s;
}

.story-section:nth-child(2) {
  animation-delay: 0.4s;
}

.story-section:nth-child(3) {
  animation-delay: 0.6s;
}

.story-section:nth-child(4) {
  animation-delay: 0.8s;
}

.story-section:nth-child(5) {
  animation-delay: 1.0s;
}

/* --- Responsive Design --- */
@media (max-width: 768px) {
  .story-section-content {
    grid-template-columns: 1fr;
    gap: 1.2rem;
  }

  /* Source order naturally gives us image first, text second on mobile */
  .story-illustration-wrapper {
    order: 0;
  }

  .story-text-wrapper {
    order: 0;
  }

  .storybook-header::before,
  .storybook-header::after {
    display: none;
  }

  .character-banner {
    padding: 0.8rem 1.2rem;
    border-radius: 16px;
  }

  .character-avatar {
    width: 44px;
    height: 44px;
  }

  .storybook-page {
    padding: 0;
    border-radius: 16px;
    overflow: hidden;
  }

  .story-illustration-wrapper::after {
    display: none;
  }

  .story-text {
    text-indent: 1rem;
    line-height: 2;
  }
}

/* --- UI Utilities for Main Pages --- */

/* Whimsical Card */
.sb-card {
  background: #FFFFFF;
  border-radius: var(--sb-border-radius);
  box-shadow: var(--sb-shadow-card);
  padding: 2.5rem;
  width: 100%;
  max-width: 500px;
  margin: 2rem auto;
  border: 1px solid rgba(62, 39, 35, 0.04);
  position: relative;
  overflow: hidden;
  animation: sb-fadeIn 0.6s ease-out;
}

/* Form Styles */
.sb-form-group {
  margin-bottom: 1.5rem;
  text-align: right;
}

.sb-label {
  display: block;
  font-family: var(--sb-font-heading);
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--sb-text-primary);
  font-size: 1rem;
}

.sb-input,
.sb-select {
  width: 100%;
  padding: 1rem;
  border-radius: 12px;
  border: 2px solid var(--sb-cream-dark);
  font-family: var(--sb-font-heading);
  font-size: 1rem;
  background: var(--sb-cream);
  color: var(--sb-text-body);
  transition: all 0.3s ease;
  outline: none;
}

.sb-input:focus,
.sb-select:focus {
  border-color: var(--sb-sky);
  background: white;
  box-shadow: 0 0 0 4px rgba(100, 181, 246, 0.15);
}

/* Buttons */
.sb-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 1rem 2rem;
  border-radius: 50px;
  font-family: var(--sb-font-heading);
  font-weight: 800;
  font-size: 1.1rem;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  border: none;
  width: 100%;
  text-decoration: none;
}

.sb-button-primary {
  background: linear-gradient(135deg, var(--sb-sky), #42A5F5);
  color: white;
  box-shadow: 0 4px 15px rgba(100, 181, 246, 0.4);
}

.sb-button-primary:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 8px 25px rgba(100, 181, 246, 0.5);
}

.sb-button-secondary {
  background: var(--sb-peach);
  color: var(--sb-text-primary);
  border: 2px solid var(--sb-golden);
}

.sb-button-secondary:hover {
  background: var(--sb-golden);
  transform: translateY(-2px);
}

/* Error Message */
.sb-error {
  background: #FFEBEE;
  color: #D32F2F;
  padding: 1rem;
  border-radius: 12px;
  margin-bottom: 1.5rem;
  font-family: var(--sb-font-heading);
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border: 1px solid rgba(211, 47, 47, 0.1);
  animation: sb-shake 0.5s cubic-bezier(.36, .07, .19, .97) both;
}

/* Status / Loading */
.sb-status {
  padding: 1rem;
  border-radius: 12px;
  margin-top: 1.5rem;
  font-family: var(--sb-font-heading);
  font-weight: 700;
  text-align: center;
  background: var(--sb-light-blue);
  color: var(--sb-sky);
  border: 1px dashed var(--sb-sky);
}

.sb-loading-spinner {
  width: 24px;
  height: 24px;
  border: 3px solid rgba(100, 181, 246, 0.2);
  border-top-color: var(--sb-sky);
  border-radius: 50%;
  animation: sb-spin 1s linear infinite;
  display: inline-block;
  margin-left: 0.5rem;
}

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

@keyframes sb-shake {

  10%,
  90% {
    transform: translate3d(-1px, 0, 0);
  }

  20%,
  80% {
    transform: translate3d(2px, 0, 0);
  }

  30%,
  50%,
  70% {
    transform: translate3d(-4px, 0, 0);
  }

  40%,
  60% {
    transform: translate3d(4px, 0, 0);
  }
}

@media (max-width: 480px) {
  :root {
    --sb-page-padding: 1rem;
  }

  .storybook-title {
    font-size: 1.6rem;
  }

  .sb-card {
    padding: 1.5rem;
    margin: 1rem auto;
  }

  .sb-button {
    padding: 0.8rem 1.5rem;
  }
}

/* --- Navigation --- */
.sb-navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 0;
  margin-bottom: 2rem;
}

.sb-nav-logo {
  font-family: var(--sb-font-heading);
  font-weight: 900;
  font-size: 1.5rem;
  color: var(--sb-text-primary);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.sb-nav-links {
  display: flex;
  gap: 1.5rem;
  align-items: center;
}

.sb-nav-link {
  text-decoration: none;
  color: var(--sb-text-primary);
  font-family: var(--sb-font-heading);
  font-weight: 700;
  transition: color 0.3s ease;
}

.sb-nav-link:hover {
  color: var(--sb-sky);
}

.sb-nav-btn {
  padding: 0.6rem 1.4rem;
  border-radius: 50px;
  font-size: 0.95rem;
}

/* --- Hero Section --- */
.sb-hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
  padding: 3rem 0;
  margin-bottom: 4rem;
}

.sb-hero-content {
  text-align: right;
}

.sb-hero-title {
  font-family: var(--sb-font-heading);
  font-weight: 900;
  font-size: clamp(2.5rem, 6vw, 4rem);
  line-height: 1.2;
  margin-bottom: 1.5rem;
  color: var(--sb-text-primary);
}

.sb-hero-desc {
  font-size: 1.25rem;
  line-height: 1.6;
  color: var(--sb-text-body);
  margin-bottom: 2.5rem;
}

.sb-hero-image-wrapper {
  position: relative;
}

.sb-hero-image {
  width: 100%;
  border-radius: 30px;
  box-shadow: var(--sb-shadow-card);
  transform: rotate(2deg);
  transition: transform 0.5s ease;
}

.sb-hero-image:hover {
  transform: rotate(0deg) scale(1.02);
}

/* --- About Section --- */
.sb-about {
  padding: 4rem 0;
  text-align: center;
  max-width: 800px;
  margin: 0 auto 4rem;
}

.sb-section-title {
  font-family: var(--sb-font-heading);
  font-weight: 900;
  font-size: 2.5rem;
  margin-bottom: 1.5rem;
  color: var(--sb-text-primary);
}

.sb-about-text {
  font-size: 1.2rem;
  line-height: 1.8;
  color: var(--sb-text-body);
}

/* --- Dashboard Styles --- */
.sb-dashboard-header {
  text-align: center;
  margin: 0 auto 3.5rem;
  padding: 3rem 2rem;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.4), rgba(255, 255, 255, 0.1));
  backdrop-filter: blur(10px);
  border-radius: 30px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 8px 32px rgba(62, 39, 35, 0.05);
  max-width: 900px;
}

.sb-dashboard-header .storybook-title {
  margin: 0 0 1rem;
  padding: 0;
  font-size: clamp(2rem, 4vw, 2.8rem);
}

.sb-dashboard-header .storybook-subtitle {
  margin-bottom: 2rem;
}

.sb-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 0 auto 2rem;
  padding: 0 1rem;
  max-width: 1100px;
}

.sb-section-title-small {
  font-family: var(--sb-font-heading);
  font-weight: 800;
  font-size: 1.5rem;
  color: var(--sb-text-primary);
}

.sb-stories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 2rem;
  margin: 0 auto 4rem;
  max-width: 1100px;
}

.sb-story-card {
  background: white;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: var(--sb-shadow-soft);
  transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
  border: 1px solid rgba(0, 0, 0, 0.03);
  display: flex;
  flex-direction: column;
}

.sb-story-card:hover {
  transform: translateY(-10px);
  box-shadow: var(--sb-shadow-card);
}

.sb-story-thumb-wrapper {
  position: relative;
  aspect-ratio: 1/1;
  overflow: hidden;
  background: var(--sb-cream);
}

.sb-story-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}

.sb-story-card:hover .sb-story-thumb {
  transform: scale(1.05);
}

.sb-story-content {
  padding: 1.5rem;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  text-align: right;
}

.sb-story-title {
  font-family: var(--sb-font-heading);
  font-weight: 800;
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
  color: var(--sb-text-primary);
}

.sb-story-meta {
  font-size: 0.95rem;
  color: var(--sb-text-muted);
  margin-bottom: 1.5rem;
}

/* Empty State Card */
.sb-empty-card {
  grid-column: 1 / -1;
  text-align: center;
  padding: 5rem 2rem;
  background: rgba(255, 255, 255, 0.5);
  border: 2px dashed rgba(62, 39, 35, 0.1);
  border-radius: 30px;
  max-width: 600px;
  margin: 0 auto;
}

.sb-empty-icon {
  font-size: 4rem;
  margin-bottom: 1.5rem;
  display: block;
}

.sb-empty-text {
  font-size: 1.3rem;
  color: var(--sb-text-muted);
  font-family: var(--sb-font-heading);
  margin-bottom: 2rem;
}

.sb-toggle-container {
  text-align: center;
  margin-bottom: 3rem;
}

@media (max-width: 768px) {
  .sb-hero {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 2rem;
  }

  .sb-hero-content {
    text-align: center;
  }

  .sb-about {
    padding: 2rem 0;
  }

  .sb-dashboard-header {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }
}

/* --- Premium Full-Page Layout --- */
.story-full-container {
  position: relative;
  width: 100%;
  border-radius: 24px;
  overflow: hidden;
  margin-bottom: 3rem;
  box-shadow: var(--sb-shadow-card);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.story-full-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.story-text-card {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  padding: 1.5rem 2.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.3);
  text-align: center;
}

@keyframes sb-slideUp {
  from {
    transform: translateY(30px);
    opacity: 0;
  }

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

.story-text-card p {
  font-family: var(--sb-font-body);
  font-size: clamp(1.3rem, 2.7vw, 1.7rem);
  line-height: 1.8;
  color: #1a1a1a;
  /* Darker for contrast */
  margin: 0;
}

.story-full-container .page-number-badge {
  position: absolute;
  top: 20px;
  right: 20px;
  background: rgba(255, 255, 255, 0.9);
  padding: 0.5rem 1rem;
  border-radius: 50px;
  font-family: var(--sb-font-heading);
  font-weight: 800;
  font-size: 0.9rem;
  color: var(--sb-sky);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

@media (max-width: 480px) {
  .story-text-card {
    bottom: 15px;
    left: 15px;
    right: 15px;
    padding: 1.2rem;
  }
}


/* --- Print Styles --- */
@media print {
  body.storybook-body {
    background: white;
  }

  .storybook-page {
    box-shadow: none;
    border: 1px solid #ddd;
    page-break-inside: avoid;
  }

  .story-section {
    opacity: 1;
    animation: none;
    page-break-inside: avoid;
  }

  .story-illustration:hover {
    transform: none;
    box-shadow: var(--sb-shadow-image);
  }

  .storybook-footer {
    page-break-before: always;
  }
}

/* --- Landing Page Premium Styles --- */

.sb-nav-floating {
  position: sticky;
  top: 20px;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 50px;
  padding: 0.8rem 2rem;
  margin: 0 auto 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.05);
  max-width: 1000px;
}

.sb-hero-premium {
  padding: 4rem 0 6rem;
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 4rem;
  align-items: center;
  position: relative;
}

.sb-hero-premium::before {
  content: '';
  position: absolute;
  top: -100px;
  left: -100px;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(100, 181, 246, 0.15), transparent 70%);
  z-index: -1;
  filter: blur(40px);
}

.sb-hero-badge {
  display: inline-block;
  background: var(--sb-light-blue);
  color: var(--sb-sky);
  padding: 0.5rem 1.2rem;
  border-radius: 50px;
  font-family: var(--sb-font-heading);
  font-weight: 800;
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
  border: 1px solid rgba(100, 181, 246, 0.2);
}

.sb-hero-title-premium {
  font-family: var(--sb-font-heading);
  font-weight: 900;
  font-size: clamp(3rem, 8vw, 4.5rem);
  line-height: 1.1;
  margin-bottom: 1.5rem;
  color: var(--sb-text-primary);
}

.sb-hero-desc-premium {
  font-size: 1.2rem;
  line-height: 1.8;
  color: var(--sb-text-body);
  margin-bottom: 3rem;
  max-width: 600px;
}

.sb-hero-visual {
  position: relative;
  perspective: 1000px;
}

.sb-hero-img-premium {
  width: 100%;
  border-radius: 40px;
  box-shadow: 0 40px 80px rgba(0, 0, 0, 0.08);
  transition: transform 0.8s cubic-bezier(0.19, 1, 0.22, 1);
  animation: sb-float 6s ease-in-out infinite;
}

.sb-hero-visual:hover .sb-hero-img-premium {
  transform: translateY(-10px) rotateY(-5deg);
}

@keyframes sb-float {

  0%,
  100% {
    transform: translateY(0) rotateY(-15deg) rotateX(10deg);
  }

  50% {
    transform: translateY(-20px) rotateY(-15deg) rotateX(10deg);
  }
}

/* Stunning Glassmorphism Feature Cards */
.sb-feature-card {
  background: rgba(30, 41, 59, 0.7) !important;
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-radius: 32px !important;
  padding: 4rem 2rem !important;
  transition: all 0.5s cubic-bezier(0.19, 1, 0.22, 1);
}

.sb-feature-card:hover {
  background: white !important;
  transform: translateY(-10px);
  border-color: var(--sb-sky) !important;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.05);
}

/* Feature Step Cards */
.sb-features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2.5rem;
  margin-bottom: 6rem;
}

.sb-feature-card {
  background: white;
  padding: 3rem 2rem;
  border-radius: 30px;
  text-align: center;
  transition: all 0.4s ease;
  border: 1px solid rgba(0, 0, 0, 0.03);
  box-shadow: var(--sb-shadow-soft);
  position: relative;
}

.sb-feature-card:hover {
  transform: translateY(-10px);
  box-shadow: var(--sb-shadow-card);
  border-color: var(--sb-sky);
}

.sb-feature-icon {
  font-size: 3rem;
  margin-bottom: 1.5rem;
  display: block;
}

.sb-feature-title {
  font-family: var(--sb-font-heading);
  font-weight: 800;
  font-size: 1.5rem;
  margin-bottom: 1rem;
  color: var(--sb-text-primary);
}

/* Modern Footer Premium */
.sb-footer-premium {
  background: white;
  padding: 4rem 2rem 2rem;
  border-radius: 40px 40px 0 0;
  margin-top: 4rem;
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.03);
}

.footer-content {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 4rem;
  max-width: 1000px;
  margin: 0 auto 3rem;
  text-align: right;
}

.footer-brand h2 {
  font-family: var(--sb-font-heading);
  font-weight: 900;
  font-size: 2rem;
  margin-bottom: 1rem;
  color: var(--sb-text-primary);
}

.footer-links h4 {
  font-family: var(--sb-font-heading);
  font-weight: 800;
  margin-bottom: 1.5rem;
  color: var(--sb-text-primary);
}

.footer-links ul {
  list-style: none;
}

.footer-links li {
  margin-bottom: 0.8rem;
}

.footer-links a {
  text-decoration: none;
  color: var(--sb-text-muted);
  transition: color 0.3s ease;
}

.footer-links a:hover {
  color: var(--sb-sky);
}

@media (max-width: 900px) {
  .sb-hero-premium {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .sb-hero-desc-premium {
    margin-left: auto;
    margin-right: auto;
  }

  .sb-features-grid {
    grid-template-columns: 1fr;
  }

  .footer-content {
    grid-template-columns: 1fr;
    text-align: center;
  }
}