html, body {
    height: 100%;
    margin: 0;
    padding: 0;
}

body {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Arial', sans-serif;
    background-color: #f0f0f0;
    overflow-y: hidden;
}

.chat-container {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width:100%;
    margin: auto;
    background-color: #fff;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

.chat-sidebar {
    width: 15%;
    background-color: #f8f9fa; /* Light gray background for better readability */
    border-right: 1px solid #ddd;
    font-size: 16px; /* Slightly increase the font size */
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1); /* Add a slight shadow for depth */
    border-radius: 8px; /* Add rounded corners */
}
.flashcards-popup {
    display: none;
    position: fixed;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 2px;
    border: 1px solid #ccc;
    z-index: 1000;
    max-height: 80vh;
    overflow-y: auto;
    width: 50%;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
}
.chat-sidebar div {
    padding: 10px;
    margin-bottom: 10px;
    background-color: #fff;
    border-radius: 5px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.chat-sidebar div:hover {
    background-color: #e9ecef; /* Change background on hover */
}


.chat-messages {
    flex-grow: 1;
    height: 100%;
    padding: 20px;
    overflow-y: auto;
    background-color: #F5F5F5;
    display: flex;
    flex-direction: column;
}

.chat-message {
    margin-bottom: 10px;
    padding: 10px;
    background-color: #fff;
    border-radius: 5px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    max-width: 70%;
    display: inline-block;
}

.user-message {
    background-color: #E3F2FD;
    align-self: flex-end;
}

.bot-message {
    background-color: #E8F5E9;
    align-self: flex-start;
}

#message-input {
    flex-grow: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    resize: none; /* Disable manual resizing */
    overflow-y: auto; /* Show scrollbar when needed */
    max-height: 150px; /* Set the maximum height */
    min-height: 40px; /* Set the minimum height */
    font-size: 16px;
    line-height: 20px; /* Adjust line height */
    box-sizing: border-box; /* Include padding in height calculations */
    width: 100%; /* Ensure it takes up the full available width */
    margin-right: 10px; /* Space between the textarea and the send button */
}

.chat-input {
    display: flex;
    align-items: flex-start; /* Align items to the top */
    padding: 10px;
    background-color: #fff;
    border-top: 1px solid #ddd;
}

.chat-input button {
    padding: 10px 20px;
    background-color: #4a90e2;
    color: #fff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    flex-shrink: 0; /* Prevent the button from shrinking */
    margin-left: 10px;
}

.chat-input button:hover {
    background-color: #357ab8;
}


#image-upload-label {
    cursor: pointer;
    font-size: 24px;
    margin-right: 10px;
}

#image-upload {
    display: none;
}

@media (max-width: 600px) {
    .chat-container {
        width: 100%;
    }

    .chat-input input {
        font-size: 16px;
    }

    .chat-input button {
        font-size: 16px;
    }
}
.delete-question-button {
    position: absolute;
    top: 5px;
    right: 5px;
    background-color: transparent;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #f44336; /* Red color */
}

.delete-question-button:hover {
    color: #d32f2f; /* Darker red on hover */
}

.quiz-question {
    border: 2px solid #4a90e2;
    padding: 10px;
    margin-bottom: 10px;
    position: relative; /* For positioning the delete button */
}

.show-answer {
    background-color: #4CAF50; /* Green */
    border: none;
    color: white;
    padding: 10px 20px;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    font-size: 14px;
    margin: 4px 2px;
    cursor: pointer;
    border-radius: 12px;
    transition: background-color 0.3s;
}

.show-answer:hover {
    background-color: #45a049;
}
.show-answer, .edit-question, .save-edit, .cancel-edit {
    margin-top: 10px;
    padding: 5px 10px;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    transition: background-color 0.3s;
}
.show-answer:hover, .edit-question:hover, .save-edit:hover, .cancel-edit:hover {
    background-color: #357ab8;
}
.show-answer {
    background-color: #4CAF50;
    color: #fff;
}
.edit-question {
    background-color: #ff9800;
    color: #fff;
}
.save-edit {
    background-color: #28a745;
    color: #fff;
}
.cancel-edit {
    background-color: #dc3545;
    color: #fff;
}
.edit-question {
    background-color: #ff9800;
    color: #fff;
}
.save-edit {
    background-color: #28a745;
    color: #fff;
}
.cancel-edit {
    background-color: #dc3545;
    color: #fff;
}
.save-edit:hover::after, .cancel-edit:hover::after {
    content: attr(title);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 5px;
    color: #fff;
    background-color: rgba(0, 0, 0, 0.75);
    border-radius: 3px;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.1s;
}
.save-edit:hover::after, .cancel-edit:hover::after {
    opacity: 1;
}
.navbar {
    transition: all 0.3s ease;
}

.navbar .auth-links .profile .dropdown {
    display: none;
    position: absolute;
    top: 50px;
    right: 0;
    background-color: #fff;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
    border-radius: 5px;
    overflow: hidden;
    z-index: 1000;
}

.save-edit, .cancel-edit {
    display: none;
}

