/*--------------------------------------------------
   Global Styles
--------------------------------------------------*/
:root {
    --primary-color: #007bff;
    --secondary-color: #005cbf;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --dark-color: #343a40;
    --light-color: #f8f9fa;
    margin: 0 10%;
    background-color: #e9ecef;
}

/*--------------------------------------------------
   Language Handling
--------------------------------------------------*/
:lang(ar) {
    font-family: 'Noto Kufi Arabic', sans-serif;
    direction: rtl;
    font-size: 13px;
    
}

:lang(en) {
    font-family: 'Roboto', sans-serif;
    direction: ltr;
    font-size: 13px;
}
:lang(fr) {
    font-family: 'Roboto', sans-serif;
    direction: ltr;
    font-size: 13px;
}
.arabic-text { font-family: 'Noto Kufi Arabic', sans-serif; }
.non-arabic-text { font-family: 'Roboto', sans-serif; }

/*--------------------------------------------------
   Layout & Structure
--------------------------------------------------*/
    body {
    display: flex;
    flex-direction: column;
    justify-content: center;  /* centers horizontally */
    min-height: 100vh;        /* ensures body takes full viewport height */
    margin : 0 !important;
    }
    
    .container { /* all page  container */
     flex: 1;
     --bs-gutter-x: 0.8rem;
     padding-right: var(--bs-gutter-x, .45rem);
     padding-left: var(--bs-gutter-x, .45rem);
    }
    
    .container.mt-4 { /* index body container for cards */
    
    margin-top:2% !important;
    margin-bottom:2% !important;
    background-color: #fff;
}

.col-4.col-lg-20 { /* all books index body container for cards */
  padding: 0 1% !important;
}

/*--------------------------------------------------
   Navigation
--------------------------------------------------*/
.navbar { /* Navbar body */
    display: flex;
    justify-content: space-between;
    padding : 1% !important;
    
        }

.container-fluid { /* Navbar items container */
    padding: 0 !important;
    gap: 5px;
        }

.navbar-nav { /* menu items container */
        display: flex !important;
        justify-content: space-between;
        flex-direction: row;
        flex-wrap: wrap;
        flex-basis: auto;
        border: 1px solid #ccc;
        border-radius: 5px;
        padding: 1% 0;
        margin :0 auto !important;
    }
.nav-item { /*  items menu */
    margin : 0% 0% !important;
}

.navbar-brand {
    padding: 0;
    margin: 0;
    display: flex;
    align-items: center;
}


/* Library Title */
span.text-white.me-3 {
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
    font-size: clamp(1.2rem, 3vw, 2rem);
    white-space: nowrap;
    margin: 0 15px;
    line-height: 1.3;
    max-width: 85%;
}

.navbar-brand img {
    width: 64px;
    height: auto;
    max-height: 80px;
    transition: transform 0.3s ease;
}

.navbar-brand img:hover {
    transform: scale(1.05);
}

/* Change Language Button */
.d-flex {
    display: flex !important;
    margin-top: auto !important;
    margin-bottom: auto !important;
}
/*--------------------------------------------------
   Typography
--------------------------------------------------*/
h3 {
    color: var(--dark-color);
    text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
    transition: color 0.3s ease;
}

.text-highlight {
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
    white-space: nowrap;
    line-height: 1.3;
}

/*--------------------------------------------------
   Form Elements
--------------------------------------------------*/
.form-control {
    border: 2px solid #ddd;
    border-radius: 0.25rem;
    transition: all 0.3s ease;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 8px rgba(0,123,255,0.5);
}

.form-select {
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
    background-image: none !important;
    padding: 4px 4px !important;
}

