/* Default style for light mode */
#progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%; /* Initial width */
    height: 4px; /* Thickness of the progress bar */
    background: linear-gradient(90deg, #c0392b, #f39c12); /* Light mode gradient */
    z-index: 1500; /* Ensure it stays on top of other elements */
    transition: width 0.1s ease, background 0.3s ease; /* Smooth progress and color transition */
}

/* Dark mode style */
body.latex-dark #progress-bar {
    background: linear-gradient(90deg, #2c3e50, #6c92b0); /* Dark mode gradient */
}
/* HEADER */
/* Header Styling */
.header {
    margin: 0;
    padding: 0;
    position: relative;
    width: 100vw;
    padding-top: 50px;
    padding-bottom: 10px; /* Space for bottom border */
    transform: skew(0deg, -1deg) translateY(-50px);
    background: #f4f4f4; /* Match footer light background */
    color: #800000; /* Dark red for light mode text */
    border-bottom: 2px solid #c0392b; /* Red border for light mode */
    z-index: 1;
    transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease; /* Smooth transitions */
}

/* Header text styling */
.header-text {
    transform: skew(0deg, +1deg);
    margin: 0 auto; /* Center the content */
    padding: 0 20px; /* Add padding for spacing */
    color: inherit; /* Inherit colour for text consistency */
}

/* Header in dark mode */
body.latex-dark .header {
    background: #2c3e50; /* Match footer dark background */
    color: #f1c40f; /* Match footer dark text colour */
    border-bottom: 2px solid #1a252f; /* Match footer dark border */
}


@media (max-width: 768px) {
    .header {
        padding-bottom: 8px;
    }
}

.header h1 {
    margin: 0px;
    padding: 0px;
    text-align: left; /* Ensure the text aligns naturally to the left */
}

/* BODY */
body {
    margin: 0; /* Remove any extra margins */
    padding: 0;
    max-width: 100%; /* Allow full-width content */
    box-sizing: border-box;
}

/* Main Content Styling */
.content {
    max-width: 1000px; /* Constrain content width */
    margin: 0 auto; /* Center the content */
    margin-top: -50px; /* Pull content up to overlap */
    padding-top: 0px; /* Ensure padding for content */
    padding: 20px;
}

.social {
    margin-top: 10px; /* Space above the social icons */
    display: flex; /* Use flexbox for alignment */
    align-items: center; /* Vertically align icons */
    gap: 10px; /* Space between the icons */
    filter: invert(24%) sepia(60%) saturate(450%) hue-rotate(-5deg) brightness(90%) contrast(100%);
}

body.latex-dark .social {
    filter: invert(80%) sepia(20%) saturate(200%) hue-rotate(200deg) brightness(95%) contrast(110%);
}

.social a {
    display: inline-flex; /* Ensure links behave as flex items */
    align-items: center; /* Center align the icons within links */
    text-decoration: none; /* Remove underline from links */
}

.social img {
    display: block; /* Ensure images inside links behave as inline elements */
    width: 25px; /* Icon size */
    height: 25px; /* Icon size */
    transition: filter 0.2s ease-in-out; /* Smooth hover effect */
}

.social img:hover {
    filter: opacity(0.5); /* Reduce opacity on hover */
}

#social_link {
    visibility: hidden;
    font-size: small;
    margin-top: -35px;
    margin-left: 5px;
}

@media (max-width: 768px) {
    #social_link {
        display: none;
        font-size: small;
        margin-top: -35px;
        margin-left: 5px;
    }
}

h1{
    text-align: center;    
}

ul {
    padding-left: 20px;
}
.download-links ul {
    list-style: none;
    padding: 0;
}
.download-links li {
    margin-bottom: 10px;
}        

/* General container styles */
/* DESKTOP-SPECIFIC: FIXED TOGGLE */
.dark-mode-container {
    position: fixed; /* Fixed on desktop screens */
    top: 20px;
    right: 20px;
    z-index: 1000; /* Ensure it's above other elements */
    display: flex;
    align-items: center;
    justify-content: center;
}

