/* ================= GENERAL STYLES ================= */
body {
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial;
    background: #ffffff;
    transition: 0.3s ease;
    margin: 0;
    padding: 0;
    padding-top: 150px; /* Space for navbar + extra offset */
    direction: ltr; /* default LTR */
}

/* ================= NIGHT MODE ================= */
body.night-mode {
    background: #003300 !important;
    color: orange !important;
}

/* Navbar */
body.night-mode .navbar,
body.night-mode .navbar * {
    background: #002200 !important;
    color: orange !important;
}

/* Chapter content */
body.night-mode .chapter-content {
    background: #003300 !important;
    color: orange !important;
}
body.night-mode .chapter-content * {
    color: orange !important;
}

/* Reader buttons */
body.night-mode .reader-controls button {
    background: #004400 !important;
    color: orange !important;
    border: 1px solid orange !important;
}

/* Progress bar */
body.night-mode .progress {
    background: #002200 !important;
}
body.night-mode .progress-bar {
    background: orange !important;
    color: #003300 !important;
}

/* Dropdown */
body.night-mode select {
    background: #004000 !important;
    color: orange !important;
    border: 1px solid orange !important;
}

/* Footer */
body.night-mode #footer {
    background: #002200 !important;
    color: orange !important;
    box-shadow: 0 -2px 6px rgba(255,140,0,0.3) !important;
}

/* ================= NAVBAR ================= */
.navbar {
    position: fixed;
    top: 40px;
    width: 100%;
    z-index: 9999;
}

/* ================= READER CONTROLS ================= */
.reader-controls {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

/* ================= CHAPTER CONTENT ================= */
.chapter-content {
    font-size: 16px;
    line-height: 1.6;
    padding: 15px;
    background: #ffffff;
    color: #000000;
    border-radius: 6px;
    text-align: left; /* default LTR */
}

/* Page turn animation */
.chapter-content.page-turn {
    animation: turn 0.6s ease;
}

@keyframes turn {
    0% { transform: rotateY(-30deg); opacity: 0.2; }
    100% { transform: rotateY(0deg); opacity: 1; }
}

/* ================= FOOTER ================= */
#footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: #f8f9fa;
    color: #333;
    text-align: center;
    padding: 12px 0;
    font-size: 15px;
    box-shadow: 0 -2px 6px rgba(0,0,0,0.15);
    z-index: 9999;
}

/* Prevent content overlap */
body {
    padding-bottom: 60px !important;
}

/* ================= GOOGLE TRANSLATE FIX ================= */
.goog-te-banner-frame { display: none !important; }

/* ================= RESPONSIVE ================= */
@media (max-width: 768px) {
    .reader-controls {
        flex-direction: column;
        gap: 3px;
    }
}

@media (max-width: 576px) {
    .chapter-content {
        font-size: 14px;
    }
}

/* ================= LABEL WITH PADDING ================= */
.select-label {
    padding-right: 10px;
    padding-left: 5px;
    padding-top: 5px;
    padding-bottom: 5px;
}

/* ================= RTL SUPPORT ================= */
body[dir="rtl"] {
    direction: rtl;
}

body[dir="rtl"] .chapter-content {
    text-align: right;
}

body[dir="rtl"] .reader-controls {
    flex-direction: row-reverse;
}

body[dir="rtl"] select {
    text-align: right;
}


/* ================= Google translate ================= */
 #google_translate_element {
    margin-top: 90px;
    margin-left: 15px;
    z-index: 99999;
  }

  .goog-te-banner-frame.skiptranslate { display: none !important; }
  body { top: 0 !important; }