/* =============================================
   BAKI-LEX Extractor - Daily Dutch Theme
   Warm Brown / Sepia Palette
   ============================================= */

:root {
  --primary: #3C2F2F;
  --primary-light: #8B5A2B;
  --accent: #A67C5D;
  --bg-light: #FBF7F1;
  --bg-medium: #F7F2EB;
  --text-dark: #2C211E;
  --success: #5C4033;
  --danger: #9C6644;
  --border: #D4C3B2;
  --shadow: 0 10px 40px rgba(60, 47, 47, 0.22);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden;
  font-family: 'Montserrat', sans-serif;

  background-image:
    linear-gradient(
      to right,
      #b5451b 75%,
      transparent 75%
    ),
    url('../images/bgg.jpeg');

  background-size: auto, 500px;
  background-repeat: no-repeat, repeat;
  background-position: center, center;
  background-attachment: fixed, fixed;

  color: var(--text-dark);
}

body {
  display: flex;
  flex-direction: column;
  padding: 1rem;
}



.formtab {
  flex: 1 1 auto;
  max-width: 1600px;
  margin: 0 auto;
  width: 100%;
  background: var(--bg-light);
  border-radius: 1.5rem;
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
  border: 4px solid var(--primary-light);
}

#clickable-text {
  flex: 1 1 auto;
  overflow-y: auto;
  overflow-x: hidden;

  padding: clamp(2rem, 5vw, 4rem) clamp(1.5rem, 4vw, 3.5rem);

  background: var(--bg-medium);

  font-size: clamp(12px, 2.3vw, 17.5px);
  line-height: 1.5;

  white-space: pre-wrap;
  word-wrap: break-word;

  position: relative;
  color: #160f06;

  -webkit-overflow-scrolling: touch;
}
.doc-page {
  background: #F5EDE4;
  border-radius: 0.6rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08), 0 4px 20px rgba(0,0,0,0.06);
  margin: 0 auto 1.5rem;
  max-width: 42rem;
  padding: clamp(2.2rem, 5vw, 3.8rem) clamp(2rem, 4.5vw, 3.2rem);
  position: relative;
  border: 1px solid var(--border);
}

.page-number {
  position: absolute;
  bottom: -2.2rem;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.95rem;
  color: #6b4e3d;
  font-weight: 500;
  user-select: none;
  pointer-events: none;
  opacity: 0.75;
}

.page-divider {
  height: 1px;
  background: linear-gradient(to right, transparent, #c9b89f 45%, transparent);
  margin: 2.5rem 0;
  border: none;
}

.clickable-word {
  cursor: pointer;
  transition: background 0.2s;
  padding: 0 2px;
  border-radius: 3px;
}

.clickable-word:hover {
  background: #e8d9c4;
  color: var(--primary);
}

.floating-actions {
  position: absolute;
  bottom: clamp(1rem, 3vw, 2rem);
  right: clamp(1rem, 3vw, 2.5rem);
  z-index: 30;
  display: flex;
  gap: clamp(0.8rem, 2vw, 1.2rem);
}

.action-btn {
  width: clamp(54px, 12vw, 70px);
  height: clamp(54px, 12vw, 70px);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow: 0 4px 15px rgba(60, 47, 47, 0.25);
  background: white;
  border: 2px solid var(--primary);
}

.action-btn:hover {
  transform: translateY(-3px) scale(1.08);
  box-shadow: 0 10px 25px rgba(60, 47, 47, 0.35);
}

.save-btn {
  background: var(--primary);
  border: none;
}

.save-btn i,
.upload-area i {
  font-size: clamp(22px, 5vw, 32px);
  color: #F5EDE4;
}

.upload-area {
  border: 2px dashed var(--primary-light);
}

.upload-area i {
  color: var(--primary-light);
}

.progress-container {
  width: 90%;
  max-width: 900px;
  margin: 1rem auto;
  height: 10px;
  background: var(--border);
  border-radius: 10px;
  overflow: hidden;
  display: none;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--primary-light), var(--accent));
  transition: width 0.6s ease;
  box-shadow: 0 0 10px rgba(139, 90, 43, 0.5);
}

.sidebar {
  position: fixed;
  top: 0;
  left: -320px;
  width: 320px;
  height: 100%;
  background: var(--bg-light);
  box-shadow: 8px 0 25px rgba(60, 47, 47, 0.28);
  transition: left 0.35s ease;
  z-index: 900;
  display: flex;
  flex-direction: column;
}