/*--------------------------------------------------
   Buttons
--------------------------------------------------*/
.btn-primary {
    background: linear-gradient(145deg, #0069d9, #005cbf);
    border: none;
    border-radius: 5px;
    box-shadow: 4px 4px 8px rgba(0,0,0,0.2),
                -4px -4px 8px rgba(255,255,255,0.5);
    transition: all 0.2s ease;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 2px 2px 4px rgba(0,0,0,0.2),
                -2px -2px 4px rgba(255,255,255,0.5);
}

/*--------------------------------------------------
   Carousel
--------------------------------------------------*/

.row { 
    padding:1% 3%;
}
.index-page .row { /* carousel container */
    padding:1% 3%;
}


.index-library-container .mb-3 { /* top title carousel  */
    width: fit-content;
    background-color: lightgray;
    margin : 15px 2% !important;
    padding:1% 3%;
    font-size: 1.4rem;
    border: 2px solid #ccc;
    border-radius: 5px;
}
/*--------------------------------------------------
   Cards
--------------------------------------------------*/

/* Card Variants */
.borrowers-card .card-header { background-color: var(--primary-color); }
.books-card .card-header { background-color: var(--primary-color); }
.members-card .card-header { background-color: var(--success-color); }
.history-card .card-header { background-color: var(--success-color); }

/*--------------------------------------------------
   index-page
--------------------------------------------------*/
.index-page .card {
  border: 2px solid rgba(0, 0, 0, 0.1); /* Subtle border */
  border-radius: 15px; /* Soft rounded corners */
  box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.1); /* Soft shadow for depth */
  transition: all 0.3s ease-in-out; /* Smooth hover effect */
  overflow: hidden; /* Ensures content stays within rounded edges */
  position: relative; /* Needed for hover effects */
}
.index-page .card-body {
  padding :1%;
}

/* Hover Effect */
.index-page .card:hover {
  border-color: #007bff; /* Blue border on hover */
  box-shadow: 0px 8px 20px rgba(0, 123, 255, 0.2); /* Glow effect */
  transform: translateY(-5px); /* Lift card slightly */
}

/* Optional: Animated Gradient Border */
.index-page .card::before {
  content: "";
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  background: linear-gradient(135deg, #007bff, #00c6ff); /* Gradient */
  border-radius: 17px;
  z-index: -1;
  transition: opacity 0.3s ease-in-out;
  opacity: 0; /* Hidden by default */
}

/* Show gradient on hover */
.index-page .card:hover::before {
  opacity: 1;
}

}
.index-page .card-img-top {
  max-width: 100%; /* Ensures image doesn't exceed the card width */
  height: auto; /* Maintains aspect ratio */
  /*object-fit: cover; /* Ensures the image fills the space properly */
}
.index-page .card-title {
   display: -webkit-box;
  -webkit-line-clamp: 2; /* Ensures max 2 lines */
  -webkit-box-orient: vertical;
  overflow: hidden; /* Hide extra text */
  text-overflow: ellipsis; /* Add "..." when text exceeds 2 lines */
  line-height: 1.3em; /* Line height for proper spacing */
  max-height: 2.6em; /* Forces space for exactly 2 lines */
  min-height: 2.6em; /* Ensures title doesn't shrink below 2 lines */
  text-align: center; /* Centers text horizontally */
  font-size: 1.4rem; /* Ensures readability */
  padding: 1% 1%; /* Prevents text from touching edges */
  margin-bottom : 0;
  word-break: break-word; /* Prevents long words from breaking layout */
  white-space: normal; /* Allows proper text wrapping */
}


/* CSS for Unavailability Overlay */
.index-page .position-relative {
  position: relative;
}
.index-page .unavailable-overlay {
  position: absolute;
  padding: 2%;
  top: 42%;
  left: 0;
  width: 100%;
  height: auto;
  background: rgba(255, 0, 0, 0.7); /* Semi-transparent red overlay */
  display: flex;
  justify-content: center;
  align-items: center;
  color: #fff;
  font-weight: bold;
  font-size: 1.2rem;
  text-align: center;
  z-index: 2;
}

.index-page .d-flex.align-items-center {
    
    justify-content: space-between; /* Example: Align items with space between */
    margin: 0 2%;

}

@media (max-width: 768px) {
    .card-img-top {
  max-width: 100%; /* Ensures image doesn't exceed the card width */
  height: auto; /* Maintains aspect ratio */
  object-fit: cover; /* Ensures the image fills the space properly */
}

.index-page .d-flex.align-items-center {
    
        display: flex !important;
        justify-content: space-between;
        flex-direction: column;
        margin: auto;
        margin-bottom: 2% !important;

}
.index-library-container .mb-3 {

    margin: 15px auto !important;
}

}

/*--------------------------------------------------
   statistics-page
--------------------------------------------------*/

.statistics-page .card-body { /* statistics-page card  */
     display: flex;
     flex-direction: column; /* Stack elements vertically */
     align-items: center;
     gap: 10px; /* Space between elements */
    
}