/* MOBILE-SPECIFIC: STATIC POSITION INSIDE HEADER */
@media (max-width: 768px) {
    .dark-mode-container {
        position: absolute; /* Inside the header */
        top: 10px; /* Adjust within the header */
        right: 10px; /* Align to the top-right of the header */
        z-index: 1000; /* Ensure it’s above header content */
    }
}

/* Hide the default checkbox */
#dark-mode-toggle {
    display: none;
}

/* Box styles for the toggle */
.dark-mode-label {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 40px;
    background: #c0392b; /* Light mode: red */
    border-radius: 10px;
    border: 2px solid #a93226; /* Light mode: dark red border */
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease-in-out;
}

.dark-mode-label:hover {
    background: #e74c3c; /* Light mode hover: brighter red */
}

/* Ball styles for the toggle */
.dark-mode-ball {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 30px;
    height: 30px;
    background: #fff; /* Ball color */
    border: 2px solid #c0392b;
    border-radius: 33%;
    transition: all 0.3s ease-in-out;
}

/* Scenery: Sun and Moon */
.dark-mode-scenery {
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%; /* Full width of the toggle button */
    height: 100%; /* Match the height of the toggle button */
    pointer-events: none; /* Prevent interaction with the icons */
}

.sun {
    position: absolute;
    right: 90px; /* Sun on the right side */
    top: 0%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    opacity: 0; /* Fully visible by default */
    transition: all 0.3s ease-in-out;
}

.moon {
    position: absolute;
    left: 5px; /* Moon on the left side */
    top: 0%;
    transform: translateY(-55%);
    width: 20px;
    height: 20px;
    opacity: 1; /* Hidden by default */
    transition: all 0.3s ease-in-out;
}

/* Toggle visibility on dark mode */
#dark-mode-toggle:checked ~ .dark-mode-label .sun {
    opacity: 1; /* Show the sun in dark mode */
}

#dark-mode-toggle:checked ~ .dark-mode-label .moon {
    opacity: 0; /* Hide the moon in dark mode */
}

/* Position changes when toggled */
#dark-mode-toggle:checked ~ .dark-mode-label {
    background: #2c3e50; /* Dark mode: blue */
    border: 2px solid #1a252f; /* Dark mode: darker blue border */
}

#dark-mode-toggle:checked ~ .dark-mode-label .dark-mode-ball {
    transform: translateX(40px); /* Move the ball */
    border: 2px solid #2c3e50;
}

/* Highlighted text styling */
.cd {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    background-color: #e0e0e0; /* Light grey for normal mode */
    color: #333;
    white-space: nowrap; 
}

/* Dark mode */
body.latex-dark .cd {
    background-color: #6c92b0; /* Light blue for dark mode */
    color: #fff;
}



/* /////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////
                                                ChatGPT
////////////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////// */
/* Ensure the chat container has a position for relative positioning */
.chat-wrapper{
    position: relative;
}

/* Chat Container Styling */
.chat-container {
    position: relative; /* Required for the pseudo-element */
    margin: 20px auto;
    padding: 10px;
    max-width: 950px;
    max-height: 700px; /* Collapsed height */
    border-radius: 10px;
    border: 1px solid #800000;
    background: white;
    font-family: 'Arial', sans-serif;
    overflow: hidden; /* Prevent content overflow */
}

/* Dark Mode Styling */
body.latex-dark .chat-container {
    background: #2c3e50;
    border-color: #6c92b0;
}

/* Gradient Fade-Out Effect */
.chat-container:before {
    content: '';
    position: absolute;
    bottom: 0; /* Stick to the bottom */
    left: 0;
    right: 0;
    height: 150px; /* Height of the gradient fade */
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0), white); /* Light mode gradient */
    pointer-events: none; /* Allow clicks through the gradient */
    z-index: 1; /* Ensure it appears above the chat content */
}