.correct-answer, .explanation, .explanation-text {
    display: none;
}

.editable {
    border: none;
    background-color: transparent;
}

.editable-edit-mode {
    border: 1px solid #4a90e2;
    background-color: #f9f9f9;
}

.show-answer-visible {
    display: block;
}

.flashcards-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    flex-grow: 1;
}

.flashcard {
    width: 100%;
    max-width: 400px;
    border-radius: 10px;
    background-color: #fff;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    text-align: center;
    padding: 20px;
    transition: transform 0.3s;
}

.flashcard:hover {
    transform: translateY(-5px);
}

.flashcard-question, .flashcard-answer {
    font-size: 18px;
    margin: 10px 0;
}
.flashcard-answer {
    display: none; /* Ensures answer is hidden initially */
}
.flashcard-left-button, .flashcard-right-button {
    background-color: #007bff;
    color: #fff;
    border: none;
    border-radius: 50%;
    padding: 10px;
    cursor: pointer;
    font-size: 20px;
    margin: 20px;
    transition: background-color 0.3s;
}

.flashcard-left-button:hover, .flashcard-right-button:hover {
    background-color: #0056b3;
}

.navigation-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
}
.grade-level-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.grade-option {
    padding: 10px 15px;
    border-radius: 5px;
    border: none;
    background-color: #007bff;
    color: white;
    cursor: pointer;
    transition: background-color 0.3s;
    flex: 1 1 calc(50% - 20px); /* Two columns on mobile */
    text-align: center;
}

.grade-option:hover {
    background-color: #0056b3;
}
.chat-toggle-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 40%;
    background-color: transparent; /* Transparent background */
    color: rgb(55, 103, 204);
    font-size: 30px;
    font-weight: bold; /* Make the text bold */
    cursor: pointer;
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1001;
    transition: all 0.3s ease;
}

.chat-toggle-btn.active {
    transform: rotate(180deg); /* Rotate the arrow when sidebar is shown */
}
@media (max-width: 768px) {
    .chat-container {
        flex-direction: column;
    }
    .chat-toggle-btn {
        font-size: 40px;
        width: 30px;
    }
    .chat-sidebar {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: #fff;
        z-index: 1000;
        overflow-y: auto;
        padding: 20px;
        box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
    }

    .chat-sidebar.active {
        display: block;
    }

    .chat-sidebar.active {
        display: block; /* Display chat history when toggled active */
    }
    .chat-input {
        align-items: stretch;
    }

    .chat-input input, 
    .chat-input button, 
    .chat-input label {
        margin-right: 0;
        margin-bottom: 5px; /* Add some space between stacked elements */
    }
    .navbar {
        display: none; /* Hide navbar initially */
    }
    /* Style the navbar toggle button */
    .navbar-toggle-btn {
        display: block;
        font-size: 25px; /* Smaller size */
        cursor: pointer;
        padding: 5px; /* Adjust padding for smaller size */
        position: fixed;
        top: 10px;
        left: 50%; /* Center horizontally */
        transform: translateX(-50%); /* Adjust centering */
        z-index: 1001; /* Ensure the button is above other content */
        background-color: transparent; /* Make the background transparent */
        color: rgb(168, 64, 32);
        border-radius: 50%;
    }
    
    .content-container {
        display: flex;
        height: 100%;
        max-width: 100%;
        position: relative;
    }
    .flashcards-popup {
        width: 80%;
    }
}

@media (min-width: 769px) {
    

    .chat-sidebar {
        display: block; /* Ensure chat history is always visible on larger screens */
        width: 15%; /* Sidebar width for larger screens */
    }

    .navbar-toggle-btn {
        display: none; /* Hide the toggle button */
    }

    .content-container {
        display: flex;
        height: calc(100vh - 70px);
        max-width: 100%;
        position: relative;
    }

}



.chat-sidebar, .chat-container {
    height: 100%; /* Fill the remaining height inside content-container */
    overflow-y: auto; /* Ensure scrollable content without hiding anything */
}
.responsive-image {
    max-width: 100%;
    width: auto; /* Ensure the width adapts to the screen size */
    height: auto;
    display: block;
    margin: 0 auto;
}
.spinner {
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-left-color: #000;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}
.quiz-header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    background-color: white; /* Ensure the background matches the quiz content */
    z-index: 1001; /* Keep the header above other content */
    border-bottom: 2px solid #4a90e2; /* Optional: add a border to separate the header from the content */
    margin-top: 0; /* Ensure no margin at the top */
    margin: 0;
}

.quiz-close-button {
    background-color: transparent;
    border: none;
    font-size: 30px; /* Larger font size for better visibility */
    cursor: pointer;
    color: #f44336; /* Red color */
    padding: 5px;
    line-height: 1;
}

.quiz-close-button:hover {
    color: #d32f2f; /* Darker red on hover */
}

.quiz-title {
    flex-grow: 1;
    text-align: center;
    font-size: 24px; /* Adjust the title size */
    margin: 0; /* Ensure no margin for the title */
}
.quiz-toggle-button {
    background-color: transparent;
    border: none;
    font-size: 24px; /* Make the button large enough to be noticeable */
    cursor: pointer;
    color: #4a90e2; /* Match the color with the quiz content */
    padding: 5px;
    line-height: 1;
    margin-right: auto; /* Push the button to the left side */
}