.mb-4.text-center {
    font-size: 2rem;
    font-weight: 700;
    text-transform: uppercase;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
    position: relative;
    transition: all 0.3s ease;
    padding: 0.1rem 1rem;
    margin-bottom :0px !important;
    border: 2px solid #ccc;
    border-radius: 5px;
}
  /*-- Custom CSS for 5 items per row on desktop --*/
 
    @media (min-width: 992px) {
      .col-lg-20 {
        flex: 0 0 20%;
        max-width: 20%;
      }
    }
  

/*--------------------------------------------------
   DataTables
--------------------------------------------------*/
.dataTables_wrapper {
    margin-top: 20px;
    background: white;
    padding: 20px;
    border-radius: 5px;
    box-shadow: 0 0 10px rgba(0,0,0,0.05);
}

.hidden-col {
    display: none;
}
@media (max-width: 768px) {
    .dataTables_wrapper {
    margin-top: 2%;
    background: white;
    padding: 1%;
    border-radius: 5px;
    box-shadow: 0 0 10px rgba(0,0,0,0.05);

    border: 2px solid #ccc;
    border-radius: 5px;
    }
}
/*--------------------------------------------------
   Footer
--------------------------------------------------*/
.footer {
    display: flex;
    justify-content: space-between; /* Ensure proper alignment */
    align-items: center; /* Center items vertically */
    width: 100%;
    background-color: var(--dark-color);
    color: white;
    padding : 0;
    border-top: 1px solid #ccc;
    }

.align-items-center {
    align-items: center !important;
    padding: 0% !important;

} 
    .footer.mt-5 {
        margin-top : 0 !important;
    }
    .col-md-3 {
        display: flex;
        padding: 1;
        margin: 0;
        flex-wrap: nowrap;
        justify-content: space-evenly;
        align-items: center;
    }    
    .text-start {
        flex: 0 0 30%;
        

    }
    .text-center {
        flex: 0 0 40%;
        text-align: center;
        text-align: center !important;
    }
    
    .text-end {
        flex: 0 0 30%;
        
    }

.footer a {
    color: white;
    text-decoration: none;
    transition: opacity 0.3s ease;
}

.footer a:hover {
    opacity: 0.8;
    text-decoration: underline;
}

@media (max-width: 768px) {
    .text-start {
        flex: 0 0 30%;
        flex-direction: column;

    }
    .text-center {
        flex: 0 0 40%;
        text-align: center;
        text-align: center !important;
    }
    
    .text-end {
        flex: 0 0 30%;
        flex-direction: column;
    }
    }
/*--------------------------------------------------
   soscial links
--------------------------------------------------*/
.social-links {
    display: flex;
    flex-wrap: nowrap;
    gap: 15px; /* Space between icons */
    align-items: center;
    justify-content: center; /* Center icons */
    flex-wrap: wrap; /* Wrap on small screens */
}

.social-links a img {
    width: 24px; /* Adjust icon size */
    height: 24px;
    transition: transform 0.3s ease-in-out; /* Smooth hover effect */
}

.social-links a:hover img {
    transform: scale(1.2); /* Slightly enlarge on hover */
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .social-links {
        gap: 5px; /* Reduce space on small screens */
    }

    .social-links a img {
        width: 1.2rem; /* Slightly smaller icons */
        height: 1.2rem;
    }
}


/*--------------------------------------------------
   Responsive Adjustments
--------------------------------------------------*/
@media (max-width: 768px) {
    :root {
    margin: 0;
    }

    span.text-white.me-3 { /* Library Title */
        font-size: clamp(1.5rem, 2vw, 1.76rem);
        max-width: 80%;
    }
    
        /* Ensure navbar items align in one line in mobile */
    .container-fluid {
        display: contents;
        align-items: center; /* Vertically align items */
        justify-content: space-between; /* Distribute items across the navbar */
        flex-wrap: nowrap; /* Prevent wrapping to a new line */
        margin: 2% 2% !important;
    }
    
    .navbar-brand img {
        width: 48px;
        height: 48px;
    }

    .text-highlight {
        font-size: 1.2rem;
        max-width: 70%;
        margin: 0 0.2rem;
    }
    
    .navbar-nav {/* menu item container in mobile */
    display: flex;
    flex-direction: row !important;
    padding-left: 5;
    padding-right: 5;
    margin-bottom: 0;
    list-style: none;
    justify-content: space-between;
    flex-wrap: wrap;
    border: 1px solid #ccc;
    border-radius: 5px;
    padding: 1% 1%;
    margin :0 auto !important;
    }
    .nav-item { /*  items menu in mobile */
    margin : 0% 1% !important;
    }
    
  .footer {
    font-size: 0.8rem !important; /* Adjust size of centre text in footer */
    }
  
  .btn-danger {
    font-size: 0.9rem !important;
    padding: 2% !important;
    margin: 5%;
    }
      .btn-warning {
    font-size: 0.9rem !important;
    padding: 2% !important;
    margin: 5%;
    }
}