body.latex-dark .chat-container:before {
    background: linear-gradient(to bottom, rgba(44, 62, 80, 0), #2c3e50); /* Dark mode gradient */
}

/* Expanded Container (No Gradient) */
.chat-container.expanded:before {
    display: none; /* Remove the gradient when expanded */
}


/* Style the button */
.expand-btn {
    position: absolute; /* Position relative to .chat-container */
    bottom: -16px; /* Align at the bottom */
    right: 16px; /* Align at the right */
    width: 40px; /* Circular size */
    height: 40px; /* Circular size */
    background: white; /* Button background */
    border: 2px solid #800000; /* Border color */
    border-radius: 50%; /* Circular shape */
    display: flex; /* Center the content */
    align-items: center; /* Center icon vertically */
    justify-content: center; /* Center icon horizontally */
    cursor: pointer;
    z-index: 10; /* Ensure it appears above content */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); /* Subtle shadow */
    transition: background-color 0.3s ease, transform 0.2s ease; /* Smooth effects */
}

body.latex-dark .expand-btn {
    background: #6c92b0; /* Dark mode background */
    border-color: #2c3e50; /* Dark mode border */
}

.expand-btn:hover {
    background: #f4f4f4; /* Highlight effect on hover */
    transform: scale(1.1); /* Slight zoom effect */
}

body.latex-dark .expand-btn:hover {
    background: #444; /* Highlight for dark mode */
}

.expand-btn img.expand-icon {
    width: 16px; /* Adjust icon size */
    height: 16px;
    pointer-events: none; /* Ensure click is on the button, not the image */
}

.expand-btn {
    transform: rotate(0deg);
    transition: transform 0.3s ease;
}

.expand-btn.expanded {
    transform: rotate(180deg); /* Flip the arrow when expanded */
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .expand-btn {
        bottom: 5px; /* Adjust for smaller screens */
        right: 5px;
    }
}

/* Styling for User (PromptGPT) */
.PromptGPT {
    display: flex;
    justify-content: flex-end;
    margin: 10px 0;
}

.PromptGPT .chat-bubble {
    max-width: 80%;
    padding: 10px;
    background: #F3F3F3;
    color: black;
    border-radius: 20px 20px 20px 20px;
    font-size: 14px;
    line-height: 1.6;
    box-shadow: 0 4px 4px rgba(0, 0, 0, 0.2);
    position: relative;
}

body.latex-dark .PromptGPT .chat-bubble {
    background: #444;
    color: white;
}

/* ChatGPT Styling */
.ChatGPT {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 10px 0;
}

.ChatGPT .avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: url('https://web.vscht.cz/~hruskaa/img/logos/logoChatGPT.svg') no-repeat center center;
    background-size: contain;
    flex-shrink: 0;
    border: 1px solid grey;
}

body.latex-dark .ChatGPT .avatar {
    color: #6c92b0;
    filter: invert(80%) sepia(20%) saturate(200%) hue-rotate(200deg) brightness(95%) contrast(110%);
    background-color: #444;
    border: 1px solid #6c92b0;
}

.ChatGPT .chat-content {
    max-width: 100%;
    background: #fff;
    color: #333;
    padding: 15px;
    font-size: 14px;
    line-height: 1.6;
    position: relative;
}

body.latex-dark .ChatGPT .chat-content {
    background: #2c3e50;
    color: #ddd;
}

/* Responsive Chat Styling */
@media (max-width: 768px) {
    .chat-container {
        padding: 5px;
        margin: 10px auto;
    }

    .PromptGPT .chat-bubble,
    .ChatGPT .chat-content {
        max-width: 90%; /* Scale content for smaller screens */
        word-wrap: break-word; /* Ensure text wraps */
        overflow-wrap: break-word;
    }
}

/* File Bubble Styling */
.FileBubble {
    display: flex;
    justify-content: flex-end;
    margin: 10px 0;
}

.FileBubble .file-link {
    display: flex;
    align-items: center;
    padding: 10px;
    background: #c0392b;
    color: #fff;
    border-radius: 15px 15px 15px 15px;
    font-size: 14px;
    text-decoration: none;
    max-width: 75%;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    transition: background 0.3s ease;
}

