/* styles.css */

@font-face {
    font-family: 'Euclid Circular A'; /* Choose a name for your custom font */
    src: url('/fonts/EuclidCircularA-Regular.otf') format('opentype'); /* Path to the font file and its format */
    font-weight: normal; /* Define the font weight */
    font-style: normal; /* Define the font style */
}

@font-face {
    font-family: 'Euclid Circular A'; /* Choose a name for your custom font */
    src: url('/fonts/EuclidCircularA-Light.otf') format('opentype'); /* Path to the font file and its format */
    font-weight: lighter; /* Define the font weight */
    font-style: normal; /* Define the font style */
}

@font-face {
    font-family: 'Euclid Circular A'; /* Choose a name for your custom font */
    src: url('/fonts/EuclidCircularA-Semibold.otf') format('opentype'); /* Path to the font file and its format */
    font-weight: 600; /* Define the font weight */
    font-style: normal; /* Define the font style */
}

@font-face {
    font-family: 'Euclid Circular A'; /* Choose a name for your custom font */
    src: url('/fonts/EuclidCircularA-Bold.otf') format('opentype'); /* Path to the font file and its format */
    font-weight: 700; /* Define the font weight */
    font-style: normal; /* Define the font style */
}

:root {
    /* Light mode colors */
    --background-color: #ffffff;
    --text-color: #1b212c;
    --toggle-btn-background-color: #f8f8f8;
    --link-card-background-color: #e8e9ea;
    --link-card-button-background-color: #ffffff;
    --chat-options-border: 1px solid #ebebeb;
    --chat-bubble-user-color: #ffffff;
    --chat-bubble-user-bg-color: #1b212c;
    --tag-button-color: #1b212c; 
    --tag-button-border: 1px solid #e8e9ea;
    --tag-button-background-color: #e8e9ea;
    --tag-button-color-selected: #ffffff; 
    --tag-button-border-selected: 1px solid #1b212c;
    --tag-button-background-color-selected: #1b212c;
}

body.dark-mode {
    /* Dark mode colors */
    --background-color: #10141a;
    --text-color: #e8e9ea;
    --toggle-btn-background-color: #31323b;
    --link-card-background-color: #323741;
    --link-card-button-background-color: #5f646b;
    --chat-options-border: 1px solid #494d56;
    --chat-bubble-user-color: #0b0d12;
    --chat-bubble-user-bg-color: #e8e9ea;
    --tag-button-color: #e8e9ea; 
    --tag-button-border: 1px solid #323741;
    --tag-button-background-color: #323741;
    --tag-button-color-selected: #10141a; 
    --tag-button-border-selected: 1px solid #e8e9ea;
    --tag-button-background-color-selected: #e8e9ea;
}

/* Ensure body is scrollable */
body {
    font-family: 'Euclid Circular A', Arial, sans-serif;
    font-weight: lighter;
    background-color: var(--background-color);
    color: var(--text-color);
    height: 100%;   
    min-height: 100vh; /* Set height to full viewport height */
    display: flex; /* Flexbox to center container */
    justify-content: center; /* Center horizontally */
    align-items: flex-start; /* Align content at the top to ensure full scrollability */
    overflow-y: auto; /* Always show vertical scrollbar */
    margin: 0;
    padding: 0;
    transition: background-color 0.5s ease, color 0.2s ease;  /*Smooth transition for background and text color */
    -webkit-overflow-scrolling: touch; /* Enable smooth scrolling on iOS */
}

@-webkit-keyframes fadeIn {
    0% {
        opacity: 0;
    }
    100% {
        opacity: .9;
    }
}

@keyframes fadeIn {
    0% {
        opacity: 0;
    }
    100% {
        opacity: .9;
    }
}

@-webkit-keyframes fadeInUp {
    0% {
        opacity: 0;
        -webkit-transform: translateY(30px); /* Start from 30px below */
        transform: translateY(30px); /* Start from 30px below */
    }
    100% {
        opacity: 1;
        -webkit-transform: translateY(0); /* End at original position */
        transform: translateY(0); /* End at original position */
    }
}

@keyframes fadeInUp {
    0% {
        opacity: 0;
        transform: translateY(30px); /* Start from 30px below */
    }
    100% {
        opacity: 1;
        transform: translateY(0); /* End at original position */
    }
}

b {
    font-weight: 600; /* Set the <b> tag to use a font weight of 600 */
}

.pro-image {
    opacity: 0; /* Initially hidden */
    animation: fadeIn .8s ease forwards;
    animation-delay: .2s; /* Staggered effect for different sections */
}

.intro,
.intro-links,
.chat-section,
.intro-timestamp,
.timestamp,
.new-buttons,
.about-info,
.pm-resources-info,
.bookshelf-info,
.odds-ends-info {
    opacity: 0; /* Initially hidden */
    -webkit-animation: fadeInUp .8s ease forwards;
    animation: fadeInUp .8s ease forwards;
    animation-delay: 0.2s; /* Staggered effect for different sections */
}