/*--------------------------------------------------
   Auth Forms (Login/Register)
--------------------------------------------------*/
.container.mt-6 {
  margin: auto;
  background-color: #f0f0f0; /* example background */
  padding: 3%;           /* example padding */
}
.auth-container {
    max-width: 400px;
    margin: auto;
    padding: 20px;
    background: white;
    border-radius: 0.5rem;
    border: 3px solid var(--primary-color);
    box-shadow: 0 8px 20px rgba(0,0,0,0.12),
                0 4px 12px rgba(0,0,0,0.1),
                3px 3px 0 var(--primary-color),
                -3px -3px 0 var(--primary-color);
    transform: perspective(1000px) rotateX(2deg) rotateY(1deg);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative;
    overflow: hidden;
}

auth-container::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    border: 2px solid rgba(255,255,255,0.2);
    border-radius: 0.5rem;
    pointer-events: none;
}

.auth-container:hover {
    transform: perspective(1000px) rotateX(1deg) rotateY(0.5deg) translateY(-4px);
    box-shadow: 0 12px 24px rgba(0,0,0,0.15),
                0 6px 16px rgba(0,0,0,0.12),
                5px 5px 0 var(--primary-color),
                -5px -5px 0 var(--primary-color);
}

.auth-container .card-header {
    background: linear-gradient(145deg, var(--primary-color), var(--secondary-color));
    border-bottom: 3px solid rgba(255,255,255,0.2);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    position: relative;
    z-index: 1;
}

.auth-container .card-header::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
}
.auth-container .btn-primary {
    margin-top: 1rem;
}

.toggle-form {
    cursor: pointer;
    color: var(--primary-color);
    text-decoration: underline;
}

.error-message {
    background: var(--danger-color);
    color: white;
    padding: 0.75rem;
    border-radius: 0.25rem;
    margin-bottom: 1rem;
}

.success-message {
    background: var(--success-color);
    color: white;
    padding: 0.75rem;
    border-radius: 0.25rem;
    margin-bottom: 1rem;
}

/*--------------------------------------------------
   Print Styles
--------------------------------------------------*/
@media print {
    .navbar, .footer, .dataTables_length, .dataTables_filter {
        display: none !important;
    }
    
    .dataTables_wrapper {
        padding: 0;
        box-shadow: none;
    }
}
/*--------------------------------------------------
Scrolling Text Line: Students Who Borrowed the Most and Events
--------------------------------------------------*/
/* Container for the scrolling line */
.scrolling-line {
 
    border: 1px solid #ccc;
  border-radius: 5px;
  overflow: hidden;
  background: #f8f9fa;
  margin: 1%;
  font-size: 1.1rem;
  display: flex;
 flex-direction: column;
  align-items: center;
}

/* Fixed title that does not scroll */
.scrolling-title {
  flex: 0 0 auto;
  white-space: nowrap;
  font-weight: bold;
}

/* Container for the scrolling content */
.scrolling-content {
  width: 100%
  flex: 1;
  position: relative;
}
.separator {
  margin: 0 10px; /* Adjust the 10px to your desired spacing */
}

/* Wrapper holding duplicated content */
.scrolling-content-wrapper {
  display: flex;
  white-space: nowrap;
  /* No fixed width so that the content’s width is determined by its content */
  animation: scroll-text 20s linear infinite;
}

/* Each scrolling text block with an added gap */
.scrolling-text {
  display: inline-block;
  white-space: nowrap;
  margin-right: 100px; /* Adjust this gap as needed to prevent overlapping */
}

/* Keyframes for scrolling animation */
@keyframes scroll-text {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-50%);
  }
}