body.latex-dark .FileBubble .file-link {
    background: #6c92b0;
}

.FileBubble .file-link:hover {
    background: #800000;
}

body.latex-dark .FileBubble .file-link:hover {
    background: #2c3e50;
}

.FileBubble .file-icon {
    margin-right: 8px;
    font-size: 16px;
}

/* Scoped styling for ChatGPT response content */
.response-styled {
    font-family: 'Arial', sans-serif; /* Ensure consistent font */
    font-size: 14px;
    color: #333;
    line-height: 1.6;
}

body.latex-dark .response-styled {
    color: #ddd;
}

/* Styling for headings */
.response-styled h2, .response-styled h3 {
    font-size: 18px;
    font-weight: bold;
    color: #333;
    margin-top: 15px;
    margin-bottom: 10px;
}

body.latex-dark .response-styled h2,
body.latex-dark .response-styled h3 {
    color: #ddd;
}

/* Code Styling */
.ChatGPT pre {
    margin: 10px 0;
    padding: 10px;
    background: #f4f4f4;
    color: #333;
    font-size: 13px;
    line-height: 1.5;
    border-radius: 8px;
    border: 1px solid #ddd;
    overflow-x: auto;
}

body.latex-dark .ChatGPT pre {
    background: #202d3a;
    color: #ccc;
    border-color: #6c92b0;
}

.ChatGPT pre code {
    font-family: 'Courier New', monospace;
    white-space: pre-wrap;
}

.ChatGPT .code-header {
    margin-top: 15px;
    font-weight: bold;
    font-size: 12px;
    color: #555;
    text-transform: uppercase;
}

body.latex-dark .ChatGPT .code-header {
    color: #ddd;
}

/* Horizontal Rule for Separating Code */
.ChatGPT hr {
    margin: 15px 0;
    border: none;
    border-top: 1px solid #ddd;
}

body.latex-dark .ChatGPT hr {
    border-top: 1px solid #6c92b0;
}

/* Chat Image Styling */
.ImageBubble {
    display: flex;
    justify-content: flex-end;
    margin: 10px 0;
    cursor: pointer;
}

.ImageBubble img.chat-image {
    width: 350px;
    height: auto;
    border-radius: 10px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
    border: 1px solid #ddd;
    object-fit: cover;
    max-height: 150px;
}

.ImageBubble img.chat-image:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

/* Lightbox */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    cursor: pointer;
}

.lightbox-content {
    max-width: 90%;
    max-height: 90%;
}

.lightbox-content img {
    width: auto;
    height: auto;
    max-width: 90%;
    max-height: 90%;
    border-radius: 10px;
    border: 2px solid #fff;
}

/* Response Image on Left Side */
.ChatGPT.ImageBubble.response-left {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 10px 0;
    justify-content: flex-start; /* Aligns image to the left */
    flex-direction: row;
}

.ChatGPT.ImageBubble.response-left .chat-image {
    width: 350px;
    height: auto;
    border-radius: 10px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
    border: 1px solid #ddd;
    object-fit: cover;
    max-height: 150px;
}

/* Reaction Bubble Styling */
.ReactionBubble {
    display: flex;
    justify-content: flex-end; /* Aligns to the right */
    margin: 5px 0;
    cursor: pointer;
}

.ReactionBubble .reaction-image {
    width: 50px;  /* Smaller size like an icon */
    height: 50px;
    border-radius: 8px;
    border: 1px solid #ddd;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    object-fit: cover;
}

.ReactionBubble .reaction-image:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

/* Reaction Bubble Styling */
.ReactionBubble {
    display: flex;
    justify-content: flex-end; /* Aligns to the right */
    margin: 5px 0;
    cursor: pointer;
}

.ReactionBubble .reaction-image {
    width: 50px;  /* Smaller size like an icon */
    height: 50px;
    border-radius: 8px;
    border: 1px solid #ddd;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    object-fit: cover;
}