.quiz-toggle-button:hover {
    color: #357ab8; /* Slightly darker on hover */
}
.quiz-nav-button {
    background-color: #4a90e2;
    color: white;
    border: none;
    border-radius: 50%;
    padding: 10px;
    cursor: pointer;
    font-size: 16px;
    margin: 10px;
    transition: background-color 0.3s;
}

.quiz-nav-button:disabled {
    background-color: #ccc; /* Disabled state color */
    cursor: not-allowed;
}

.quiz-nav-button:hover:not(:disabled) {
    background-color: #357ab8; /* Slightly darker on hover */
}

/* Container for each image */
.image-container {
    position: relative;
    display: inline-block;
    margin-right: 5px;
    margin-bottom: 5px;
    max-height: 100px;
    max-width: 100px;
}

/* Style for the image */
.image-container img {
    border-radius: 5px;
    max-width: 100%;
    height: auto;
    display: block;
}

/* Remove button */
.remove-image {
    position: absolute;
    top: 5px;
    left: 5px;
    background-color: rgba(0, 0, 0, 0.6);
    color: #fff;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    line-height: 20px;
    text-align: center;
    font-size: 14px;
    cursor: pointer;
    z-index: 10;
    transition: background-color 0.3s;
}

.remove-image:hover {
    background-color: rgba(255, 0, 0, 0.8);
}


#user-email {
    display: block;
    color: black; /* Ensure text color is visible */
}
#chat-input.drag-over {
    border: 2px dashed #4a90e2; /* Highlight border when dragging over */
}
/* Header for chat history */
.chat-history-header {
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 10px;
    color: #4CAF50; /* Dark blue */
}

/* Styling for the "New Chat" button */
.new-chat-button {
    background-color: #E8F5E9; 
    color: #4CAF50;
    padding: 10px 15px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    text-align: left;
    font-family: 'Arial', sans-serif;
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 15px;
    transition: background-color 0.3s;
}

.new-chat-button:hover {
    background-color: #45A049; /* Darker green on hover */
}

/* Styling for each chat item */
.chat-summary {
    background-color: #E8F5E9; /* Light green background */
    padding: 10px 15px;
    border-radius: 5px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: background-color 0.3s;
    font-family: 'Arial', sans-serif;
}

/* CSS za stilizaciju switch-a */
.language-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
}

.switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: #2196F3;
}

input:checked + .slider:before {
    transform: translateX(26px);
}

/* Switch label stilizacija */
#switch-label {
    font-size: 16px;
    color: #f9fbfc;
}

.flashcards-download-container {
    font-family: Arial, sans-serif;
    color: #000;
}

.flashcard-download {
    padding: 0;
    margin-bottom: 10px;
}

.flashcard-download p {
    margin: 0;
    font-size: 14px;
}
/* Flashcards Header Container */
.flashcards-header-container {
    display: flex;
    align-items: center;
    justify-content: flex-start; /* Align items from left to right */
    gap: 10px; /* Add space between items */
    margin-bottom: 20px;
}
/* Download Buttons */
.download-questions-button,
.download-answers-button {
    background-color: #1d5f1f; /* Green background */
    border: none;
    color: white;
    padding: 10px 20px;
    margin-left: 10px;
    font-size: 12px;
    cursor: pointer;
    border-radius: 5px;
    transition: background-color 0.3s;
    text-decoration: none;
}

.download-questions-button:hover,
.download-answers-button:hover {
    background-color: #45a049; /* Darker green on hover */
}

.download-questions-button:active,
.download-answers-button:active {
    background-color: #3e8e41; /* Even darker green when clicked */
}

.download-questions-button:focus,
.download-answers-button:focus {
    outline: none;
    box-shadow: 0 0 0 2px #80d8ff; /* Light blue focus ring */
}
/* Close Button */
.flashcards-close-button {
    position: absolute;
    top: 15px;
    right: 15px;
    background-color: transparent;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #888;
    transition: color 0.3s;
}

.flashcards-close-button:hover {
    color: #555;
}

.new-feature {
    position: absolute;
    top: 10px;
    right: 20px;
    background-color: #ff9800; /* Bright background to make it stand out */
    padding: 10px 15px;
    border-radius: 5px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s, background-color 0.3s;
    display: flex;
    flex-direction: column; /* Stack links vertically */
}

.new-feature-link {
    color: white;
    font-weight: bold;
    font-size: 16px;
    text-decoration: none;
    margin-bottom: 10px; /* Adds space between the links */
}

.new-label {
    background-color: #ff5722;
    padding: 3px 7px;
    border-radius: 3px;
    margin-right: 5px;
    font-size: 14px;
}

.new-feature:hover {
    background-color: #e68900;
    transform: scale(1.05); /* Adds a subtle zoom effect on hover */
}

.new-feature a:hover {
    text-decoration: underline;
}

