/* index.css */
/* Default Styles */
:root {
    --primary-color: #181C14;
    --secondary-color: #3C3D37;
    --accent-color: #181C14;
    --second-accent-color: #181C14;
    --success-color: #606C5D;
    --error-color: #FA9884;
    --background-color: #dddddd55;
    --white-color: #FFFFFF;
    --menu-bg-color: #fffffff2;
    --divider-color: #e0e0e0;


    --chat-color-1: #181C14;
    --chat-color-2: #85A98F;
    --chat-color-3: #697565;
    --chat-color-4: #ECDFCC;
    font-size: 16px;
}

body {
    font-family: "Instrument Sans", 'Noto Sans Arabic', sans-serif;
    background-color: var(--white-color);
    margin: 0;
    padding: 0;
}

.container {
    max-width: 1200px;
    margin: 10px auto;
    background: var(--white-color);
    padding: 10px 20px;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

#back-button {
    font-size: 2.5rem;
    padding-right: 1rem;
}

h1 {
    text-align: center;
    margin-bottom: 30px;
    color: var(--accent-color);
}

h2 {
    margin-bottom: 20px;
    color: var(--accent-color);
}

/* Navbar */
.navbar {
    background-color: var(--background-color);
    padding: 0.5rem 1rem;
    border-bottom: 1px solid var(--secondary-color);
}

.navbar-brand {
    color: var(--second-accent-color);
    font-family: 'Pacifico', cursive;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
}

.navbar-brand:hover {
    color: var(--accent-color);
}

.navbar-brand.brand-nav {
    max-width: 15%;
}

.brand-logo {
    max-width: 100%;
    height: auto;
    min-width: 120px;
    /* Maintain a minimum size for the logo */
}

.logo-icon {
    font-size: 2rem;
    margin-right: 0.5rem;
}

.icon-circle {
    border-radius: 50%;
    padding: 10px;
    background-color: var(--second-accent-color);
    color: var(--white-color);
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    width: 40px;
    height: 40px;
    background-size: cover;
    background-position: center;
}

.icon-circle {
    background-color: var(--accent-color);
}

.add-archive-icon {
    background-color: var(--primary-color);
    color: var(--white-color);
}

.active .icon-circle {
    border: 2px solid var(--white-color);
}

.label {
    margin-top: 5px;
    font-size: 0.9rem;
    text-transform: uppercase;
}

.active .label {
    font-weight: bold;
}

.top-right-menu {
    display: flex;
    align-items: center;
}

.profile-picture {
    /* background-color: var(--white-color); */
    width: 40px;
    height: 40px;
}

.dropdown-profile {
    text-align: center;
    padding: 10px;
}

.dropdown-profile img {
    border-radius: 50%;
    width: 80px;
    height: 80px;
    margin-bottom: 10px;
}

.dropdown-profile h5 {
    margin-bottom: 5px;
}

.dropdown-profile p {
    margin-bottom: 2px;
}

.dropdown-menu .dropdown-item {
    margin-top: 10px;
    padding: 10px;

    &:hover {
        background-color: var(--secondary-color);
        color: white;
    }
}

.dropdown-menu .dropdown-divider {
    margin: 10px 0;
}

/* Navbar links and labels */
.navbar-nav .nav-link {
    color: var(--primary-color);
    margin: 0 10px;
    padding: 0.5rem 1rem;
    /* border-radius: 5px; */
}

.navbar-nav .nav-link:hover {
    color: var(--accent-color);
    /* Text highlight on hover */
}

.navbar-nav .nav-link .label {
    color: var(--primary-color);
    font-size: 0.9rem;
    font-weight: bold;
}

/* Toast notifications */
.toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 1055;
}

.card hr {
    opacity: 1;
}

.select2-container--default .select2-results__option--highlighted {
    background-color: var(--secondary-color) !important;
}

.bootstrap-select .dropdown-menu li a:hover {
    background-color: var(--secondary-color) !important;
}

#back-button {
    display: none !important;
}

.dropdown-profile i {
    background-color: var(--primary-color);
    border-radius: 50%;
    color: var(--white-color);
    padding: 10px;
} 

/* ===================== Media Queries ===================== */

