/* --- 1. Root Variables --- */
:root {
  --color-bg-primary: #121212;
  --color-bg-secondary: #0d0d0d;
  --color-bg-tertiary: #2a2a2a;
  --color-text-primary: #e0e0e0;
  --color-text-secondary: #ccc;
  --color-text-muted: #999;
  --color-text-dark: #111;
  --color-brand: #f7c257; /* main gold */
  --color-brand-hover: #e6b84a;
  --color-border: #2a2a2a;
  --color-border-focus: #f7c257;
  --color-link-amazon: #FF9900;
  --color-link-google: #4285F4;
  --color-link-apple: #A3A3A3;
  --font-primary: 'Montserrat', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 12px;
  --shadow-sm: 0 4px 10px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 12px 25px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 12px 30px rgba(0, 0, 0, 0.4);
  --transition-fast: all 0.2s ease-in-out;
  --transition-med: all 0.3s ease-in-out;
}

/* --- 2. Global Reset & Base --- */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-primary);
  background-color: var(--color-bg-primary);
  color: var(--color-text-primary);
  line-height: 1.6;
}

img {
  width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--color-brand);
  text-decoration: none;
  transition: var(--transition-fast);
}

a:hover {
  text-decoration: underline;
  color: var(--color-brand-hover);
}

/* --- 3. Typography --- */
h1, h2, h3 {
  color: var(--color-brand);
  word-wrap: break-word;
  line-height: 1.3;
}

h1 { font-size: 2.3rem; }
h2 { font-size: 1.4rem; }
h3 { font-size: 1rem; }

.library-intro {
  max-width: 750px;
  margin: 10px auto 30px;
  font-size: 1.05rem;
  color: var(--color-text-secondary);
}

.book-description {
  font-size: 1rem;
  line-height: 1.6;
  color: var(--color-text-secondary);
  white-space: pre-wrap; /* Preserves line breaks */
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.book-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--color-text-secondary);
  margin: 12px 0;
}

/* --- 4. Layout & Containers --- */

/* Header & Footer */
.site-header {
  background: var(--color-bg-secondary);
  padding: 14px 30px;
  border-bottom: 1px solid var(--color-border);
  box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1200px;
  margin: 0 auto;
  gap: 20px; /* Added from a later rule */
}

.site-footer {
  text-align: center;
  margin-top: 40px;
  padding: 20px;
  font-size: 0.85rem;
  color: var(--color-text-muted);
  border-top: 1px solid var(--color-border);
}

.site-footer a {
  color: var(--color-text-muted);
  font-weight: 500;
}

.site-footer a:hover {
  color: var(--color-brand);
}

/* Page Containers */
.library-container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 30px 20px;
  text-align: center;
  animation: fadeIn 0.5s ease-out;
}

.library-container h1 {
  margin-bottom: 20px;
}

.library-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 24px;
  width: 100%;
  perspective: 1500px; /* From later definition */
}

.detail-container {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 40px;
  max-width: 1000px;
  margin: 30px auto;
  padding: 20px;
  animation: fadeIn 0.5s ease-out; /* Page fade-in */
}

/* Generic content page */
.page-container {
  max-width: 900px;
  margin: 60px auto;
  padding: 40px;
  background-color: #1e1e1e;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
  line-height: 1.8;
}
.page-container h1 {
  color: #f7c257;
  font-size: 2.3rem;
  border-bottom: 2px solid #f7c257;
  padding-bottom: 10px;
  margin-bottom: 25px;
}
.page-container h2 {
  color: #ffd47a;
  font-size: 1.4rem;
  margin-top: 2rem;
  margin-bottom: 0.5rem;
}
.page-container p {
  color: #e0e0e0;
  font-size: 1rem;
  margin-bottom: 1rem;
}
.page-container a {
  color: #f7c257;
  text-decoration: none;
}
.page-container a:hover {
  text-decoration: underline;
}