.sidebar.open {
  left: 0;
}

.sidebar-header {
  padding: 1.5rem 1.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.sidebar-title {
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--primary);
}

.sidebar-close-btn {
  background: none;
  border: none;
  font-size: 1.6rem;
  color: #8B5A2B;
  cursor: pointer;
}

.sidebar-menu {
  flex: 1;
  padding: 1.5rem 0;
  overflow-y: auto;
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.8rem;
  color: var(--text-dark);
  cursor: pointer;
  transition: all 0.2s;
}

.sidebar-item:hover {
  background: #e8d9c4;
}

.sidebar-item i {
  width: 24px;
  text-align: center;
  font-size: 1.3rem;
  color: var(--primary);
}

.sidebar-item.logout {
  color: var(--danger);
  margin-top: auto;
  border-top: 1px solid var(--border);
}

.sidebar-item.logout:hover {
  background: #f5e0d0;
}

.sidebar-item.logout i {
  color: var(--danger);
}

.head {
  display: flex;
  align-items: center;
  gap: 0rem;
  padding: 0.5rem 0rem;
}

.menu-toggle-btn {
  position: static;
  background: none;
  border: none;
  color: var(--primary);
  font-size: 1.6rem;
  cursor: pointer;
  padding: 1rem;
  transition: all 0.3s ease;
  z-index: 950;
  margin-top: 1.5rem; /* adjust this value */
}


.menu-toggle-btn:hover {
  transform: scale(1.08);
}

.menu-toggle-btn.hidden {
  opacity: 0;
  pointer-events: none;
  transform: scale(0.8);
}

.sidebar.open ~ .formtab {
  transform: translateX(80px);
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
}