/* Profile container styles */
.profile-container {
    margin: 0 auto;
    padding: 10px 20px 80px 20px;
    width: 100%;
    max-width: 480px; /* Max width for container */
    box-sizing: border-box;
}

.pro-image {
    width: 100px;
    height: auto;
    display: block; /* Converts the image to a block-level element */
    margin: 60px auto 40px auto; /* Centers the image horizontally */
}

.intro {
    margin: 90px 0 4px 0;
    max-width: 384px;
}

.intro a,
.intro a:active,
.intro a:visited,
.intro a:focus,
.intro a:hover,
.intro a:link {
    color: inherit;
    text-decoration: none;
    cursor: text;
}

.intro p {
    margin: 0 0 4px 0;
    background-color: var(--link-card-background-color);
    padding: 8px 12px;
    border-radius: 4px 16px 16px 4px;
    width: fit-content;
    transition: background-color 0.5s ease, color 0.5s ease; /* Smooth transition for background and text color */
}

.message p {
    margin: 0 0 4px 0;
    background-color: var(--link-card-background-color);
    padding: 8px 12px;
    border-radius: 4px 16px 16px 4px;
    width: fit-content;
    max-width: 360px;
}

.links,
.intro-links {
    justify-content: space-between;
    margin-bottom: 8px;
    text-decoration: none;
    display: flex; /* Use flexbox to create a horizontal layout */
    gap: 4px; /* Space between each link */
    overflow-x: auto; /* Enable horizontal scrolling if necessary */
    -ms-overflow-style: none;  /* Hide scrollbar in Internet Explorer and Edge */
    scrollbar-width: none;  /* Hide scrollbar in Firefox */
    padding-right: 100px;
}

.links::-webkit-scrollbar {
    display: none;
}

.link-card {
    max-width: 232px;
    background-color: var(--link-card-background-color);
    border-radius: 4px;
    display: flex;
    flex-direction: column; 
    transition: background-color 0.5s ease, color 0.5s ease; /* Smooth transition for background and text color */
}

.link-card p {
    padding: 0;
    margin: 8px 0 8px 12px;
    font-size: .9em;
}

.link-card a {
    font-weight: bold; /* Make the text bold */
    text-decoration: none; /* Remove the underline */
    color: inherit; /* Inherit the color from the parent element */
    align-self: flex-start; /* Align buttons to the start of the container */
    margin-top: auto;

}

.link-card img {
    width: 100%;
    border-radius: 4px 4px 0 0;
    margin: 0;
}

.link-card button {
    width: 216px;
    height: 28px;
    font-size: 1em;
    font-family: 'Euclid Circular A', Arial, sans-serif;
    margin: 0 8px 12px 8px;
    background-color: var(--link-card-button-background-color);
    color: var(--text-color);
    border: none;
    border-radius: 28px;
    cursor: pointer;
    vertical-align: bottom;
    transition: background-color 0.5s ease, color 0.5s ease; /* Smooth transition for background and text color */
}

.chat-section {
    padding: 0;
    margin: 0;
}

.chat-section p {
    margin: 0 0 10px 0;
}

.chat-options button {
    padding: 4px 8px;
    margin: 0 0 4px 0;
    color: var(--text-color);
    background-color: var(--background-color);
    font-size: 1em;
    font-family: 'Euclid Circular A', Arial, sans-serif;
    border: var(--chat-options-border);
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.5s ease, color 0.2s ease;
}

.chat-message {
    display: flex;
    justify-content: flex-end; /* Aligns messages to the left by default */
    margin: 24px 0;
}

.chat-message.user {
    justify-content: flex-end; /* Aligns user messages to the right */
}

.chat-bubble {
    max-width: 70%; /* Limit bubble width for better readability */
    padding: 10px;
    border-radius: 16px 4px 4px 16px;
    color: #333;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.chat-bubble.user {
    background-color: var(--chat-bubble-user-bg-color); /* Different color for user messages */
    color: var(--chat-bubble-user-color);
}

/* Books list styles */
.books-list {
    display: flex; /* Use flexbox to create a horizontal layout */
    margin-top: 8px;
    gap: 4px; /* Space between each book */
    overflow-x: auto; /* Enable horizontal scrolling if necessary */
    -ms-overflow-style: none;  /* Hide scrollbar in Internet Explorer and Edge */
    scrollbar-width: none;  /* Hide scrollbar in Firefox */
    padding: 0 100px 0 0px;
}

/* Hide scrollbar in Webkit-based browsers (Chrome, Safari, etc.) */
.books-list::-webkit-scrollbar {
    display: none;
}

.book-image {
    width: auto; /* Set a fixed width for the book images */
    height: 200px; /* Maintain aspect ratio */
    margin: 0;
    border-radius: 4px; /* Optional: rounded corners for images */
}