/* 404 Page */
.not-found {
  text-align: center;
  padding: 40px 20px;
  animation: fadeIn 0.5s ease-out;
}

.not-found h1 {
  font-size: 3rem;
}

.not-found p {
  font-size: 1.2rem;
  color: var(--color-text-muted);
  margin-top: 10px;
}

.not-found a {
  display: inline-block;
  margin-top: 30px;
  background: var(--color-brand);
  color: var(--color-bg-primary);
  padding: 12px 20px;
  border-radius: var(--radius-md);
  text-decoration: none;
  font-weight: 600;
  transition: var(--transition-fast);
}

.not-found a:hover {
  transform: scale(1.05);
  background-color: var(--color-brand-hover);
}


/* --- 5. Components --- */

/* Logo */
.logo {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
  color: var(--color-brand);
}

.logo-img {
  height: 42px;
  width: auto;
  transition: transform 0.3s ease;
}

.logo-img:hover {
  transform: scale(1.05);
}

.logo-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.logo-text h2 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-brand);
  line-height: 1.2;
}

.logo-text h2 span {
  color: var(--color-brand-hover);
}

.logo-text p {
  margin: 3px 0 0 0;
  font-size: 0.9rem;
  color: var(--color-text-secondary);
  letter-spacing: 0.3px;
}

/* Breadcrumbs */
.breadcrumbs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 0.95rem;
  color: #bbb;
  margin: 25px 0 10px 0;
  letter-spacing: 0.3px;
}

.breadcrumbs a {
  color: var(--color-brand);
}

.breadcrumbs a:hover {
  color: var(--color-brand-hover);
}

.breadcrumbs i {
  font-size: 0.8rem;
  color: #777;
}

.breadcrumbs span {
  color: var(--color-text-primary);
  font-weight: 500;
}

/* Search Bar */
.search-container {
  margin-bottom: 30px;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

#book-search {
  width: 100%;
  padding: 14px 20px;
  font-size: 1rem;
  background-color: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text-primary);
  font-family: var(--font-primary);
  transition: var(--transition-fast);
  outline: none;
}

#book-search:focus {
  border-color: var(--color-border-focus);
  box-shadow: 0 0 15px rgba(247, 194, 87, 0.2);
}

#book-search::placeholder {
  color: #777;
}

#no-results {
  display: none;
  font-size: 1.2rem;
  color: var(--color-text-muted);
  margin-top: 40px;
}

/* Book Card */
.book-card {
  display: flex;
  flex-direction: column;
  background: var(--color-bg-secondary);
  border-radius: var(--radius-md);
  overflow: hidden;
  text-decoration: none;
  transition: transform 0.8s ease, opacity 0.8s ease;
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
  opacity: 0;
  transform: translateY(50px) scale(0.98);
  will-change: transform, opacity;
}