.modal-card {
  background: #2c1b12;
  border: 3px solid #d4af37;
  border-radius: 1.25rem;
  padding: 2rem 1.75rem;
  width: 100%;
  max-width: 520px;
  text-align: center;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.upload-card {
  background: #2c1b12;
  border: 3px solid #d4af37;
  border-radius: 1.25rem;
  padding: 1.1rem 1.3rem;
  width: fit-content;
  max-width: 420px;
  margin: 3rem auto;
  text-align: center;
  box-shadow: 0 10px 35px rgba(0,0,0,0.28);
}

.upload-card h3 {
  margin: 0 0 0.7rem 0;
}

.upload-card p {
    color: #d6c6b2;
    margin: 0.2rem 0;
    line-height: 1.05;
    font-size: 0.92rem;
}

.modal-card h3 {
  font-family: 'playfair display', serif;
  font-size: 1.4rem;
  font-weight: 700;
  color: #c8a96a;
  margin: 0;
}

.modal-card p {
  font-size: 0.95rem;
  color: #d6c6b2;
  margin: 0;
  line-height: 1.5;
}

.modal-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.modal-actions .cancel {
  flex: 1;
  height: 44px;
  background: #3b2a20;
  color: #f5efe6;
  border: none;
  border-radius: 9999px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
  font-family: 'Montserrat', sans-serif;
}

.modal-actions .cancel:hover {
  background: #4a3428;
  transform: translateY(-1px);
}

.modal-actions a {
  flex: 1;
  height: 44px;
  background: #c8a96a;
  color: #2c1b12;
  border-radius: 9999px;
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, transform 0.2s ease;
  box-shadow: 0 4px 15px rgba(200, 169, 106, 0.3);
}

.modal-actions a:hover {
  background: #b89655;
  transform: translateY(-1px);
}

.modal-content {
  background: var(--bg-light);
  padding: clamp(1.2rem, 5vw, 2rem);
  border-radius: 1.25rem;
  width: 90%;
  max-width: 400px;
  box-shadow: var(--shadow);
  border: 2px solid var(--accent);
}

h2 {
  color: var(--primary);
}

.theme-toggle-container {
  position: absolute;
  top: 1.2rem;
  right: 1.5rem;
  z-index: 50;
}

.theme-btn {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: none;
  background: rgba(245, 237, 228, 0.95);
  color: var(--primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 15px rgba(60, 47, 47, 0.2);
  transition: all 0.3s ease;
}

.theme-btn i {
  font-size: 24px;
  position: absolute;
  transition: all 0.4s ease;
}

.loading-spinner {
  border: 3px solid #e8d9c4;
  border-top: 3px solid var(--primary);
  border-radius: 50%;
  width: 24px;
  height: 24px;
  animation: spin 1s linear infinite;
  margin: 20px auto;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.app-toasts {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  z-index: 9999;
}

.app-toast {
  min-width: 240px;
  max-width: 340px;
  padding: 0.8rem 1rem;
  border-radius: 12px;
  font-weight: 600;
  box-shadow: 0 10px 25px rgba(0,0,0,0.25);
  background: var(--bg-light);
  color: var(--text-dark);
  border-left: 5px solid var(--primary);
  opacity: 0;
  transform: translateX(40px);
  animation: toast-in 0.25s ease forwards;
}

.app-toast.success { border-color: var(--success); }
.app-toast.error   { border-color: var(--danger); }

@media (max-width: 480px) {
  body {
    padding: 0.6rem;
    overflow-x: hidden;
  }

  .formtab {
    margin: 0 auto;
    width: 100%;
    max-width: 520px;
    border-radius: 1rem;
  }
}

.sentence { border-radius: 6px; padding: 1px 2px; cursor: pointer; }
.sentence.active { background: rgba(166, 124, 93, 0.25); }

.word { cursor: pointer; padding: 0 1px; border-radius: 4px; }
.word:hover { text-decoration: underline; }

/* ================= Homepage V2 ================= */

.home-upload-wrapper {
    max-width: 900px;
    margin: 0 auto;
    text-align: center;
}

.home-intro {
    margin-bottom: 2rem;
}

.home-intro h1 {
    font-family: 'Cormorant Garamond', serif;
    font-size: clamp(2.4rem, 5vw, 3.6rem);
    font-weight: 700;
    color: #2c1b12;
    margin-bottom: .8rem;
}

.home-intro p {
    font-family: 'Cormorant Garamond', serif;
    font-size: clamp(1.2rem, 2vw, 1.5rem);
    font-style: italic;
    line-height: 1.45;
    color: #5b4333;
    margin-bottom: .3rem;
}

.home-upload-button,
.upgrade-button {
    background: #c8a96a;
    color: #2c1b12;
    border: none;
    border-radius: 22px;
    padding: .65rem 1.6rem;
    font-family: 'Montserrat', sans-serif;
    font-size: .95rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,.18);
    transition: .2s;
}

.home-upload-button:hover,
.upgrade-button:hover {
    transform: translateY(-2px);
}

.home-formats {
    margin: 1rem 0 2rem;
}

.home-formats strong {
    display:block;
    color:#3c2f2f;
    margin-bottom:.25rem;
}

.home-formats span {
    color:#6b4e3d;
}

.tier-comparison {
    display:grid;
    grid-template-columns:repeat(2,1fr);
    gap:1.5rem;
    margin:2rem auto;
    max-width:850px;
}

.tier-panel {
    background:#f5ede4;
    border:1px solid var(--border);
    border-radius:18px;
    padding:1.5rem;
    text-align:left;
}

.tier-panel h2 {
    font-family:'Cormorant Garamond', serif;
    font-size:2rem;
    margin-bottom:.25rem;
    color:#2c1b12;
}

.tier-price {
    color:#8b5a2b;
    font-weight:700;
    font-size:1.3rem;
    margin-bottom:1rem;
}

.tier-panel ul {
    margin:0;
    padding-left:1.2rem;
}

.tier-panel li {
    margin-bottom: .75rem;
    line-height: 1.6;
    font-size: 1.35rem;
    color: #3b2b21;
}

.premium-tier {
    border:2px solid #c8a96a;
}

.upgrade-button {
    margin-top:1rem;
}

@media (max-width:700px){

    .tier-comparison{
        grid-template-columns:1fr;
    }

}
.book-source-box {
  text-align: left;
  margin: -0.5rem 0 1.2rem;
  padding: 0.9rem 1rem;
  background: #f5ede4;
  border: 1px solid var(--border);
  border-radius: 0.9rem;
}

.book-source-title {
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 0.25rem;
}

.book-source-subtitle {
  color: #555;
  font-size: 0.9rem;
  margin-bottom: 0.6rem;
}

.book-source-list {
  margin: 0;
  padding-left: 1.2rem;
}

.book-source-list li {
  margin: 0.35rem 0;
}

.book-source-list a {
  color: var(--primary);
  font-weight: 600;
  text-decoration: underline;
}