.ReactionBubble .reaction-image:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}


/* /////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////
                                                Footer
////////////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////// */
/* Footer Styling (Within .content) */
footer {
    margin-top: 15px; /* Space from above content */
    padding: 5px;
    text-align: center; /* Center align all footer text */
    background: #f4f4f4; /* Default light background */
    color: #333; /* Default text colour */
    border-top: 2px solid #c0392b; /* Red border for light mode */
    transition: background-color 0.3s ease, border-color 0.3s ease; /* Smooth transitions */
}

footer p {
    margin: 0 auto;
    padding: 0 auto;
    text-align: center;
}

footer a {
    text-decoration: none;
    color: #c0392b; /* Match light mode theme colour */
    transition: color 0.3s ease; /* Smooth hover transition */
}

footer a:hover {
    color: #e74c3c; /* Slightly brighter on hover */
}

/* Dark mode styles */
body.latex-dark footer {
    background: #2c3e50; /* Dark background */
    color: #ddd; /* Light text colour for dark mode */
    border-top: 2px solid #1a252f; /* Dark border for dark mode */
}

body.latex-dark footer a {
    color: #f1c40f; /* Gold colour for links in dark mode */
}

body.latex-dark footer a:hover {
    color: #f39c12; /* Slightly brighter gold on hover */
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    footer {
        padding: 15px;
    }
}

/* References Section */
#references {
    list-style: none; /* Remove default list styling */
    padding-left: 0; /* Align content with no padding */
    margin-top: 20px; /* Add spacing from the content above */
    font-family: Arial, sans-serif; /* Match the overall page font */
    font-size: 16px; /* Adjust font size */
    color: #333; /* Text color for light mode */
    line-height: 1.6; /* Increase line spacing for readability */
}

body.latex-dark #references {
    color: #ccc; /* Adjust text color for dark mode */
}

#references li {
    margin-bottom: 10px; /* Add spacing between references */
    position: relative; /* For positioning the reference number */
}

#references li .ref-number {
    font-weight: bold; /* Highlight reference number */
    margin-right: 8px; /* Add spacing between the number and text */
    color: #c0392b; /* Match header/footer color in light mode */
}

body.latex-dark #references li .ref-number {
    color: #6c92b0; /* Match header/footer color in dark mode */
}

#references li .custom-back-link {
    font-size: 14px; /* Adjust size of back link */
    margin-left: 5px; /* Add spacing from reference text */
    text-decoration: none; /* Remove underline for back link */
    color: #c0392b; /* Use link blue for light mode */
}

body.latex-dark #references li .custom-back-link {
    color: #89c4f4; /* Adjust back link color for dark mode */
}

#references li .custom-back-link:hover {
    text-decoration: underline; /* Add underline on hover */
}

/* Custom Sidenotes Styling */
.custom-sidenote {
    position: absolute;
    max-width: 400px;
    background-color: #f9f9f9; /* Light background for sidenotes */
    color: #333; /* Text color */
    padding: 10px;
    border: 1px solid #ddd; /* Border for sidenotes */
    border-radius: 4px;
    box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.1); /* Subtle shadow for emphasis */
    font-size: 14px;
    z-index: 999;
}

body.latex-dark .custom-sidenote {
    background-color: #2c3e50; /* Dark mode background */
    color: #ccc; /* Text color for dark mode */
    border: 1px solid #444; /* Border for dark mode */
}

.custom-sidenote b {
    font-size: 16px;
    color: #c0392b; /* Header/footer color */
}

body.latex-dark .custom-sidenote b {
    color: #89c4f4; /* Header/footer color in dark mode */
}

.custom-sidenote i {
    text-align: right;
    font-style: italic;
    display: block;
    margin-top: 5px;
}

.custom-sidenote p {
    margin: 5px 0;
    line-height: 1.4;
}

/* Ensure sidenotes only display on wide screens */
@media (max-width: 1300px) {
    .custom-sidenote {
        display: none;
    }
}