/* When the card becomes visible */
.book-card.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* Subtle hover lift */
.book-card:hover {
  transform: translateY(-6px) scale(1.03);
  box-shadow: 0 12px 25px rgba(0,0,0,0.35);
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Stagger the card animation */
.book-card:nth-child(1) { animation-delay: 0.05s; }
.book-card:nth-child(2) { animation-delay: 0.1s; }
.book-card:nth-child(3) { animation-delay: 0.15s; }
.book-card:nth-child(4) { animation-delay: 0.2s; }
.book-card:nth-child(5) { animation-delay: 0.25s; }
.book-card:nth-child(6) { animation-delay: 0.3s; }

/*
  NOTE: The following 'book-card img' rules OVERRIDE the 3D 'rotateY'
  styles that appeared earlier in your original file.
  This refactor preserves the final, cascaded logic.
*/
.book-card img {
  aspect-ratio: 2 / 3;
  object-fit: cover;
  background: var(--color-bg-tertiary);
  border-bottom: 1px solid var(--color-border);
  transition: transform 1s cubic-bezier(0.19, 1, 0.22, 1), box-shadow 0.5s ease;
}

.book-card:hover img {
  transform: scale(1.05) rotateY(2deg);
  box-shadow: 0 12px 30px rgba(0,0,0,0.3);
}

.book-card h3 {
  font-size: 0.95rem;
  font-weight: 600;
  padding: 12px;
  text-align: left;
  line-height: 1.4;
  flex-grow: 1; /* Ensures text block fills space */
  color: var(--color-text-primary);
}

/* Detail Page Components */
.detail-cover {
  text-align: center;
}

.detail-cover img {
  width: 100%;
  max-width: 350px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}

.detail-info h1 {
  font-size: 2.2rem;
  margin-top: 5px;
  margin-bottom: 20px;
}

.detail-info h2 {
  font-size: 1.2rem;
  border-bottom: 1px solid #444;
  padding-bottom: 8px;
  margin-top: 30px;
  margin-bottom: 15px;
}

.back-link {
  display: inline-block;
  color: #aaa;
  font-size: 0.9rem;
  margin-bottom: 20px;
  text-decoration: none;
}

.back-link:hover {
  color: var(--color-brand);
}

.back-link i {
  margin-right: 5px;
}

/* Detail Page Links */
.links {
  display: grid;
  gap: 12px;
  max-width: 400px;
}

.links a,
.links button {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #333;
  color: var(--color-text-primary);
  padding: 14px 20px;
  border-radius: var(--radius-md);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  transition: var(--transition-fast);
  border: none;
  font-family: var(--font-primary);
  cursor: pointer;
  width: 100%;
}

.links a i,
.links button i {
  margin-right: 12px;
  font-size: 1.1rem;
  width: 20px;
  text-align: center;
}

.links a .flag {
  margin-right: 10px;
  font-size: 1.1rem;
}

.links a:hover,
.links button:hover {
  color: #fff;
  transform: scale(1.03);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.links a:active,
.links button:active {
  transform: scale(0.99);
  opacity: 0.9;
}

.links a.link-amazon:hover,
.links button.amazon-toggle:hover {
  background-color: var(--color-link-amazon);
  color: var(--color-text-dark);
}

.links a.link-google:hover { background-color: var(--color-link-google); }
.links a.link-apple:hover { background-color: var(--color-link-apple); color: var(--color-text-dark); }

.amazon-dropdown {
  display: grid;
  gap: 10px;
  background: var(--color-bg-tertiary);
  padding: 10px;
  border-radius: var(--radius-md);
  margin-top: -5px;
  margin-bottom: 5px;
}

.amazon-store-link {
  background: #383838 !important;
  text-align: left !important;
  justify-content: flex-start !important;
}

.amazon-store-link:hover {
  background: #555 !important;
  color: #fff !important;
  transform: scale(1.02) !important;
  box-shadow: none !important;
}

.amazon-store-link i {
  margin-left: 3px;
}

/* --- 6. Navigation (Desktop & Mobile) --- */

/* Desktop Navigation */
.nav-links {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-left: auto;
  margin-right: 10px;
}

/* REFACTOR: This styles *only* text links, ignoring the .publish-link */
.nav-links a:not(.publish-link) {
  color: #fff;
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  transition: color 0.25s ease;
  letter-spacing: 0.4px;
}

.nav-links a:not(.publish-link):hover {
  color: var(--color-brand-hover);
  text-decoration: underline;
}

/* REFACTOR: Single, clean definition for the publish button */
.publish-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: #73C1E5;
  color: #1e1e1e;
  font-weight: 600;
  font-size: 1rem;
  padding: 8px 18px;
  border-radius: 30px;
  text-decoration: none;
  transition: all 0.25s ease;
  cursor: pointer;
}

.publish-link i {
  font-size: 0.95rem;
}

.publish-link:hover {
  background: var(--color-brand-hover);
  color: #000;
  transform: translateY(-2px);
  box-shadow: 0 0 10px rgba(247, 194, 87, 0.4);
}

/* Mobile Navigation Components (Hidden by default) */
.burger {
  display: none;
}
.mobile-menu {
  display: none;
}
.mobile-tabbar-main {
  display: none;
}


/* --- 7. Animations --- */

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

.fade-in {
  animation: fadeIn 0.5s ease-out;
}

.fade-up {
  animation: fadeUp 0.5s ease-out forwards;
  opacity: 0;
}

/* Apple-style reveal animation */
.fade-up-apple {
  opacity: 0;
  transform: translateY(40px) scale(0.98);
  transition: transform 0.9s cubic-bezier(0.19, 1, 0.22, 1), opacity 1.1s ease;
  will-change: opacity, transform;
}

.fade-up-apple.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}


