/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */

@import "custom-image.css";
@import "bootstrap-utilities.css";
@import "pico.pagy.css";
@import "pico.firstdraft.css";

*, *::before, *::after {
  box-sizing: border-box;
}

/* Logo */

.logo-nav-container {
  display: flex;
  justify-content: space-between; /* logo left, nav right on desktop */
  align-items: center;
  flex-wrap: wrap;                /* allows nav to drop under logo on mobile */
  width: 100%;
  gap: 0.5rem;
}

/* Site Header */

.header-bar {
  padding: 1rem;
  width: 100%;
  box-sizing: border-box;
}
.header-bar h1 {
  margin: 0;
}
.header-nav {
  display: flex;
  gap: 0;
  flex-wrap: wrap;          
}
.header-nav a {
  width: auto;
  text-align: left;
  font-size: 0.8rem;
  margin: 0;
}
@media (max-width: 600px) {
  .logo-nav-container {
    flex-direction: column;
    align-items: center;       
  }
  .header-nav {
    justify-content: center;   
    margin-top: 0.5rem;
  }
}

/* Main content and homepage */


.content-container {
  max-width: 900px;    /* optional: keep content from being too wide on large screens */
  margin-left: auto;    /* center the content */
  margin-right: auto;
  padding: 0 1rem;
}

.comment-box {
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 1em;
  margin-bottom: 1em;
  background-color: #f9f9f9;
}

.comment-box h4 {
  margin: 0.2em 0;
}

.comment-box small {
  color: #777;
}

body {
        overflow-x: hidden;
        font-family: 'Noto Sans Arabic', 'Inter', sans-serif;
        line-height: 1.6;
        background-color: #f4f7f6;
      }
      header, footer {
        padding: 1rem 0;
      }
      nav a {
        margin-right: 1rem;
        font-weight: 600;
        text-decoration: none;
      }
      footer {
        margin-top: 3rem;
        border-top: 1px solid #eee;
        text-align: center;
        font-size: 0.9rem;
        color: #666;
      }

      @media (prefers-color-scheme: dark) {
        body {
          background-color: #000000; /* pure black */
        }
      }

      h1 a {
        font-family: 'Righteous', cursive;
        font-size: 2.2rem;        /* adjust size for your layout */
        text-decoration: none;     /* remove underline */
        color: #1c1c1c;               /* main color */
        letter-spacing: 1px;       /* subtle spacing for logo feel */
        cursor: pointer;           /* show it's clickable */
        transition: opacity 0.2s;
      }

      /* Optional: accent “Pro” */
      h1 .brand-main {
        color: #1c1c1c; /* default (light mode) */
      }
      
      h1 a:hover .brand-main {
       color: #28a745 !important; /* override la couleur existante */
       text-shadow: 0.25px 0.25px 0 #000;
      }

      h1 a:hover .brand-sub {
       color: #1c1c1c !important; /* override la couleur existante */
      }

      /* Dark mode */
      @media (prefers-color-scheme: dark) {
        h1 .brand-main {
          color: #fff; /* white text in dark mode */
        }
      }

      h1 .brand-sub {
        color: #28a745;
        margin-left: 0.2em;
        text-shadow: 0.25px 0.25px 0 #000; /* optional subtle outline for green text */
      }

      body.guide-page {
      font-family: sans-serif;
      margin: 0;
      padding: 0;
}

.highlight {
  color: #28a746c5;
}

html {
  scroll-behavior: smooth;
}

/* box on homepage */
.homepage-content {
  display: flex;
  justify-content: space-between;
  gap: 2rem;
  width: 100%;
  padding: 2rem 1rem 1rem 1rem;
  border-radius: 16px;
  font-family: 'Noto Sans Arabic', sans-serif;
  font-size: 0.8rem;
  line-height: 1.6;
  transition: background 0.3s, box-shadow 0.3s;
}


/* Homepage text and image alignment */
.welcome-text {
  flex: 1;
  text-align: left;
}

.welcome-image {
  flex: 0 0 50%; /* makes it take up 50% of the flex container width */
  display: flex;
  justify-content: flex-end; /* keeps it aligned to the right */
}

.welcome-image img {
  max-width: 100%;
  height: auto;
}

.hero {
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  height: 100vh;
  box-sizing: border-box;
  width: 100%;
  overflow: hidden; /* empêche le scroll inutile */
}

.hero .welcome-text {
  flex: 1 1 50%;
  padding-right: 2rem;
}

.hero .welcome-image {
  flex: 1 1 50%;
  display: flex;
  justify-content: center;
  align-items: center;
}

.hero .welcome-image img {
  max-width: 100%;
  max-height: 80vh;
  object-fit: contain;
}



/* Hide image and make text full-width on small screens */
@media (max-width: 768px) {
  .homepage-content {
    flex-direction: column;
    text-align: center;
  }

  .welcome-image {
    display: none !important;
  }

  .welcome-text {
    width: 100%;
  }
}

/* Light mode: soft translucent white */
@media (prefers-color-scheme: light) {
  .homepage-content {
    background: rgba(255, 255, 255, 0.9);
  }
}

/* Dark mode: subtle dark overlay */
@media (prefers-color-scheme: dark) {
  .homepage-content {
    background: rgba(0, 0, 0, 0.6); /* gives contrast for text */
    box-shadow: 0 6px 18px rgba(0,0,0,0.2);
    color: #fff;                   /* ensure text is readable */
  }
}

.homepage-content h1 {
  font-weight: 700;
  font-size: 1.5rem;
  margin-bottom: 0.5em;
}

@media (prefers-color-scheme: dark) {
  .homepage-content h2 {
    color: #ffffff;
  }
}


