body {
    font-family: Arial, sans-serif;
    margin: 0px 10px;
    background-color: white;
}

#login-form {
    /* Center the form on the page */
    max-width: 400px;
    margin: 0 auto;
    padding: 20px;
    border-radius: 5px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

/* both list.html and text.html */
/* ---------------------------- */
h1 {
    text-align: left;
}

#header {
    position: sticky;
    top: 0;
    background-color: white;
    z-index: 1000; /* Ensure it stays on top */
    padding: 10px 0;
}

#container {
    max-width: 800px;
    margin: 0 auto;
    padding-top: 15px;
}

#header h1 {
    margin: 0;
}

/* language_select.html */
/* -------------------- */

.language-item {
    padding: 15px;
    margin: 5px 0;
    background-color: white;
    cursor: pointer;
    font-size: 18px;
    text-align: center;
}

.language-item:hover {
    background-color: #f0f0f0;
}

body.dark-mode .language-item {
    background-color: #222;
    color: #ccc;
}

body.dark-mode .language-item:hover {
    background-color: #333;
}

/* list.html */
/* --------- */
.texts-container {
    margin-top: 20px;
    display: flex;
    flex-wrap: nowrap;
    overflow: auto;
}

.texts-container::-webkit-scrollbar {
    width: 5px; /* Set the width of the scrollbar */
    height: 12px; /* Set the height of the scrollbar */
}

.texts-container::-webkit-scrollbar-thumb {
    background-color: #bbb; /* Set the color of the scrollbar thumb */
    border-radius: 0px; /* Optional: round the corners of the scrollbar thumb */
}

.texts-container::-webkit-scrollbar-track {
    background-color: #f1f1f1; /* Set the color of the scrollbar track */
}

.text-item {
    flex: 0 0 210px;
    max-width: 210px;
    margin-right: 10px;
    padding: 10px;
    background-color: white;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    position: relative;
}

.text-item-preview {
    width: 210px;
    height: 140px;
    overflow: hidden;
    position: relative;
    z-index: 1;
}

.text-item-preview h3 {
    margin: 8px;
    overflow: hidden;
}

.text-item-preview p {
    margin: 0;
    padding: 0;
    overflow: hidden;
}

.text-item-preview p {
    margin: 0;
    padding: 0;
    overflow: hidden;
}

.text-image {
    width: 210px;
    height: auto;
    display: block;
    margin-top: 10px;
}

.text-content {
    margin-top: 20px;
    margin-top: 70px; /* for play button */
    padding: 10px;
}

#text-content::after {
    content: "";
    display: block;
    clear: both;
}

/* wrap the scrolling area plus arrows */
.texts-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  margin-top: 20px;  /* match existing .texts-container spacing */
}

/* arrow buttons */
.scroll-btn {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  padding: 0 5px;
  user-select: none;
  z-index: 2;
}

/* hide button if no overflow in that direction (optional) */
.scroll-btn:disabled {
  opacity: 0.3;
  cursor: default;
}

/* --------- */
/* text.html */
/* --------- */
#audio-controls {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: white;
    z-index: 1000;
    display: flex;
    align-items: center;
    padding: 10px;
}

#audio-controls button {
    margin-right: 3px;
    padding: 5px 10px;
    width: 40px;
    height: 30px;
    display: inline-flex;
    justify-content: center;
    align-items: center;
}

@media (max-width: 600px) {
    #audio-controls button {
        width: 56px;
        height: 44px;
        padding: 8px 12px;
        font-size: 22px;
    }

    #play-button {
        font-size: 28px;
    }
}

#progress-container {
    flex: 1;
    height: 10px;
    background-color: #ddd;
    cursor: pointer;
    position: relative;
}

#progress-bar {
    height: 100%;
    background-color: #2196F3;
    width: 0%;
}

p {
    margin: 0px 0;
    padding: 8px;
}

.sentence {
    background-color: white;
}

.highlight-sentence {
    background-color: #e8e8e8;
    border-left: 5px solid #888;
}


.sentence-image {
    margin: 5px 5px;
    max-width: 250px;
}

.sentence-image:nth-of-type(odd) {
    float: left;
}

.sentence-image:nth-of-type(even) {
    float: right;
}

.word {
    /* padding top and bottom */
    padding: 0px 0;
    cursor: pointer;
    color: black;
    text-decoration: none;
}

.word:hover {
    text-decoration: underline;
}

/* Translation Popup Styles */
/* ------------------------ */
#translation-popup {
    position: absolute;
    background-color: white;
    border: 1px solid #888;
    padding: 10px;
    z-index: 1000;
    max-width: 500px;
    box-shadow: 0px 0px 10px rgba(0,0,0,0.5);
    display: none;
}

#translation-popup #translation-popup-close-button {
    position: absolute;
    top: 5px;
    right: 5px;
    background: none;
    border: none;
    font-size: 16px;
    cursor: pointer;
    color: inherit; /* Match the text color */
}