/* --- 8. Responsive (Media Queries) --- */

/* Smaller Mobile (iPhone SE / Mini) */
@media (max-width: 600px) {
  .mobile-menu {
    left: 10px;
    top: 60px;
    width: 200px;
    border-radius: 14px;
  }
}

/* Small tablets and landscape phones */
@media (max-width: 700px) {
  .header-inner {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .logo {
    flex-direction: column;
  }

  .logo-img {
    height: 35px;
  }

  .logo-text h2 {
    font-size: 1.3rem;
  }
}


/* Main Mobile Breakpoint (Tablets & Phones) */
@media (max-width: 768px) {
  /* Layout Changes */
  .detail-container {
    grid-template-columns: 1fr;
  }

  .detail-info h1 {
    font-size: 1.8rem;
    margin-top: 20px;
  }

  /* === MOBILE HEADER STRUCTURE === */
  .header-inner {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    text-align: left;
  }

  /* Burger button — left side */
  .burger {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 26px;
    height: 22px;
    cursor: pointer;
    order: 1; /* 👈 left */
  }

  .burger span {
    height: 3px;
    width: 22px;
    background: #fff;
    border-radius: 3px;
    transition: all 0.3s ease;
  }

  /* Burger → “X” animation */
  .burger.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
  }
  .burger.active span:nth-child(2) {
    opacity: 0;
  }
  .burger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
  }

  /* Logo — centered perfectly */
  .logo {
    order: 2;
    flex-grow: 1;
    display: flex;
    justify-content: center;
    flex-direction: row; /* Override 700px rule */
  }

  .logo-img {
    height: 35px;
  }

  /* Hide desktop nav, show mobile menu */
  .nav-links {
    display: none;
  }
  .publish-link {
    display: none !important; /* Hide desktop publish button */
  }
  

  /* === MOBILE MENU (Left Slide) === */
  .mobile-menu {
    position: absolute;
    top: 65px;
    left: 15px;
    width: 220px;
    max-height: 340px;
    background: rgba(30, 30, 30, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(10px);
    padding: 18px 22px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    opacity: 0;
    transform: translateX(-15px);
    pointer-events: none;
    transition: all 0.35s cubic-bezier(0.23, 1, 0.32, 1);
    z-index: 999;
    overflow: hidden;
  }

  .mobile-menu.active {
    opacity: 1;
    transform: translateX(0);
    pointer-events: auto;
  }

  /* Links inside menu */
  .mobile-links {
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 10px;
  }

  .mobile-links a {
    color: #fff;
    font-size: 1rem;
    font-weight: 300;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.2s ease;
  }

  .mobile-links a i {
    width: 20px;
    text-align: center;
    color: var(--color-brand);
    opacity: 0.9;
    transition: color 0.25s ease, transform 0.25s ease;
  }

  .mobile-links a:hover {
    color: var(--color-brand);
    transform: translateX(3px);
  }

  .mobile-links a:hover i {
    color: var(--color-brand-hover);
    transform: scale(1.1);
  }

  /* Footer inside menu */
  .mobile-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding-top: 8px;
    margin-top: 6px;
    text-align: center;
    width: 100%;
  }

  .mobile-footer img.footer-logo {
    height: 20px;
    opacity: 0.9;
    margin: 6px auto 4px;
    display: block;
  }

  .mobile-footer p {
    color: #888;
    font-size: 0.72rem;
    margin: 0;
    line-height: 1.3;
  }

  /* Mobile Tab Bar (Bottom of screen) */
  .mobile-tabbar-main {
    position: fixed;
    bottom: 5px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    display: flex;
    justify-content: center;
    z-index: 9999;
  }

  .publish-tab {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 14px 18px;
    background: linear-gradient(135deg, #73C1E5, #52A8D8);
    color: #111;
    font-weight: 700;
    font-size: 1rem;
    border-radius: 50px;
    text-decoration: none;
    box-shadow: 0 8px 20px rgba(115, 193, 229, 0.4);
    transition: all 0.3s ease;
    backdrop-filter: blur(6px);
  }

  .publish-tab:hover {
    transform: translateY(-3px);
    background: linear-gradient(135deg, var(--color-brand), #f7c257);
    box-shadow: 0 10px 25px rgba(247, 194, 87, 0.4);
    color: #000;
  }

  .publish-tab i {
    font-size: 1.1rem;
  }

  .publish-tab span {
    font-size: 1rem;
    letter-spacing: 0.3px;
  }

  /* Publish button *inside* the side menu */
  .mobile-publish-inmenu {
    width: 100%;
    margin-top: 6px;
    display: flex;
    justify-content: center;
  }

  .mobile-publish-inmenu .publish-tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: rgba(115, 193, 229, 0.12);
    color: #73C1E5;
    font-weight: 600;
    font-size: 0.9rem;
    border-radius: 20px;
    padding: 8px 14px;
    text-decoration: none;
    transition: all 0.25s ease;
    border: 1px solid rgba(115, 193, 229, 0.25);
  }

  .mobile-publish-inmenu .publish-tab:hover {
    background: rgba(115, 193, 229, 0.18);
    color: #fff;
    transform: translateY(-1px);
  }

  .mobile-publish-inmenu .publish-tab i {
    font-size: 0.9rem;
  }
}