/* Tablets (992px and below) */
@media (max-width: 992px) {
    .container {
        padding: 15px;
        max-width: 90%;
    }

    .navbar-brand.brand-nav {
        flex: 1;
        max-width: 30%;
    }

    .brand-logo {
        max-width: 100%;
        min-width: 120px;
        /* Maintain a reasonable size for tablets */
    }

    .navbar-nav {
        width: 100%;
        display: flex;
        flex-direction: column;
        align-items: flex-start;
    }

    .navbar-nav .nav-link {
        display: flex;
        gap: 1rem;
        align-items: center;
        padding: 0.5rem 1rem;
        text-align: left;
        width: 100%;
        margin: 5px 0;
    }

    .navbar-toggler {
        display: block;
    }

    .icon-circle {
        width: 35px;
        height: 35px;
    }

    .label {
        font-size: 0.8rem;
    }
    ul.nav-menu li,
    #accountMenu {
        width: 100%;
        border-bottom: 1px solid var(--divider-color);
        list-style: none; 
      }
}

/* Mobile phones (767px and below) */
@media (max-width: 767.98px) {
    .navbar-collapse {
        display: none;
    }

    .navbar-collapse.show {
        display: block;
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background-color: var(--menu-bg-color);
        z-index: 1050;
        padding: 1rem 0;
        overflow-y: auto;
    }

    .navbar-nav {
        flex-direction: column;
        align-items: flex-start;
        width: 100%;
        padding-left: 1rem;
    }

    .navbar-nav .nav-item {
        width: 100%;
    }

    .navbar-nav .nav-link {
        padding: .75rem .75rem;
        /* More padding for touch devices */
        margin: 0;
        border-bottom: 1px solid var(--divider-color);
        /* Add visible divider line */
    }

    .navbar-nav .nav-link:last-child {
        border-bottom: none;
        /* Remove divider for last item */
    }

    .brand-logo {
        max-width: 100%;
        min-width: 120px;
        /* Minimum size for logo on smaller screens */
    }

    .icon-circle {
        width: 35px;
        height: 35px;
    }

    .label {
        font-size: 0.8rem;
    }

    .container {
        max-width: 95%;
        padding: 10px;
    }

    #back-button {
        display: flex !important;
    }

    .no-scroll {
        overflow: hidden;
        height: 100%;
    }
}

/* Extra small devices (480px and below) */
@media (max-width: 480px) {

    .icon-circle {
        font-size: 1.3rem;
    }

    .navbar-brand {
        font-size: 1rem;
    }

    .brand-logo {
        min-width: 120px;
        /* Ensure logo never shrinks below 120px */
    }
}

#bookModal{
    
    .book-page:first-child {
        margin-top: 0;
    }

    #bookThumbnail {
        height: 450px;
    }

    .pages-container {
        max-height: 500px;
        overflow-y: auto;
        padding: 10px;
        border: 1px solid var(--divider-color);
        background: var(--menu-bg-color);
    }

    .book-page {
        position: relative;
        background: var(--white-color);
        margin: 10px 0;
        border-radius: 5px;
        box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.2);
        font-family: 'Arial', sans-serif;
        line-height: 1.6;
        min-height: 150px;
        padding: 15px;
        text-align: justify;
    }
    .page-content{
        margin-bottom: 2rem;
    }

    .book-thumbnail {
        display: block;
        margin: 0 auto;
        max-width: 100%;
        /* border-radius: 10px; */
    }

    /* Prevent page number from appearing on the thumbnail */
    .cover-page {
        text-align: center;
    }

    .cover-page .book-thumbnail {
        width: 100%;
        object-fit: contain;
        border-radius: 10px;
        height: 400px;
    }

    .cover-page .page-number {
        display: none;
    }

    /* Page number styling */
    .page-number {
        position: absolute;
        bottom: 10px;
        left: 50%;
        transform: translateX(-50%);
        font-size: 14px;
        /* font-weight: bold; */
        /* color: #4e4f47b4; */
    }

    #viewFullscreenBtn {
        border: none;
        position: absolute;
        z-index: 1;
        right: 4%;
        padding: 10px 12px;
    }

    #viewFullscreenBtn i {
        font-size: 1.5rem;
    }

    .btn:hover {
        color: var(--primary-color) !important;
        /* background-color: var(--white-color) !important; */
    }
    .rtl-text {
        direction: rtl;
        text-align: right;
    }
    #downloadBtn:hover {
        color: var(--white-color) !important;
        background-color: var(--secondary-color) !important;
    }

    /* Fullscreen Mode for Book Pages */
    #bookPagesContainer:fullscreen {
        background: var(--white-color);
        padding: 20px;
        overflow-y: auto;
    }

    #bookPagesContainer:-webkit-full-screen {
        background: var(--white-color);
        padding: 20px;
        overflow-y: auto;
    }

    #bookPagesContainer:-moz-full-screen {
        background: var(--white-color);
        padding: 20px;
        overflow-y: auto;
    }

    #bookPagesContainer:-ms-fullscreen {
        background: var(--white-color);
        padding: 20px;
        overflow-y: auto;
    }
}