/* What's Next TOC container */
#toc-box {
  right: 1rem;
  width: 100%;
  padding: 0.5rem 0.8rem;
  border: 1px solid #ddd;
  border-radius: 6px;
  background: #f9f9f9;
  font-size: 0.85em;
  line-height: 1.3;
  max-height: 70vh;
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 9999;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  transition: width 0.3s, opacity 0.3s;
  margin-bottom: 2rem;
}

/* Collapsed TOC (desktop) */
#toc-box.collapsed #toc-links {
  display: none;
}

/* TOC toggle button */
#toc-toggle {
  display: block;
  width: 100%;
  margin-bottom: 0.5rem;
  background: #808080;
  color: #fff;
  border: none;
  border-radius: 4px;
  font-weight: bold;
  cursor: pointer;
}

/* TOC links */
#toc-links {
  flex-direction: column;
  flex-wrap: nowrap;
  transition: max-height 0.3s ease;
}
#toc-links a {
  display: block;
  margin: 0.2em 0;
  text-decoration: none;
  color: #007BFF;
  word-wrap: break-word;
}
#toc-links a:hover {
  text-decoration: underline;
}

/* Responsive: mobile */
@media (max-width: 900px) {
  #toc-box {
    position: relative;      /* stays at top of page */
    width: 100%;
    max-height: none;
    padding: 0.5rem 1rem;
    margin-bottom: 1rem;
    box-shadow: none;
    display: block;         
  }

  #toc-links {
    max-height: 0;          
    overflow: hidden;
    transition: max-height 0.3s ease;
    flex-direction: column;
    gap: 0.5rem;
  }

  #toc-box.expanded #toc-links {
    max-height: 1000px; 
  }

    main {
    margin: 0 auto;
    width: 95%;
  }
}

/* Main content */
main {
  margin: 1rem auto 2rem auto; /* optional spacing top/bottom */
  width: auto; /* let it take full available width */
  max-width: none; /* remove any max-width restriction */
}


/* Fonts apply in all modes */
body.homepage {
  font-family: 'Noto Sans Arabic', sans-serif;
}

/* header nav */
.header-nav {
  background-color: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(0,0,0,0.1);
  font-family: 'Montserrat', sans-serif;
  transition: background 0.3s, border-color 0.3s;
  padding: 0 1rem; /* ← add horizontal padding */
  box-sizing: border-box; /* ensure padding is included in width */
}

.header-nav a {
  text-decoration: none;
  color: #1c1c1c;
  font-weight: 500;
  margin-right: 1.5rem;
  transition: color 0.2s, transform 0.2s;
}

.header-nav a:hover {
  color: #2c3e50;
  transform: translateY(-1px); /* subtle hover lift */
}

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

/* Dark mode tweaks */
@media (prefers-color-scheme: dark) {
  .header-nav {
    background-color: rgba(0,0,0,0.7);
    border-bottom: 1px solid rgba(255,255,255,0.1);
  }
  .header-nav a {
    color: #fff;
  }
  .header-nav a:hover {
    color: #2c3e50;
  }
}

/* Review pages */

.review-box {
  position: relative; /* for pseudo-elements */
  z-index: 1;
  max-width: 400px;
  margin: 2rem auto;
  padding: 1.5rem;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
  text-align: center;
  color: #1c1c1c;
  transition: transform 0.3s ease;
}

/* Create two stacked “cards” behind with subtle offset and blur */
.review-box::before,
.review-box::after {
  content: "";
  position: absolute;
  top: 8px;
  left: 8px;
  width: 100%;
  height: 100%;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.674);
  z-index: -1;
  transition: all 0.3s ease;
}

/* Slightly shift and rotate each “card” for the stacked effect */
.review-box::before {
  transform: rotate(-2deg);
  top: 12px;
  left: 12px;
  opacity: 0.6;
}

.review-box::after {
  transform: rotate(2deg);
  top: 4px;
  left: 4px;
  opacity: 0.8;
}

@media (prefers-color-scheme: dark) {
  .review-box {
    background: #00000088;
    box-shadow: 0 4px 10px rgba(255, 255, 255, 0.1);
    color: #fff;
  }

  .review-box::before,
  .review-box::after {
    background: #000000;  /* darker gray for the stacked cards */
    box-shadow: 0 4px 15px rgba(255, 255, 255, 0.15);
  }

  .review-box::before {
    opacity: 0.7;
    top: 12px;
    left: 12px;
    transform: rotate(-2deg);
  }

  .review-box::after {
    opacity: 0.9;
    top: 4px;
    left: 4px;
    transform: rotate(2deg);
  }
}

.flashcard-style {
  margin-top: 1em;
  display: flex;
  justify-content: center;
}


.review-status {
  font-size: 1.2em;
  margin-bottom: 1em;
  color: #1c1c1c;
}

.btn {
  display: inline-block;
  align-items: center;
  padding: 0.6em 1.2em;
  background-color: #28a745;
  color: white;
  text-decoration: none;
  border-radius: 6px;
  font-weight: 600;
  transition: background 0.2s ease;
}

.btn:hover {
  background-color: #005bb5;
}

.btn.secondary {
  background-color: #eee;
  color: #333;
}

.btn.secondary:hover {
  background-color: #ddd;
}

/* User dashboard screen layout */

.review-box-container {
  display: flex;
  flex-direction: column; /* stacked by default on mobile */
  gap: 1rem;             /* space between boxes */
}

/* On wider screens, show side by side */
@media (min-width: 900px) {
  .review-box-container {
    flex-direction: row;
  }

  .review-box {
    flex: 1;             /* take equal width */
  }
}