/* Desktop-specific overrides */
@media (min-width: 768px) {
  /* 3D hover effect for book cards on desktop */
  .book-card.visible {
    transform: translateY(0) scale(1);
    transition: transform 0.8s ease-out, opacity 0.8s ease-out;
  }

  .book-card.visible:hover {
    transform: translateY(-8px) scale(1.04) rotateX(1deg);
  }
}


/* ====== Intro Banner ====== */
.hero-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 40vh;
  color: #fff;
  font-family: 'Montserrat', sans-serif;
  overflow: hidden;
  padding: 0 5%;
  box-sizing: border-box;
}

/* ===== Left (Logo section) ===== */
.hero-left {
  flex: 0 0 42%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-logo {
  height: 25vh;
  width: auto;
  object-fit: contain;
}

/* ===== Right (Text) ===== */
.hero-right {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start; /* نبدأ من الأعلى */
  padding-top: 120px; /* ينزل النص فعلاً تحت اللوجو */
  padding-left: 200px; /* المسافة من اللوجو */
  text-align: left;
}



.hero-text h2 {
  margin: 0;
  font-size: 2.2rem;
  font-weight: 700;
  color: #f6c250; /* refined gold */
}

.hero-text .highlight {
  font-size: 3rem;
  font-weight: 800;
  color: #f6c250;
}

.hero-text .books-word {
  font-size: 1.4rem;
  font-weight: 600;
  color: #f3d899;
  margin-left: 6px;
}

.hero-text p {
  margin-top: 6px;
  font-size: 1rem;
  color: #d6d6d6; /* lighter gray */
  letter-spacing: 0.4px;
}
.hero-text .books-word {
  font-size: 1.0rem;
  font-weight: 300;
  color: #ffffff; /* <-- الأبيض بدل الذهبي */
  margin-left: 6px;
}


/* ===== Responsive ===== */
@media (max-width: 900px) {
  .hero-banner {
    flex-direction: column;
    text-align: center;
    padding: 30px;
  }

  .hero-left {
    flex: none;
    width: 100%;
  }

  .hero-logo {
    height: 25vh;
  }

  .hero-right {
    align-items: center;
    justify-content: center;
    padding: 20px 0 0;
	
  }

  .hero-text h2 {
    font-size: 1.6rem;
  }

  .hero-text .highlight {
    font-size: 2rem;
  }

  .hero-text .books-word {
    font-size: 1.1rem;
  }

  .hero-text p {
    font-size: 0.9rem;
  }
}


/* Detail Page Links */
.links {
  display: grid;
  gap: 12px;
  max-width: 400px;
}

.links a,
.links button {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #333;
  color: var(--color-text-primary);
  padding: 14px 20px;
  border-radius: var(--radius-md);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  /* transition: var(--transition-fast); <-- محذوف من هنا */
  border: none;
  font-family: var(--font-primary);
  cursor: pointer;
  width: 100%;

  /* === 1. الأنيميشن البطيء === */
  opacity: 0;
  transform: translateY(20px);
  /* تم زيادة المدة إلى 0.8s */
  animation: fadeUp 0.8s cubic-bezier(0.23, 1, 0.32, 1) forwards;
  animation-delay: 0.2s; /* تأخير أساسي */
}

.links a i,
.links button i {
  margin-right: 12px;
  font-size: 1.1rem;
  width: 20px;
  text-align: center;
}

.links a .flag {
  margin-right: 10px;
  font-size: 1.1rem;
}

.links a:hover,
.links button:hover {
  color: #fff;
  transform: scale(1.03); /* هذا التحجيم خاص بالـ hover */
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  transition: var(--transition-fast); /* <-- مضاف هنا للـ hover */
}

.links a:active,
.links button:active {
  transform: scale(0.99);
  opacity: 0.9;
}

.links a.link-amazon:hover,
.links button.amazon-toggle:hover {
  background-color: var(--color-link-amazon);
  color: var(--color-text-dark);
}

.links a.link-google:hover { background-color: var(--color-link-google); }
.links a.link-apple:hover { background-color: var(--color-link-apple); color: var(--color-text-dark); }

/* === 2. تأثير الأنيميشن المتتابع (Stagger) - النسخة البطيئة === */
.links > *:nth-child(2) { animation-delay: 0.35s; } /* كان 0.3s */
.links > *:nth-child(3) { animation-delay: 0.5s;  } /* كان 0.4s */
.links > *:nth-child(4) { animation-delay: 0.65s; } /* كان 0.5s */
.links > *:nth-child(5) { animation-delay: 0.8s;  } /* كان 0.6s */
.links > *:nth-child(6) { animation-delay: 0.95s; } /* كان 0.7s */

.amazon-dropdown {
  display: grid;
  gap: 10px;
  background: var(--color-bg-tertiary);
  padding: 10px;
  border-radius: var(--radius-md);
  margin-top: -5px;
  margin-bottom: 5px;

  /* === 3. استثناء الدروب-داون من الأنيميشن === */
  opacity: 1;
  transform: none;
  animation: none;
}

.amazon-store-link {
  background: #383838 !important;
  text-align: left !important;
  justify-content: flex-start !important;
}

.amazon-store-link:hover {
  background: #555 !important;
  color: #fff !important;
  transform: scale(1.02) !important;
  box-shadow: none !important;
}

.amazon-store-link i {
  margin-left: 3px;
}
/* ===== Page Transition Animation ===== */
.fade-transition {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

body.page-loaded {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.read-link {
  display: none; 
}






