/* ===============================
   BASE GLOBALE
================================ */

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, sans-serif;
    background-color: #e9e4d4;
    color: #333;
    text-align: center;
}

.text-box {
  padding:5px 10px;
  margin:3px 0;
  border-radius:4px;
}

.text-box.left { text-align:left;  }
.text-box.right { text-align:right; }
.text-box.center { text-align:center; background:#fff3e0; }

.sticky {
  position: sticky;
  top: 60px; /* sous la navbar */
  background: #fffae6;
  font-weight: bold;
  padding: 10px;
  border-bottom: 1px solid #ccc;
  z-index: 10;
}

.text-box.sticky {
    display: flex;
    align-items: center;
    gap: 10px;
}

.daf-img {
    width: 30px;
    height: auto;
    flex-shrink: 0;
}




/* ===============================
   TITRES
================================ */

h1 {
    margin-top: 30px;
    margin-bottom: 20px;
}

/* ===============================
   INDEX – LISTE DES TRAITÉS
================================ */

#search-bar {
    margin-bottom: 20px;
    padding: 12px;
    width: 80%;
    max-width: 500px;
    border: none;
    border-radius: 8px;
    background-color: #ffffff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
    font-size: 16px;
}

#titles-list {
    list-style: none;
    padding: 0;
    margin: 0 auto 40px auto;
    max-width: 900px;
}

#titles-list li {
    margin-bottom: 25px;
}

#titles-list a {
    display: block;
    text-decoration: none;
    color: #333;
    padding: 10px;
    border-radius: 10px;
    transition: background-color 0.2s ease;
}

#titles-list a:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

#titles-list strong {
    font-size: 20px;
}

.summary {
    margin-top: 5px;
    font-size: 14px;
    color: #666;
}

/* ===============================
   PAGE TRAITÉ – BARRE FIXE
================================ */

#search-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background-color: #e9e4d4;
    padding: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    z-index: 1000;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
}

#search-container input {
    padding: 10px 14px;
    width: 260px;
    border: none;
    border-radius: 15px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.35);
    font-size: 15px;
}

#search-container button {
    padding: 10px 15px;
    border: none;
    border-radius: 15px;
    background-color: #5f5e5d;
    color: #fff;
    cursor: pointer;
    font-size: 14px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.35);
    transition: background-color 0.2s ease;
}

#search-container button:hover {
    background-color: #4e4d4c;
}

/* ===============================
   TEXTE TALMUD – AFFICHAGE
================================ */

#text-container {
    margin-top: 90px;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-bottom: 40px;
}

.text-box {
    width: 80%;
    max-width: 900px;
    margin: 8px 0;
    padding: 12px 16px;
    background-color: #e9e4d4;
    border-radius: 12px;
    word-wrap: break-word;
    font-size: 16px;
    line-height: 1.5;
}

/* Français – aligné à droite */
.text-box.right {
    text-align: right;
}

/* Navbar fixe */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 60px;
  background-color: #2c3e50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 15px;
  color: white;
  z-index: 1000;
}

.navbar .site-title {
  color: white;
  text-decoration: none;
  font-size: 1.5em;
  font-weight: bold;
}

.navbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.navbar input#search-bar {
  padding: 5px 10px;
  border-radius: 4px;
  border: none;
}

.navbar button {
  padding: 5px 10px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

.hamburger {
  font-size: 1.5em;
  background: none;
  color: white;
  border: none;
  cursor: pointer;
}

/* Menu vertical */
.vertical-menu {
  position: fixed;
  top: 60px;
  left: -200px;
  width: 200px;
  background-color: #34495e;
  height: 100%;
  display: flex;
  flex-direction: column;
  padding-top: 10px;
  transition: left 0.3s ease;
  z-index: 999;
}

.vertical-menu a {
  padding: 10px;
  color: white;
  text-decoration: none;
}

.vertical-menu a:hover {
  background-color: #1abc9c;
}

/* Quand le menu est actif */
.vertical-menu.active {
  left: 0;
}

/* Décalage du contenu pour ne pas être caché par navbar */
main {
  margin-top: 70px;
  padding: 20px;
}


/* Hébreu – aligné à gauche + RTL */
.text-box.left {
    text-align: left;
    direction: rtl;
    font-family: "Times New Roman", serif;
}


/* Overlay */
.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.5);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease;
  z-index: 999;
}

/* Modale */
.modal {
  position: fixed;
  bottom: -100%;
  left: 50%;
  transform: translateX(-50%);
  width: 90%;
  max-width: 400px;
  background-color: #fff;
  border-radius: 10px 10px 0 0;
  padding: 30px;
  box-shadow: 0 -2px 10px rgba(0,0,0,0.3);
  transition: bottom 0.4s ease;
  z-index: 1000;
}

.modal.active {
  bottom: 0;
}

.modal h1 {
  text-align: center;
  margin-bottom: 10px;
}

.modal h2 {
  text-align: center;
  font-weight: normal;
  margin-bottom: 20px;
}

.modal form input {
  width: 100%;
  padding: 10px;
  margin: 8px 0;
  border-radius: 4px;
  border: 1px solid #ccc;
}

.modal form .btn-primary {
  width: 100%;
  padding: 10px;
  background-color: #2c3e50;
  color: white;
  border: none;
  border-radius: 4px;
  margin-top: 10px;
  cursor: pointer;
}