.tag-button {
    padding: 6px 12px;
    margin: 0 0 4px 0;
    color: var(--tag-button-color);
    background-color: var(--tag-button-background-color);
    font-size: .8em;
    font-family: 'Euclid Circular A', Arial, sans-serif;
    border: var(--tag-button-border);
    border-radius: 16px;
    cursor: pointer;
}

.tag-button.selected {
    color: var(--tag-button-color-selected);
    background-color: var(--tag-button-background-color-selected);
    border: var(--tag-button-border-selected);
}

/* Art section styles */
.art-list {
    display: flex; /* Use flexbox to create a horizontal layout */
    gap: 10px; /* Space between each book */
    overflow-x: auto; /* Enable horizontal scrolling if necessary */
    -ms-overflow-style: none;  /* Hide scrollbar in Internet Explorer and Edge */
    scrollbar-width: none;  /* Hide scrollbar in Firefox */
    padding: 0 100px 0 8px;
}

/* Hide scrollbar in Webkit-based browsers (Chrome, Safari, etc.) */
.art-list::-webkit-scrollbar {
    display: none;
}

.art {
    flex: 0 0 auto; /* Prevent the book images from shrinking */
}

.art-image {
    width: auto; /* Set a fixed width for the book images */
    height: 200px; /* Maintain aspect ratio */
    display: block;
    margin: 0;
    border-radius: 2px; /* Optional: rounded corners for images */
}

.art-tag-button {
    padding: 4px 8px;
    margin: 0 0 4px 0;
    color: var(--tag-button-color);
    background-color: var(--tag-button-background-color);
    font-size: .8em;
    font-family: 'Euclid Circular A', Arial, sans-serif;
    border: var(--tag-button-border);
    border-radius: 12px;
    cursor: pointer;
}

.art-tag-button.selected {
    color: var(--tag-button-color-selected);
    background-color: var(--tag-button-background-color-selected);
    border: var(--tag-button-border-selected);
}

/* New buttons section styles */
.new-buttons {
    margin-top: 8px;
}

.new-buttons button {
    padding: 4px 8px;
    margin: 0 0 4px 0;
    color: var(--text-color);
    background-color: var(--background-color);
    font-size: 1em;
    font-family: 'Euclid Circular A', Arial, sans-serif;
    border: var(--chat-options-border);
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.5s ease, color 0.2s ease;
}

.timestamp,
.intro-timestamp {
    font-size: .7em;
    color: #a4a6ab;
    padding: 0;
    margin: 4px 8px;
}

/* Media query for smaller screens */
@media (max-width: 480px) {
    .profile-container {
        padding: 12px 8px 72px 12px;
    }
    
    .pro-image {
        margin: 20px auto; /* Centers the image horizontally */
}
    
    .intro p {
        max-width: 304px;
    }    
    
    .message p {
        max-width: 304px;
    }
    .link-card {
        max-width: 232px; /* Stack link cards on small screens */
    }

    .feedback-form, .books-list, .contact-info {
        padding: 10px;
    }

    .feedback-form input, .feedback-form textarea {
        padding: 6px;
        margin-bottom: 10px;
    }
}

.toggle-container {
        text-align: right;
}

/* The toggle switch */
.switch {
    position: relative;
    display: inline-block;
    width: 42px;  /* Full width of the switch (including 5px border on both sides) */
    height: 26px; /* Height of the switch (including 5px border on top and bottom) */
    -webkit-tap-highlight-color: transparent; /*Control the Default Touch Highlight: On touch devices, browsers provide a default highlight to indicate that an element is being tapped or activated.*/
}

/* Hide the default checkbox */
.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

/* Custom tooltip styling */
.switch::before {
    content: 'Toggle scheme';
    position: absolute;
    bottom: -115%;
    left: -70%;
    background: var(--toggle-btn-background-color);
    color: var(--text-color);
    padding: 5px 10px;
    margin-top: 4px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    transition: opacity .3s ease;
}

.switch:hover::before {
    opacity: 1;
}

/* The slider itself */
.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #10141a; /* Default background color */
    transition: 0.1s;
    border-radius: 26px; /* Fully rounded */
    border: 5px solid #ffffff; /* 5px border around the slider */
}

/* The circle inside the slider */
.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 28px;
    left: 6px; /* Position adjusted due to the 5px border */
    top: 0;
    bottom: 0;
    background-color: white; /* Circle color */
    transition: 0.2s;
    border-radius: 26px;
}

/* When checked (dark mode), change background and move circle */
input:checked + .slider {
    background-color: #10141a; /* Dark mode background */
    border: 5px solid #10141a;
}

/* Change the circle's position and color on toggle */
input:checked + .slider:before {
    transform: translateX(8px); /* Circle will move to the right on toggle */
    width: 16px;
    height: 16px;
    background-color: white;
    left: 8px;
    top: 0;
    border-radius: 50%; /* Circle */
}

/* Hover effect for better interactivity */
.slider:hover {
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.2); /* Slight glow effect on hover */
}