/* Color classes for student names */
.scrolling-line .male {
  color: #007bff;  /* Blue for male */
}

.scrolling-line .female {
  color: #e83e8c;  /* Pink for female */
}

/* Special styling for the top borrower (golden bright color) */
.scrolling-line .top-borrower {
  color: #FFD700;  /* Golden bright color */
}

.happy-birthday {
  color: #ff69b4; /* Bright pink */
  font-weight: bold;
  font-size: 1.1em;
  text-shadow: 0 0 1px #fff, 0 0 20px #ff69b4, 0 0 15px #ff69b4;
  background: linear-gradient(45deg, #ff9a9e, #fad0c4);
  -webkit-background-clip: text;
  -webkit-text-fill-color: #007bff;
  padding: 0 5px;
  border-radius: 4px;
}

@keyframes birthdayGlow {
  0% {
    text-shadow: 0 0 5px #fff, 0 0 10px #ff69b4, 0 0 15px #ff69b4;
  }
  50% {
    text-shadow: 0 0 10px #fff, 0 0 20px #ff69b4, 0 0 30px #ff69b4;
  }
  100% {
    text-shadow: 0 0 5px #fff, 0 0 10px #ff69b4, 0 0 15px #ff69b4;
  }
}


/*--------------------------------------------------
    Book Card Styling 
--------------------------------------------------*/
/* Book Card Styling */
.card-book-page .card {
    border-radius: 12px;
    box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: transform 0.3s ease-in-out, box-shadow 0.3s;
}
.card-book-page div.row.g-0 {
    display: flex;
    align-items: center;
    justify-content: space-evenly;
}

.card-book-page .card:hover {
    transform: translateY(-5px);
    box-shadow: 0px 6px 15px rgba(0, 0, 0, 0.15);
}

/* Book Image Styling (40% size) */
.card-book-page .card img.img-fluid {
    width: 65%;
    height: auto;
    display: block;
    margin: 2% auto;
    padding : 1%;
    
    border-radius: 12px;
    box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    
    object-fit: cover;
    transition: transform 0.3s ease-in-out;
}

.card-book-page .card img.img-fluid:hover {
    transform: scale(1.05);
}

/* Book Details */
.card-book-page .card-body {
    padding: 20px;
    position: relative;    /* establish a “positioning context” */
}



.card-book-page .card-title {
    font-size: 1.8rem;
    font-weight: bold;
    color: #333;
}

.card-book-page .card-text {
    font-size: 1rem;
    color: #555;
    margin-bottom: 10px;
}

.card-book-page .card-text strong {
    color: #222;
}

/* Borrowing Stats */
.card-book-page .col-md-8 .card-body .card-text:last-of-type {
    font-weight: bold;
    color: #007bff;
}

/* Rating Form */
.card-book-page .card-header {
    color: black;
    font-weight: bold;
    font-size: 1.2rem;
    background: #f8f9fa;
    border-bottom: 1px solid #ddd;
}

.card-book-page .form-select, 
.card-book-page .form-control {
    border-radius: 6px;
    border: 1px solid #ddd;
    padding: 10px;
}

.card-book-page .btn-primary {
    background: #007bff;
    border-radius: 6px;
    padding: 10px 15px;
    font-size: 1rem;
    transition: background 0.3s;
}

.card-book-page .btn-primary:hover {
    background: #0056b3;
}

/* Comments Section */
.card-book-page .card-body .border-bottom {
    padding-bottom: 10px;
    margin-bottom: 10px;
    border-bottom: 1px solid #ddd;
}

.card-book-page .card-body strong {
    font-size: 1rem;
    color: #000;
}

.card-book-page .text-muted {
    font-size: 0.9rem;
    color: #999;
}

.card-book-page .card-title.small.text-truncate.mb-0 {
   display: -webkit-box;
  -webkit-line-clamp: 2; /* Ensures max 2 lines */
  -webkit-box-orient: vertical;
  overflow: hidden; /* Hide extra text */
  text-overflow: ellipsis; /* Add "..." when text exceeds 2 lines */
  line-height: 1.3em; /* Line height for proper spacing */
  max-height: 2.6em; /* Forces space for exactly 2 lines */
  min-height: 2.6em; /* Ensures title doesn't shrink below 2 lines */
  text-align: center; /* Centers text horizontally */
  font-size: 0.7rem; /* Ensures readability */
  padding: 1% 1%; /* Prevents text from touching edges */
  margin-bottom : 0;
  word-break: break-word; /* Prevents long words from breaking layout */
  white-space: normal; /* Allows proper text wrapping */
}

.card-book-page .unavailable-overlay span {
  position: absolute;
  padding: 2%;
  top: 42%;
  left: 0;
  width: 100%;
  height: auto;
  background: rgba(255, 0, 0, 0.7); /* Semi-transparent red overlay */
  display: flex;
  justify-content: center;
  align-items: center;
  color: #fff;
  font-weight: bold;
  font-size: 0.7rem;
  text-align: center;
  z-index: 2;
}

.card-book-page .mt-5 {
   text-align: center;
   margin-bottom: 2rem;
   margin-top: 0px !important;
}
.card-book-page .mb-3 {
  font-weight: bold;
  font-size: 1.2rem;
}

.card-book-page .d-flex {
    justify-content: space-evenly;
}
/* Modern Rating Stars */
.rating {
    display: flex;
    flex-direction: row-reverse;
    justify-content: center;
    align-items: center;
    gap: 5px;
}

.rating input {
    display: none;
}

.rating label {
    font-size: 30px;
    color: #ccc;
    cursor: pointer;
    transition: color 0.3s ease-in-out, transform 0.2s;
}

.rating label:hover,
.rating label:hover ~ label,
.rating input:checked ~ label {
    color: #FFD700; /* Golden stars */
    transform: scale(1.1);
}

/* color average Rating Stars */

.rating {
  display: flex;
  align-items: center;
  gap: 5px;
}

.rating .star {
  font-size: 24px;
  color: #ccc; /* Default gray color */
  cursor: pointer;
  position: relative;
}

.rating .star.filled {
  color: #FFD700; /* Golden color for filled stars */
}

.rating .star.half-filled {
  color: #ccc; /* Gray for the base star */
  position: relative;
}

.rating .star.half-filled::before {
  content: '★';
  position: absolute;
  color: #FFD700; /* Golden color for the half-fill */
  width: 50%; /* Half-fill the star */
  overflow: hidden;
  z-index: 1;
}

/* RTL-Specific Styles */
[dir="ltr"] .rating {
  flex-direction: row; /* Reverse the order of stars */
} 

[dir="ltr"] .rating .star.half-filled::before {
  right: auto;
  left: 0; /* Align half-fill to the right in LTR mode */
}

/* RTL-Specific Styles */
[dir="rtl"] .rating {
  flex-direction: row-reverse; /* Reverse the order of stars */
}

[dir="rtl"] .rating .star.half-filled::before {
  left: auto;
  right: 0; /* Align half-fill to the right in RTL mode */
}

/* Pop Animation */
@keyframes pop {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* Comment Section Styling */
.comment-box {
    background: #f9f9f9;
    border-radius: 8px;
    padding: 15px;
    margin-top: 15px;
}

.comment-box textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    resize: none;
}

/* Responsive Design */
@media (max-width: 768px) {
    .card-book-page .card {
        flex-direction: column;
        text-align: center;
    }

    .card-book-page .card img.img-fluid {
        width: 60%;
        margin: 0 auto;
    }

    .card-book-page .card-body {
        padding: 15px;
    }
}

/* carousel-control */
.carousel-control-prev,
.carousel-control-next {
  width: 48px;
  height: 48px;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.3);
  backdrop-filter: blur(6px);
  border-radius: 50%;
  box-shadow: 0 8px 16px rgba(0,0,0,0.2);
  opacity: 0.9;
  transition: all 0.3s ease;
  z-index: 10;
}

.carousel-control-prev:hover,
.carousel-control-next:hover {
  background: rgba(255, 255, 255, 0.3);
  border-color: rgba(255, 255, 255, 0.5);
  box-shadow: 0 12px 20px rgba(0,0,0,0.3);
  opacity: 1;
}

.carousel-control-prev-icon,
.carousel-control-next-icon {
  background-size: 20px 20px;
  background-repeat: no-repeat;
  background-position: center;
  filter: invert(1) drop-shadow(0 0 1px black); /* crisp white */
}

/* Make sure the jQuery UI menu floats above the modal */
.ui-autocomplete {
  z-index: 2000 !important;
}