.modal form .btn-google {
  width: 100%;
  padding: 10px;
  background-color: #dd4b39;
  color: white;
  border: none;
  border-radius: 4px;
  margin-top: 10px;
  cursor: pointer;
}

.auth-links {
  display: flex;
  justify-content: space-between;
  margin-top: 15px;
}

.auth-links a {
  text-decoration: none;
  color: #2c3e50;
}

.close-btn {
  position: absolute;
  top: 10px;
  right: 15px;
  font-size: 1.5em;
  background: none;
  border: none;
  cursor: pointer;
}

/* Exemple : couleur bouton pour Sign Up */
.modal#signup-modal .btn-primary {
  background-color: #1abc9c; /* vert clair */
}






.page-container {
  max-width: 400px;
  margin: 100px auto 0 auto;
  padding: 30px;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.2);
  opacity: 0;
  transform: translateY(100%);
}

/* Animation pour venir du bas */
.slide-up {
  animation: slideUp 0.6s forwards ease-out;
}

@keyframes slideUp {
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

form input {
  width: 100%;
  padding: 10px;
  margin: 8px 0;
  border-radius: 4px;
  border: 1px solid #ccc;
}

.btn-primary {
  width: 100%;
  padding: 10px;
  margin-top: 10px;
  background: #2c3e50;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

.btn-google {
  width: 100%;
  padding: 10px;
  margin-top: 10px;
  background: #dd4b39;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

.auth-links {
  display: flex;
  justify-content: space-between;
  margin-top: 15px;
}

.auth-links a {
  text-decoration: none;
  color: #2c3e50;
}

.reader-layout {
  display: flex;
  gap: 20px;
}

/* Texte */
#text-container {
  flex: 3;
  
}




.daf-img-wrapper {
  position: relative;
  display: inline-block;
}

.daf-img {
  width: 30px;
  height: auto;
}

/* Icône zoom */
.daf-zoom {
  position: absolute;
  bottom: -4px;
  right: -4px;
  width: 14px;
  height: 14px;
  background: #000;
  color: #fff;
  font-size: 10px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}



/* Image */
.daf-img-wrapper {
  position: relative;
  cursor: pointer;
}

.daf-img {
  width: 35px;
  height: auto;
}

/* Icône zoom */
.zoom-icon {
  position: absolute;
  bottom: -5px;
  right: -5px;
  background: black;
  color: white;
  font-size: 12px;
  padding: 2px 4px;
  border-radius: 50%;
  cursor: pointer;
}

/* Texte */
.line-text {
  flex: 1;
}



#image-viewer.visible {
  display: flex;
}

/* Header */
.viewer-header {
  display: flex;
  gap: 10px;
  padding: 8px;
  background: #222;
}

.viewer-header button {
  background: #333;
  color: white;
  border: none;
  padding: 6px 10px;
  cursor: pointer;
  font-size: 16px;
}

.viewer-header button:hover {
  background: #555;
}

/* Canvas */
.viewer-canvas {
  flex: 1;
  overflow: hidden;
  cursor: grab;
  display: flex;
  align-items: center;
  justify-content: center;
}

.viewer-canvas:active {
  cursor: grabbing;
}



/* MAIN FLEX */
#main-content {
  position: relative;
  display: flex;
  width: 100%;
}

/* IMAGE VIEWER */
#image-viewer {
    
  position: sticky;
  top: 60px; /* nécessaire pour sticky */
  height: 60%;       /* hauteur initiale */
  width: 25%;
    max-height: 85vh;
  max-width: 50%;
  background: #111;
  display: none; /* sticky + flex pour header + canvas */
  flex-direction: column;
  z-index: 50;
  border-right: 1px solid #444;
  overflow: hidden;
   resize: both;       /* permet horizontal + vertical */
}

/* HANDLE DE REDIMENSIONNEMENT */
#resize-handle {
  position: absolute;
  top: 0;
  right: 0;
  width: 6px;
  height: 100%;
  cursor: ew-resize;
  z-index: 60;
  background: rgba(255,255,255,0.1);
}

/* HEADER */
.viewer-header {
  display: flex;
  gap: 10px;
  padding: 8px;
  background: #222;
  flex-shrink: 0; /* évite que le header se réduise */
}

.viewer-header button {
  background: #333;
  color: white;
  border: none;
  padding: 6px 10px;
  cursor: pointer;
  font-size: 16px;
}

.viewer-header button:hover {
  background: #555;
}

/* CANVAS */
.viewer-canvas {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  cursor: grab;
  position: relative;
}

.viewer-canvas:active {
  cursor: grabbing;
}

/* IMAGE */
#image-viewer-img {
  max-width: 100%;
  max-height: 100%;
  transform-origin: center center;
  user-select: none;
  transition: transform 0.2s ease; /* smooth zoom */
}





/* ===============================
   SURBRILLANCE RECHERCHE
================================ */

.text-box.highlight {
    background-color: yellow;
}

/* ===============================
   RESPONSIVE
================================ */

@media (max-width: 600px) {
    #search-container {
        flex-wrap: wrap;
    }

    #search-container input {
        width: 100%;
    }

    .text-box {
        width: 95%;
    }
}