#translation-popup .word-translation {
    background-color: transparent;
    border-left: none;
    margin-bottom: 10px;
}

#translation-popup .sentence-translation {
    background-color: transparent;
    border-left: none;
}

.inflections-table {
    width: 100%;
    border-collapse: collapse;
    margin: 10px 0;
}

.inflections-table th,
.inflections-table td {
    padding: 8px;
    text-align: left;
    border-top: 1px solid #ddd;
    border-bottom: 1px solid #ddd;
}

.inflections-table th {
    background-color: white;
    font-weight: bold;
}

.inflections-table tr:hover {
    background-color: #f9f9f9;
}

/* Questions */
/* --------- */
/* Question Styles */
#questions-container {
    margin-top: 20px;
    padding: 10px;
}

#questions-progress {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 15px;
}

.question {
    margin-bottom: 15px;
    padding: 10px;
    border-left: 5px solid transparent;
}

.question.correct {
    border-left: 5px solid green;
    background-color: #e6ffe6;
}

.question.incorrect {
    border-left: 5px solid red;
    background-color: #ffe6e6;
}

.question.unanswered {
    border-left: 5px solid gray;
    background-color: #f2f2f2;
}

.question-text {
    font-weight: bold;
}

.options-list {
    list-style-type: none;
    padding: 0;
}

.option-item {
    margin-bottom: 5px;
}

.option-label {
    cursor: pointer;
}

#submit-questions-button {
    display: block;
    margin: 20px auto 0;
    padding: 10px 20px;
    margin-bottom: 70px; /* Add space for the audio controls */
    font-size: 16px;
}

/* Theme Switcher Button */
/* --------------------- */
#theme-switcher, #admin-mode, #logout {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    background-color: transparent;
    color: inherit;
    z-index: 1001; /* Ensure it stays on top */
}

#admin-mode {
    top: 0px;
    right: 90px;
    display: none;
}

#logout {
    top: 10px;
    right: 50px;
}

/* Dark Mode Styles */
body.dark-mode {
    background-color: #111;
    color: #fff;
}

body.dark-mode .texts-container::-webkit-scrollbar-thumb {
    background-color: #555; /* Set the color of the scrollbar thumb */
    border-radius: 10px; /* Optional: round the corners of the scrollbar thumb */
}

body.dark-mode .texts-container::-webkit-scrollbar-track {
    background-color: #222; /* Set the color of the scrollbar track */
}

body.dark-mode button {
    /* Basic button styling */
    background-color: #333; /* Dark background for buttons */
    color: #ddd; /* Light text color for visibility in dark mode */
    border: 1px solid #555; /* Border color matching the scrollbar thumb */
    border-radius: 5px; /* Slightly rounded corners */
    padding: 10px 20px; /* Padding for better touch targets */
    cursor: pointer;
    transition: background-color 0.3s, border-color 0.3s; /* Smooth transition for hover effects */
}

body.dark-mode button:hover {
    background-color: #444; /* Slightly lighter background on hover */
    border-color: #666; /* Slightly lighter border on hover */
}

body.dark-mode button:active {
    background-color: #555; /* Match the scrollbar thumb color when active */
    border-color: #777; /* A bit lighter border when active */
}

body.dark-mode button:focus {
    outline: none; /* Remove default focus outline */
    box-shadow: 0 0 0 2px rgba(150, 150, 150, 0.5); /* Subtle focus ring */
}

/* For disabled buttons */
body.dark-mode button:disabled {
    background-color: #222; /* Match the scrollbar track color */
    color: #555; /* Less prominent text color */
    cursor: not-allowed;
    border-color: #333;
}

body.dark-mode .text-item {
    background-color: #222;
}

body.dark-mode .text-item p {
    color: #ccc;
}

body.dark-mode #header {
    background-color: #333;
}

body.dark-mode #audio-controls {
    background-color: #333;
}

body.dark-mode #progress-container {
    background-color: #444;
}

body.dark-mode #progress-bar {
    background-color: #2196F3;
}

body.dark-mode .sentence {
    background-color: #333;
}

body.dark-mode .word {
    color: #fff;
}

body.dark-mode .highlight-sentence {
    background-color: #555;
    color: #fff;
    border-left: 5px solid #888;
}

body.dark-mode #translation-popup {
    background-color: #333;
    color: #fff;
}

body.dark-mode #questions-container {
    background-color: #333;
}

body.dark-mode .question.correct {
    background-color: #1f7a1f;
    border-left: 5px solid #32a852;
}

body.dark-mode .question.incorrect {
    background-color: #7a1f1f;
    border-left: 5px solid #a83232;
}

body.dark-mode .question.unanswered {
    background-color: #555;
}

body.dark-mode .question-text,
body.dark-mode .option-label {
    color: #fff;
}
