    body {
      font-family: Arial, sans-serif;
      margin: 4px;
    }

    h1 {
      text-align: center;
      margin: 20px 0;
    }

    form {
      max-width: 600px;
      margin: auto;
      padding: 20px;
      border: 1px solid #ccc;
      border-radius: 10px;
      background-color: #f9f9f9;
    }

    /*_______________________________________________Navbar Styling _____________________________________*/
    .navbar {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        z-index: 9999 !important;
        transition: all 0.1s ease;
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 1rem 2rem;
        background-color: #000;
        color: #fff;
        font-weight: bold;
        margin: 0; /* Remove margin-bottom */
        width: 100%;
        box-sizing: border-box;
    }

    .navbar.shrink {
        padding: 0.1rem 1rem;
        background-color: rgba(0, 0, 0, 1); /* Fully opaque */
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    }

    .navbar.shrink .brand-logo {
        /* Keep logo at original size */
        transform: none;
    }

    .navbar.shrink svg {
        width: 32px;
        height: 32px;
    }

    .navbar.shrink .logo span {
        font-size: 1rem;
    }

    .navbar.shrink .brand-text {
        font-size: 1.1rem;
    }

    .navbar.shrink .nav-icon {
        width: 20px;
        height: 20px;
    }

    .navbar.shrink .logo-icon {
       transform: none;
    }

    .navbar.shrink .profile-avatar {
        width: 28px;
        height: 28px;
    }

    /* Add padding to body to prevent content from hiding under navbar */
    body {
        padding-top: 80px; /* Adjust this value based on your navbar height */
        margin: 0;
    }

    /* Brand Logo */
    .brand-logo {
        display: flex;
        align-items: center;
        gap: 10px;
        text-decoration: none;
        color: #f0f0f0;
        transition: all 0.3s ease;
    }

    .brand-logo .logo-icon {
        width: 48px;
        height: 28px;
        stroke-width: 2;
        color: #f0f0f0;
        transition: all 0.3s ease;
    }

    .brand-logo .brand-text {
        font-size: 1.3rem;
        font-weight: 600;
        letter-spacing: -0.5px;
        transition: all 0.3s ease;
    }

    /* Keep logo + hamburger together */
    .left-section {
        display: flex;
        align-items: center;
        flex: 0 0 auto; /* Don’t let it grow/shrink */
        white-space: nowrap; /* No line-breaks within logo/hamburger */
        gap: 1rem;
    }

    /* The welcome message is flexible and can wrap if necessary */
    #welcome-msg {
        flex: 1 1 auto;
        text-align: center;
        margin: 0 1rem;
        white-space: normal;
        font-size: 1rem;
    }

    /* Navigation List */
    .nav-list {
        display: flex;
        align-items: center;
        list-style: none;
        margin: 0;
        padding: 0;
        gap: 20px;
    }

    /* Keep nav links on one line as well */
    .nav-links {
        list-style: none; 		/* Removes bullets */
        padding: 0;
        margin: 0;
        display: flex;
        flex: 0 0 auto; 		/* Don’t let it grow/shrink */
        white-space: nowrap;   	/* No line-breaks within the nav links */
        gap: 1rem;
    }

    .navbar.logged-in .nav-links {
        justify-content: flex-end; /* Align to the right when logged in */
    }

    /* Individual Nav Items & Links */
    .nav-item {
        position: relative;
    }

    .nav-item >a {
        color: inherit;
        text-decoration: none;
        display: flex;
        align-items: center;
        position: relative;
        padding: 8px;
        border-radius: 50%;
        transition: background-color 0.2s ease-in-out, color 0.2s ease-in-out;
    }

    /* Example link styling */
    .nav-links a {
        text-decoration: none;
        color: white;
        padding: 0.5rem 1rem;
        border-radius: 5px;
        transition: background 0.3s;
    }

    /* SVG Icon Styling */
    .nav-icon {
        width: 24px;
        height: 24px;
        stroke: currentColor;
        stroke-width: 1.5;
        fill: none;
        transition: all 0.3s ease;
    }

    /* Dropdown styles */
    .dropdown {
        position: relative;
        display: flex;
        align-items: center;
    }

    .dropdown-toggle {
        text-decoration: none;
        color: white;
        padding: 0.5rem 1rem;
        border-radius: 5px;
        transition: background 0.3s;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .dropdown-menu {
        top: 100%;
        display: none;
        position: absolute;
        right: 0;
        background-color: #2a2a2a;
        min-width: 160px;
        box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
        border-radius: 4px;
        padding: 0.5rem 0;
        margin-top: 0.5rem;
        z-index: 10000;
    }

    .dropdown.active .dropdown-menu {
        display: block;
    }

    .dropdown-menu li {
        display: block;
    }

    .dropdown-menu a {
        padding: 0.5rem 1rem;
        display: block;
    }

    /* Profile Item & Dropdown */
    .profile-trigger {
        display: flex;
        align-items: center;
        gap: 6px;
        cursor: pointer;
        padding: 4px;
        border-radius: 20px;
        transition: background-color 0.2s ease-in-out;
        border: 2px solid transparent;
    }

    .profile-trigger.is-active {
        border-color: #fff;
        background-color: #333;
    }

    .profile-avatar {
        width: 32px;
        height: 32px;
        background-color: #444;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: all 0.3s ease;
    }

    .profile-avatar .nav-icon {
        width: 20px;
        height: 20px;
    }

    .profile-trigger .chevron-icon {
        width: 16px;
        height: 16px;
        stroke: #a0a0a0;
        transition: transform 0.2s ease;
    }

    .profile-trigger.is-active .chevron-icon {
        transform: rotate(180deg);
    }

    /* Login Link Styling */
    .login-link {
        display: flex;
        align-items: center;
        gap: 6px;
        padding: 8px 12px;
        border-radius: 20px;
        transition: background-color 0.2s ease-in-out;
        text-decoration: none;
        color: #f0f0f0;
    }

    /* Profile Dropdown Menu */
    .profile-dropdown {
        position: absolute;
        top: calc(100% + 10px);
        right: 0;
        background-color: #2a2a2a;
        border-radius: 8px;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
        min-width: 260px;
        z-index: 10000;
        padding: 8px 0;
        opacity: 0;
        transform: translateY(-10px);
        pointer-events: none;
        transition: opacity 0.2s ease, transform 0.2s ease;
        max-height: 80vh; /* Limit to 80% of viewport height */
        overflow-y: auto; /* Enable vertical scrolling */
        overflow-x: hidden; /* Hide horizontal scrollbar */
        scroll-behavior: smooth;
    }

    .profile-dropdown.is-active {
        opacity: 1;
        transform: translateY(0);
        pointer-events: auto;
    }

    .dropdown-header {
        padding: 8px 20px;
        margin-bottom: 8px;
    }

    .dropdown-header .username {
        font-weight: bold;
        font-size: 1.1em;
        color: #f0f0f0;
    }

    .dropdown-header .profile-link {
        font-size: 0.9em;
        color: #a0a0a0;
        text-decoration: none;
    }

    .dropdown-divider {
        height: 1px;
        background: #444;
        margin: 8px 0;
    }

    .dropdown-section-header {
        padding: 8px 20px;
        font-size: 0.75em;
        font-weight: bold;
        text-transform: uppercase;
        color: #a0a0a0;
        letter-spacing: 0.5px;
    }

    .dropdown-menu-list {
        list-style: none;
        padding: 0;
        margin: 0;
    }

    .dropdown-menu-item a {
        display: flex;
        align-items: center;
        gap: 15px;
        padding: 10px 20px;
        text-decoration: none;
        color: #f0f0f0;
        transition: none;
    }

    .dropdown-menu-item .menu-icon {
        width: 20px;
        height: 20px;
        stroke-width: 1.5;
        color: #a0a0a0;
    }

    /* Unread messages badge styling */
    .unread-badge, .notification-badge {
        position: absolute;
        top: 0px;
        right: 0px;
        background-color: #e63946;
        color: white;
        border-radius: 50% !important;
        padding: 0 !important;
        font-size: 11px;
        font-weight: bold;
        width: 18px !important;
        height: 18px !important;
        display: none; /* Hide by default */
        align-items: center !important;
        justify-content: center !important;
        border: 2px solid #1a1a1a;
        box-shadow: 0 1px 3px rgba(0,0,0,0.3);
        box-sizing: border-box !important;
        z-index: 10;
    }
        /* Show the badge when it has the .show class (for notifications) or when it exists (for messages) */
    .unread-badge, .notification-badge.show {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* Ensure messages link can contain the badge */
    #messages-link {
        position: relative !important;
    }

    /* Guest Only Items */
    .guest-only {
        display: none;
    }

    /* Logged In Only Items */
    .logged-in-only {
        display: none;
    }

    .sr-only {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        margin: -1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
        border-width: 0;
    }

    @media screen and (min-width: 768px) {
        .nav-item a:hover {
            background-color: #333;
            color: #ffffff;
        }

        .nav-links a:hover {
            background-color: #357abd;
        }

        .login-link:hover {
            background-color: #333;
            border-radius: 20px; 
        }

        .dropdown-menu-item a:hover {
            background-color: rgba(255, 255, 255, 0.1);
            border-radius: 0; /* Completely rectangular */
        }
    }

    /* Mobile styles */
    @media screen and (max-width: 768px) {
        .navbar {
            position: fixed; /* Keep fixed on mobile too */
            top: 0;
            left: 0;
            right: 0;
            z-index: 9999;
            padding: 10px 15px;
        }
        
        .navbar.shrink {
            padding: 5px 15px;
        }
        
        .navbar.permanent-shrink {
            padding: 5px 15px;
        }

        .hamburger {
            display: flex;
            position: absolute;
            top: 15px;
            right: 20px;
            text-align: center;
            align-items: center;
        }

        .nav-list {
            gap: 0px;
            padding-right: 0;
            padding-left: 0;
        }
        
        .brand-logo .brand-text {
            display: none;
        }
        
        .hide-on-mobile {
            display: none;
        }

        .nav-links {
            display: none;		/* Typically toggled via .active class */
            flex-direction: column;
            position: absolute;
            top: 50px;		
            right: 20px;		/* Align with the hamburger */
            width: auto;		/* Shrinks to fit the content */
            background-color: #000000;
            padding: 1rem;
            border-radius: 5px;
            box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.1);
            text-align: center;
        }

        .nav-links.active {
            display: flex;
            align-items: flex-end;	/* Align text to the right */
        }

        .nav-links a {
            text-align: right; /* Ensure text is aligned to the right */
            display: block; /* Ensure full-width click area */
        }
        
        .nav-profile-pic {
            width: 24px;
            height: 24px;
        }        
    }

    @media (max-height: 600px) {
        .profile-dropdown {
            max-height: 70vh;
        }
    }

/*________________________________________ Notification POPUP styles ________________________________*/
    .notification-popup {
        position: absolute;
        top: 100%;
        right: 0;
        width: 430px;
        min-height: 250px;
        max-height: 450px;
        background: white;
        border: 1px solid #e1e8ed;
        border-radius: 8px;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
        z-index: 1000;
        display: none;
        overflow: hidden;
    }
    
    .notification-popup.is-active {
        display: block;
    }
    
    .notification-header {
        padding: 16px;
        border-bottom: 1px solid #e1e8ed;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    
    .notification-header-title {
        font-weight: 600;
        font-size: 16px;
        color: #14171a;
    }
        
    .notification-header-subtitle {
        font-size: 13px;
        color: #1991db;
        text-decoration: none;
        font-weight: 500;
        transition: color 0.3s ease;
    }

    .notification-header-subtitle:hover {
        color: #049cfa; /* Optional: slightly darker text on hover */
        transform: scale(1.15);
        text-decoration: underline;
    }
    
    .notification-list {
        max-height: 300px;
        overflow-y: auto;
    }
    
    .notification-item {
        padding: 12px 16px;
        border-bottom: 1px solid #e1e8ed;
        position: relative;
        transition: background-color 0.2s;
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
    }
    
    .notification-item:hover {
        background-color: #f7f9fa;
    }
    
    .notification-item.unread {
        background-color: #e8f4fd;
        border-left: 3px solid #1da1f2;
        border-bottom-color: #c7ddef; /* Make bottom border of unread items more distinct */
        margin-bottom: 5px; /* Add a small margin to create a visual gap after unread items */
    }
    
    .notification-content {
        flex: 1;
        margin-right: 8px;
    }
    
    .notification-text {
        font-size: 14px;
        font-weight: normal; /* Override navbar's bold font-weight */
        color: #14171a;
        line-height: 1.4;
        margin-bottom: 4px;
    }
    
    .notification-time {
        font-size: 12px;
        color: #657786;
    }
    
    .notification-actions {
        flex-shrink: 0;
        margin-left: 8px;
        position: relative;
        display: flex;
        align-items: center;
    }
    
    .notification-menu-trigger {
        padding: 4px;
        cursor: pointer;
        border-radius: 50%;
        transition: background-color 0.2s;
        display: flex;
        align-items: center;
        justify-content: center;
        width: 24px;
        height: 24px;
        background-color: #f1f1f1;
    }
    
    .notification-menu-trigger:hover {
        background-color: #e1e8ed;
    }
    
    .notification-menu-trigger svg {
        width: 16px;
        height: 16px;
        fill: #657786;
    }
    
    .notification-dropdown {
        position: absolute;
        top: 100%;
        right: 0;
        background: white;
        border: 1px solid #e1e8ed;
        border-radius: 8px;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
        z-index: 1001;
        display: none;
        min-width: 120px;
        overflow: hidden;
    }
    
    .notification-dropdown.is-active {
        display: block;
    }
    
    .notification-dropdown-item {
        display: flex;
        align-items: center;
        gap: 8px;
        padding: 8px 12px;
        border: none;
        background: none;
        width: 100%;
        text-align: left;
        font-size: 13px;
        color: #14171a;
        cursor: pointer;
        transition: background-color 0.2s;
    }
    
    .notification-dropdown-item:hover:not(:disabled) {
        background-color: #f7f9fa;
    }
    
    .notification-dropdown-item:disabled {
        opacity: 0.5;
        cursor: not-allowed;
    }
    
    .notification-dropdown-item.mark-read {
        color: #1da1f2;
    }
    
    .notification-dropdown-item.clear {
        color: #e0245e;
    }
    
    .notification-dropdown-item svg {
        width: 14px;
        height: 14px;
        stroke: currentColor;
        fill: none;
        stroke-width: 2;
    }
    
    .notification-footer {
        padding: 12px 16px;
        border-top: 1px solid #e1e8ed;
        text-align: center;
    }

    .notification-footer-btn {
        padding: 8px 16px;
        font-size: 13px;
        border: 1px solid #1da1f2;
        background-color: #1da1f2;
        color: white;
        border-radius: 4px;
        cursor: pointer;
        transition: all 0.2s;
        text-align: center;
        width: 100%;
    }
    
    .notification-footer-btn:hover:not(:disabled) {
        background-color: #1991db;
        border-color: #1991db;
    }
    
    .notification-footer-btn:disabled {
        opacity: 0.5;
        cursor: not-allowed;
    }
    
    .notification-empty {
        padding: 40px 16px;
        text-align: center;
        color: #657786;
        font-size: 14px;
    }
    
    .notification-loading {
        padding: 40px 16px;
        text-align: center;
        color: #657786;
        font-size: 14px;
    }
    
    .notification-error {
        padding: 20px 16px;
        text-align: center;
        color: #e0245e;
        font-size: 14px;
        background-color: #fdf2f2;
        border: 1px solid #fecaca;
        margin: 8px;
        border-radius: 4px;
    }
    
    .nav-item {
        position: relative;
    }
    
    .notification-trigger {
        cursor: pointer;
        padding: 8px;
        border-radius: 50%;
        transition: background-color 0.2s ease-in-out;
        display: flex;
        align-items: center;
        justify-content: center;
        position: relative;
    }

    .notification-icon {
      width: 40px;
      height: 40px;
      border-radius: 50%;
      background-color: #1da1f2;
      display: flex;
      align-items: center;
      justify-content: center;
      flex-shrink: 0;
      margin-right: 10px;
    }

    .notification-icon svg {
      width: 20px;
      height: 20px;
      stroke: white;
      fill: none;
    }
    
    @media (min-width: 768px) {
      .notification-trigger:hover {
        background-color: #333;
      }
    }
    
/* Mobile-specific styles */
@media (max-width: 768px) {
  #notification-popup {
    position: fixed;
    right: 10px;
    left: 10px;
    top: auto;
    bottom: auto;
    min-width: auto;
    max-width: none;
    width: calc(100vw - 20px);
    max-height: 70vh;
    transform: translateY(10px);
  }
  
  /* Adjust popup positioning relative to navbar */
  .navbar.shrink #notification-popup {
    top: 60px; /* Adjust based on your shrunken navbar height */
  }
  
  .navbar:not(.shrink) #notification-popup {
    top: 80px; /* Adjust based on your full navbar height */
  }
}

/* Very small screens */
@media (max-width: 480px) {
  #notification-popup {
    right: 5px;
    left: 5px;
    width: calc(100vw - 10px);
    max-height: 60vh;
  }
}

/* Notification list items mobile optimization */
@media (max-width: 768px) {
  .notification-item {
    padding: 12px;
    font-size: 14px;
  }
  
  .notification-content {
    flex: 1;
    min-width: 0; /* Allow text to wrap */
  }
  
  .notification-text {
    word-wrap: break-word;
    overflow-wrap: break-word;
  }
  
  .notification-actions {
    flex-shrink: 0;
    margin-left: 8px;
  }
  
  .notification-menu-trigger {
    padding: 8px;
    min-width: 32px;
    min-height: 32px;
  }
}



/*________________________________Add-books and edit-books pages_______________________________*/

    .form-group {
      margin-bottom: 15px;
    }

    .form-group label {
      display: block;
      font-weight: bold;
      margin-bottom: 5px;
    }

    .form-group input,
    .form-group textarea,
    .form-group select {
      width: 97%;
      padding: 12px; /* Increased padding */
      border: 1px solid #ccc;
      border-radius: 5px;
      font-size: 16px; /* Increased font size */
    }

    .form-group textarea {
      min-height: 120px;
      resize: vertical;
    }
    
    .form-group .radio-group {
      display: flex;
      justify-content: center; /* Centers the radio buttons horizontally */
      gap: 20px;
    }

    .form-buttons {
      display: flex;
      justify-content: center;
      gap: 20px; /* Adds spacing between the buttons */
    }
    
    .form-buttons button {
      padding: 10px 20px;
      border: none;
      font-size: 16px;
      border-radius: 5px;
      cursor: pointer;
    }

    .confirm-btn {
      background-color: #007bff;
      color: white;
    }

    .confirm-btn:hover {
      background-color: #0056b3;
    }

    .cancel-btn {
      background-color: #dc3545;
      color: white;
    }

    .cancel-btn:hover {
      background-color: #a71d2a;
    }

    .hidden {
      display: none;
    }
    #condition {
        width: 101.6%;
        height: 45px;
        font-size: 16px; /* Optional: to increase the font size inside the select */
    }

/*________________________________Adding and editing images containers_______________________________*/

    .preview-container {
      width: 200px;
      height: 200px;
      border: 2px dashed #ccc;
      margin: 10px 0;
      display: flex;
      align-items: center;
      justify-content: center;
      overflow: hidden;
      margin: 0 auto;
      text-align: center;
    }
    .preview-container img {
      max-width: 100%;
      max-height: 100%;
      object-fit: contain;
      display: block;
      margin: 0 auto;
      max-width: 100%;
      height: auto; 
    }

    .upload-label {
      display: block;
      font-size: 16px;
      font-weight: 600;
      color: #333;
      margin-bottom: 10px;
    }
    .image-upload-container {
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
    }
    /* Container for each image upload item */
    .image-item-container {
      background-color: #fff;
      border: 1px solid #ddd;
      margin-bottom: 20px;
      border-radius: 6px;
      box-shadow: 0 2px 4px rgba(0,0,0,0.1);
      padding: 10px;
      /* Provide horizontal spacing */
      margin-right: 20px;
      margin: 10px;
      text-align: center;
      display: inline-block;
      width: 280px;
      box-sizing: border-box;
      vertical-align: top;
    }

    /* Preview container */
    .preview-container img {
      max-width: 100%;
      height: auto;
      display: block;
      margin-top: 10px;
    }

    /* The file input and the capture button */
    .image-upload-input, .capture-button {
      box-sizing: border-box; /* Important! */
      width: 100%;
      padding: 12px;
      margin: 5px 0;
      border: 1px solid #ccc;
      border-radius: 5px;
      font-size: 16px;
      background-color: white;
      cursor: pointer;
    }

    .clear-button {
      background-color: #dc3545;
      color: white;
      padding: 4px 8px;
      border: none;
      border-radius: 6px;
      cursor: pointer;
      margin-top: 10px;
    }

    .capture-button {
        background-color: #007bff;
        color: white;
        border: none;
    }
    .clear-button {
        background-color: #ff6b6b;  /* Red color matching your delete-btn style */
        color: white;
        border: none;
    }
    @media (min-width: 768px) {  /*Disabled hovering on mobile as it keeps the hover button after un-checking*/
      .clear-button:hover {
        background-color: #c82333;  /* Darker red on hover */
      }
    }

    @media screen and (max-width: 768px) {
      .image-item-container {
          width: 100%;
          margin: 10px 0;
      }
  
      .preview-container {
          width: 100%;
          max-width: 300px;
      }
  
      .image-upload-input, 
      .capture-button {
          width: 100%;
          max-width: 300px;
      }
   }

/*_________________________________________________Edit modal________________________________________*/

  /* Modal container (hidden by default) */
  .modal {
    display: none; /* Hidden initially */
    position: fixed;
    z-index: 1000; /* Ensure it appears above other elements */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5); /* Semi-transparent background */
  }

  /* Modal content */
  .modal-content {
    background-color: white;
    margin: 20% auto; /* Centered vertically */
    padding: 20px;
    width: 300px;
    border-radius: 10px;
    text-align: center;
  }

  /* Close button */
  .close {
    float: right;
    font-size: 24px;
    cursor: pointer;
  }

/*________________________________________________Table styles_______________________________________*/
  /* Container */
  .books-container {
    max-width: 1300px;
    margin: 0px auto;
    padding: 0px;
    padding-bottom: 3px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  }
  .books-container h1 {
    text-align: center;
    margin-bottom: 10px;
    color: #000000;
  }
  /* Table */
  table {
    width: 100%;
    border-collapse: collapse;
    margin: 25px 0;
    font-size: 0.9em;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.15);
    border-radius: 5px;
    overflow: hidden;
  }

  thead tr {
    background-color: #000000;
    color: #ffffff;
    text-align: center;
  }

  table th:nth-child(1) {
    width: 1%;
  }

  table th:nth-child(2) {
    width: 10%;
  }

  table th:nth-child(3), table th:nth-child(4) {
    width: 15%;
  }
  table th:nth-child(5), table th:nth-child(6) {
    width: 10%;
  }

  @media (min-width: 768px) {
    table th:nth-child(3), table th:nth-child(4) {
      min-width: 100px;
    }
  }

  /* Specific width rules for borrow-books-table */
  .borrow-books-table th:nth-child(2) {
    width: 5%;
  }
  .borrow-books-table th:nth-child(3) {
    width: 15%;
  }
  .borrow-books-table th:nth-child(4) {
    width: 10%;
  }
  .borrow-books-table th:nth-child(7) {
    width: 9%;
  }

  .borrow-books-table th:nth-child(8) {
    width: 7%;
  }

  .favorites-books-table th:nth-child(7) {
    width: 10%;
  }

  .search-books-table th:nth-child(7) {
    width: 10%;
  }
  	
  th[data-sort] {
    position: relative;
    cursor: pointer;
    user-select: none;
  }

  th[data-sort]:after {
    content: '⇅';  /* Larger double arrow */
    position: absolute;
    right: 12px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 1.2em;
    font-weight: bold;
  }

  th[data-sort]:hover:after {
    color: rgba(255, 255, 255, 1);
  }

  th[data-sort].sort-asc:after {
    content: '⇑';  /* Large up arrow */
    color: white;
  }

  th[data-sort].sort-desc:after {
    content: '⇓';  /* Large down arrow */
    color: white;
  }

  td, th {
      padding: 12px 15px;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      max-width: 200px;
      white-space: normal;
  }

  tbody tr:nth-child(odd):not(.details-row) {
      border-top: 1px solid #ddd;
  }
  
  .centered-text {
    text-align: center;
  }

  tbody tr:hover {
      background-color: #f4f4f4 !important;
  }

  .mobile-only-details {
    display: none;
  }

  @media screen and (max-width: 768px) {
    /* Hide availability and edited columns on mobile */
    table {
      margin: 0px 0; /* Reduced from 25px 0 */
    }
    th:nth-child(5),
    th:nth-child(6),
    th:nth-child(7),
    .free-books-table th:nth-child(8),
    .buy-books-table th:nth-child(8),
    .buy-books-table th:nth-child(9),
    .borrow-books-table th:nth-child(10),

    td:nth-child(5),
    td:nth-child(6),
    td:nth-child(7),
    .free-books-table td:nth-child(8),
    .buy-books-table td:nth-child(8),
    .buy-books-table td:nth-child(9),
    .borrow-books-table td:nth-child(10)
    {
        display: none;
    }
    /*Borrow's 7th col = Period; free's 7th col = Added date; buy 7th col = Price*/
    .borrow-books-table th:nth-child(6),
    .borrow-books-table td:nth-child(6),
    .borrow-books-table th:nth-child(8),
    .borrow-books-table td:nth-child(8),
    .borrow-books-table th:nth-child(9),
    .borrow-books-table td:nth-child(9),
    .free-books-table th:nth-child(6),
    .free-books-table td:nth-child(6),
    .buy-books-table th:nth-child(6),
    .buy-books-table td:nth-child(6),
    .buy-books-table th:nth-child(8),
    .buy-books-table td:nth-child(8),
    .user-books-table th:nth-child(7),
    .user-books-table td:nth-child(7),
    .my-books-table th:nth-child(6),
    .my-books-table td:nth-child(6),
    .my-books-table th:nth-child(7),
    .my-books-table td:nth-child(7),
    .favorites-books-table th:nth-child(8),
    .favorites-books-table td:nth-child(8),
    .favorites-books-table th:nth-child(9),
    .favorites-books-table td:nth-child(9),
    .favorites-books-table th:nth-child(10),
    .favorites-books-table td:nth-child(10),
    .search-books-table th:nth-child(6),
    .search-books-table td:nth-child(6)
    {
        display: table-cell;
    }

    /* Adjust remaining columns for better mobile display */
    td, th {
        padding: 4px;
        font-size: 12px;
    }

    /* Make thumbnail smaller on mobile */
    td:nth-child(2) img {
        max-width: 50px !important;
    }

    td:nth-child(3), td:nth-child(4) {
      max-width: 90px !important;
      
    }

    /* Make table scroll horizontally if needed */
    .table-container {
        position: relative;
       -webkit-overflow-scrolling: touch; /* For iOS */
    }

      /* Show these values in details section only on mobile */
      .mobile-only-details {
        display: block;
    }
    .mobile-only-details.owner-detail {
      display: flex;
      align-items: center;
    }
}

  /*____________________________Message_the_owner and Favorites Buttons____________________________*/

  /* Common base style for all three buttons */
  .message-owner,
  .favorite-btn {
    border: none;               /* or a subtle border if you prefer */
    border-radius: 5px;
    padding: 5px 8px;
    font-size: 14px;
    cursor: pointer;
    font-weight: 600;
    color: #fff;                /* white text on colored backgrounds */
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 4px;                /* spacing between buttons */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15); /* subtle shadow */
  }

  .message-owner {
    background-color: #A2D5AB;  /* muted sage green */
  }
  .message-owner:hover {
    background-color: #82B58E;  /* slightly darker on hover */
  }

  .favorite-btn {
    background-color: #2E86AB;  /* muted blue-gray */
  }
  @media (min-width: 768px) {  /*Disabled hovering on mobile as it keeps the hover button after un-checking*/
    .favorite-btn:hover {
      background-color: #21638A;  /* darker blue-gray on hover */
    }
  }

  @media (max-width: 768px) {
    .message-owner,
    .favorite-btn {
      padding: 6px 8px;
      font-size: 8px;
    }
    .message-owner {
      background-color: #4b8d57;  /* muted sage green */
    }
  }

  /*_______________________Edit&Delete buttons used in My Books and Private________________________*/
    
  .edit-btn, .delete-btn, .view-matches-btn {
    border: none;                     
    border-radius: 5px;
    padding: 5px 8px;
    font-size: 14px;
    font-weight: 600;
    color: #fff;                      /* white text on coloured backgrounds */
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 4px;                      /* spacing between buttons */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
  }

  /* Edit Button */
  .edit-btn {
    background-color: #A2D5AB;        /* pastel green */
    border: 1px solid #82B58E;        /* slightly darker green border */
    font-weight: bold;
    text-decoration: none;
  }

  .edit-btn:hover {
    background-color: #82B58E;        /* darker on hover */
    border-color:    #608A6A;         /* even deeper accent */
  }
  
  .view-matches-btn {
    background-color: #A2C5F5;        /* soft pastel blue */
    border: 1px solid #82A5D8;        /* slightly darker blue border */
    font-weight: bold;
    text-decoration: none;
  }
  .view-matches-btn:hover {
    background-color: #82A5D8;        /* darker on hover */
    border-color:    #5A84B2;         /* deeper accent */
  }

  /* Delete Button */
  .delete-btn {
    background-color: #D26060;        /* muted red */
    border: 1px solid #AA4C4C;        /* deeper red border */
    font-weight: bold;
    color: #fff;
  }

  .delete-btn:hover {
    background-color: #AA4C4C;        /* darker red on hover */
    border-color:    #883A3A;         /* even deeper accent */
  }

  /* Adjust action buttons for mobile */
  @media screen and (max-width: 768px) {
    .edit-btn,
    .delete-btn,
    .view-matches-btn {
      padding: 4px 6px;
      font-size: 12px;                /* bumped to 12px for readability on small screens */
    }
  }



  /*___________________________________________Details_row__________________________________________*/
  .details-row {
    display: none;
    background: #f5f5f5;
  }

  .details-row.expanded {
      display: table-row;
  }
  .show-details-col {
    width: 10px; /* Adjust as needed */
    text-align: center;
  }

  .toggle-details {
    border: 2px solid #d39e00;
    border-radius: 5px;
    padding: 8px 12px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.2);
    background-color: #F7C948;
    color: white;
    font-weight: bold;
  }

  .toggle-details.expanded {
      transform: rotate(90deg);
  }

  .details-content {
    display: grid;
    grid-template-columns: 3fr 2fr; /* Creates two equal columns */
    gap: 20px; /* Adds space between the columns */
    padding: 15px;
  }

  .toggle-details:hover {
    background-color: #e0a800;
    border-color: #d39e00;
  }

  .details-grid {
      display: grid;
      grid-template-columns: repeat(1, 1fr);
      gap: 10px;
      margin-bottom: 15px;
  }

  @media (max-width: 768px) {
    .details-content {
      grid-template-columns: 1fr;
      /*grid-template-columns: 2fr 3fr;*/
    }
    /* Show these values in details section */
    .details-content .details-grid {
      display: grid;
      grid-template-columns: 1fr;
      gap: 10px;
    }

    /* Add new divs for the hidden column data */
    .details-content .details-grid div.mobile-only {
        display: block;
    }

    /* Adjust action buttons for mobile */
    .toggle-details {
        padding: 4px 8px;
        font-size: 8px;
    }
  }

/*__________________________________________Images_and_swiper_styles________________________________*/
    .book-images {
      position: relative;
      overflow: hidden;
      height: auto;
      width: 90%;
      min-height: 200px;
      text-align: center;
      display: flex;
      justify-content: center;
      align-items: center;
    }

    .book-images img {
      max-width: 100%;
      max-height: 300px;
      object-fit: contain;

    }

    .book-images:empty {
      display: none;
    }

    @media (max-width: 768px) {
      .book-images {
        width: 100% !important; /* or 95%, etc. if you need some padding */
        max-width: none;
        height: auto; 
      }
      .book-images img {
        max-width: 100%; /* instead of 90% */
        height: auto;
        margin: 15px auto;
      }
    }
    /* Swiper container: ensure it is positioned relative so that navigation arrows are contained */
    .swiper-container {
      width: 100%;
      height: 100%;
      margin: auto;    /* Center the container within the table cell */
      position: relative;
      box-sizing: border-box;
      padding: 0 0px; /* Reserve space for the arrows on each side */
    }

    /* Navigation arrows styling */
    .swiper-button-next,
    .swiper-button-prev {
      color: #fff;              /* or your preferred color */
      position: absolute;
      top: 50%;
      
      z-index: 10;
    }

    /* Make images responsive */
  .swiper-slide img {
    width: 30%; /* Default size */
    border-radius: 10px;
    transition: width 0.5s ease, transform 0.5s ease;
  }

  /* Highlight the active slide (centered one) */
  .swiper-slide-active {
      opacity: 1; /* Fully visible */
      transform: scale(1.2); /* Make it bigger */
  }

  /* Make the active image larger */
  .swiper-slide-active img {
      width: 100%; /* Increase size for active image */
      transform: scale(1.1); /* Slightly enlarge */
  }

/*___________________________________________Fullscreen Modal Swiper________________________________*/

    /* Fullscreen modal styling */
    #modalSlider {
      display: none;
      position: fixed;
      z-index: 1000;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      background: rgba(0,0,0,0.9);
    }
    body.modal-open {
      overflow: hidden;
    }

    #modalSlider .swiper-slide {
      display: flex;
      align-items: center;
      justify-content: center;
      height: 100%;
    }
    
    #modalSlider .swiper-slide img {
      max-width: 85vw;
      max-height: 85vh;
      object-fit: contain;
      display: block;
      margin: auto;
    }

    #modalSlider.active {
      display: block;
    }
    #modalSlider .swiper-container {
      width: 100%;
      height: 100%;
    }
    #modalSlider .close-modal {
      position: absolute;
      top: 40px;
      right: 20px;
      font-size: 40px;
      color: #fff;
      cursor: pointer;
      z-index: 1100;
    }

/*____________________________________________Map Modal and buttons_________________________________*/
    /* Modal styles */
    .map-modal {
      display: none; 
      position: fixed;
      z-index: 1000;
      left: 0;
      top: 0;
      width: 100%;
      height: 100%;
      overflow: auto;
      background-color: rgba(0,0,0,0.5);
    }
    .map-modal-content {
      background-color: #fefefe;
      margin: 5% auto;
      padding: 20px;
      border: 1px solid #888;
      width: 90%;
      max-width: 600px;
      height: 80%;
      position: relative;
    }
    #map {
      height: calc(100% - 60px);
      width: 100%;
    }
    .map-close {
      color: #aaa;
      position: absolute;
      top: 10px;
      right: 20px;
      font-size: 28px;
      font-weight: bold;
      cursor: pointer;
      z-index: 1100;
    }
    .map-confirm-btn {
      position: absolute;
      background-color: #007bff;
      color: #fff;
      border: none;
      bottom: 20px;
      left: 50%;
      transform: translateX(-50%);
      padding: 10px 20px;
      font-size: 16px;
      z-index: 1100;
    }
    /* New Target Button styled like Google Maps */
    .map-target-btn {
      position: absolute;
      bottom: 185px;
      right: 23px;
      width: 48px;
      height: 48px;
      border: none;
      border-radius: 50%;
      background: #fff;
      box-shadow: 0 2px 6px rgba(0,0,0,0.3);
      cursor: pointer;
      z-index: 1100; /* ensure always on top */
      display: flex;
      align-items: center;
      justify-content: center;
    }
    /* Outer circle */
    .map-target-btn::before {
      content: "";
      display: block;
      width: 30px;
      height: 30px;
      border: 2px solid #FF5722;
      border-radius: 50%;
      position: relative;
    }
    /* Inner circle */
    .map-target-btn::after {
      content: "";
      position: absolute;
      width: 14px;
      height: 14px;
      background: #FF5722;
      border-radius: 50%;
    }

    @media (max-width: 600px) {
      .map-modal {
        top: 7%;
        align-items: center;
        justify-content: center;
        padding: 0;                  /* remove any default page padding */
      }
    }

/*___________________________________________Autocomplete and helpers_______________________________*/
    .city-search-container {
      position: relative;
      margin: 3px;
      width: 400px;
    }

    #city-search {
      width: 103%;
      padding: 8px;
      font-size: 15px;
      border: 1px solid #ccc;
      border-radius: 4px;
    }

    #autocomplete-suggestions {
      border: 1px solid #ccc;
      max-height: 300px;
      overflow-y: auto;
      position: absolute;
      width: 115%;
      background-color: white;
      z-index: 10;
    }

    #autocomplete-suggestions:empty {
        display: none;
    }

    .autocomplete-item {
      padding: 8px;
      cursor: pointer;
    }

    .autocomplete-item:hover {
      background-color: #f0f0f0;
    }

    .link {
      font-weight: bold;
      color: blue;
    }

    #radius-select {
      margin-top: 8px;
      padding: 8px;
      width: 24%;
      border: 1px solid #ccc;
      border-radius: 4px;
      font-size: 14px;
    }

    .autocomplete-item.selected {
      background-color: #e0e0e0;
    }
    
    /* Specific styling for the city search in the "add" form */
    .city-search-container-add,
    .city-search-container-edit,
    .city-search-container-my-profile{
      position: relative;
      margin: 3px;
      width: 100%;
    }

    .city-search-container-add #city-search,
    .city-search-container-edit #city-search
    {
      width: 98%;
      padding: 8px;
      font-size: 16px;
      border: 1px solid #ccc;
      border-radius: 4px;
    }

    .city-search-container-my-profile #city-search
    {
      width: 96%;
      padding: 8px;
      font-size: 16px;
      border: 1px solid #ccc;
      border-radius: 4px;
    }

    .city-search-container-add #autocomplete-suggestions,
    .city-search-container-edit #autocomplete-suggestions
    {
      width: 100.5%;
      background-color: #fff;  /* Make sure it's visible */
    }

    .city-search-container-my-profile #autocomplete-suggestions
    {
        width: 99%;
    }

    #radius-select[hidden] {
      display: none !important; 
      /* ensures it doesn't occupy any space at all */
    }

    @media (max-width: 768px) {
      .city-search-container {
        width: 100%;
        margin: 5px 0;
      }
      #city-search {
        width: 72%;
        box-sizing: border-box;
      }
      #radius-select {
        width: 28%;
        margin-top: 0px;
      }
    }

    /* Advanced filters container styling */
    .advanced-filters {
      display: none; /* Hidden by default */
      background-color: #f9f9f9;
      border: 1px solid #eee;
      border-radius: 8px;
      padding: 5px;
      width: 135%;
      margin-top: 10px;
      box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    }

    .advanced-filters.active {
      display: block;
    }

    /* Advanced filters toggle button */
    .advanced-filters-toggle {
      min-width: 250px;
      background-color: #f0f0f0;
      border: 1px solid #ddd;
      border-radius: 4px;
      padding: 6px 12px;
      font-size: 14px;
      cursor: pointer;
      margin-top: 5px;
      transition: background-color 0.2s;
    }

    .advanced-filters-toggle:hover {
      background-color: #e0e0e0;
    }

    /* Fix for radius select width */
    .advanced-filters #radius-select {
      margin-top: 8px;
      padding: 8px;
      width: 24%;
      min-width: 80px; /* Ensure minimum width */
      border: 1px solid #ccc;
      border-radius: 4px;
      font-size: 14px;
      box-sizing: border-box; /* Include padding in width calculation */
    }

    /* Language input styling to match city-search */
    .advanced-filters #language {
      width: 99.5%;
      padding: 8px;
      font-size: 15px;
      border: 1px solid #ccc;
      border-radius: 4px;
      box-sizing: border-box;
    }

    .language-container {
      margin-top: 5px;
      margin-left: 3px;

    }

    /* Responsive adjustments */
    @media (max-width: 768px) {
      .advanced-filters-toggle {
        width: 100%; /* Make it full width on mobile */
      }
      .advanced-filters {
        width: 100%;
      }
      .city-search-container, 
      .language-container {
        width: 100%;
        margin: 5px 0;
      }
      .advanced-filters #city-search {
        width: 72%;
        box-sizing: border-box;
      }
      .advanced-filters #language {
        width: 100%;
        box-sizing: border-box;
      }
      #radius-select {
        width: 28%;
        margin-top: 0;
      }
      #sort-container{
        align: right;
      }
    }

    .language-select-container {
      position: relative;
      width: 100%;
    }
    
    .language-matrix-dropdown {
      display: none;
      position: absolute;
      width: 95%;
      max-height: 300px;
      overflow-y: auto;
      background-color: #fff;
      border: 1px solid #ccc;
      border-radius: 4px;
      z-index: 1000;
      box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    }
    
    .language-matrix-dropdown.show {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      gap: 5px;
      padding: 10px;
    }
    
    .language-option {
      padding: 8px;
      cursor: pointer;
      border-radius: 3px;
    }
    
    .language-option:hover {
      background-color: #f0f0f0;
    }
    
    .language-native-name.primary {
      font-weight: bold;
    }
    
    .language-name.secondary {
      font-size: 0.85em;
      color: #666;
    }
    
    [data-valid="false"] {
      border-color: #ff6b6b;
      background-color: #fff0f0;
    }
    
    @media (max-width: 768px) {
      .language-matrix-dropdown.show {
        grid-template-columns: repeat(2, 1fr);
      }

/* Mobile-specific alignment for sort-container */
      .sort-container {
        display: flex;
        align-items: center;
        gap: 10px;
        justify-content: flex-end; /* Align to the right */
        width: 100%; /* Take full width of parent */
        margin-top: 5px; /* Add some space from elements above */
      }
      #combinedSort {
        font-size: 0.85rem;
        width: 140px;
      }
    }

/*_____________________________Slider helpers helpers_________________________*/
    .price-container, .borrow-guarantee-container, .borrow-period-container {
      width: 95%;
      max-width: 600px;
      margin: 5px auto;
      padding: 10px;
      border: 1px solid #ccc;
      border-radius: 5px;
      background-color: #f9f9f9;
      font-family: Arial, sans-serif;
      font-size: 15px;
    }

    /* Label above the slider */
    .price-heading, .borrow-guarantee-heading, .borrow-period-heading {
      color: rgba(0, 0, 0, 0.54);
      display: block;
      margin-bottom: 0px;
    }

    /* Wraps track + thumbs */
    .slider-container {
      position: relative;
      width: 100%;
      height: 32px; /* Enough to center thumbs */
      margin-bottom: 2px;
    }

    /* The grey track */
    .slider-track {
      position: absolute;
      top: 50%;
      left: 0;
      width: 100%;
      height: 6px;
      background: #ddd;
      border-radius: 3px;
      transform: translateY(-50%);
    }

    /* Both range inputs superimposed */
    .slider-container input[type=range] {
      position: absolute;
      top: 50%;
      left: 0;
      width: 100%;
      height: 0;
      pointer-events: none;
      -webkit-appearance: none;
      background: none;
      transform: translateY(-50%);
    }

    /* The visible track (only for WebKit) */
    .slider-container input[type=range]::-webkit-slider-runnable-track {
      height: 6px;
      background: transparent;
    }

    /* Thumb styling */
    .slider-container input[type=range]::-webkit-slider-thumb {
      -webkit-appearance: none;
      pointer-events: all;
      width: 20px;
      height: 20px;
      margin-top: -7px; /* (thumb-height - track-height)/2 * -1 */
      background: #007bff;
      border: 2px solid #fff;
      border-radius: 50%;
      box-shadow: 0 0 3px rgba(0,0,0,0.3);
      cursor: pointer;
    }
    .slider-container input[type=range]::-moz-range-thumb {
      pointer-events: all;
      width: 20px;
      height: 20px;
      background: #007bff;
      border: 2px solid #fff;
      border-radius: 50%;
      cursor: pointer;
    }

    /* Container for the two labels */
    .values-container {
      display: flex;
      justify-content: space-between;
      font-size: 14px;
      font-weight: bold;
    }

    #minSlider, #maxSlider {
      position: relative;
    }

/*_____________________________Country flags helpers__________________________*/
    .autocomplete-item {
      display: flex;
      justify-content: space-between;
      align-items: center;
    }
    
    .country-flag {
      margin-left: 10px;
      height: 16px;
      width: 24px;
      display: flex;
      align-items: center;
      flex-shrink: 0; /* Prevent flag from shrinking */
    }
    
    .country-flag svg {
      height: 100%;
      width: auto;
    }
    
    .input-flag-container {
      position: absolute;
      right: 10px;
      top: 50%;
      transform: translateY(-50%);
      height: 16px;
      width: 24px;
      display: flex;
      align-items: center;
      pointer-events: none;
      z-index: 1; /* Ensure flag appears above input content */
    }
    
    .input-flag-container svg {
      height: 100%;
      width: auto;
    }
    
    /* Adjust the input padding to make room for the flag */
    #city-search {
      padding-right: 40px;
     
    }
    
    @media (max-width: 768px) {
      .city-search-container {
        width: 100%;
        margin: 5px 0;
      }
      
      #city-search {
        width: 100%;
        box-sizing: border-box;
      }
      
      #autocomplete-suggestions {
        width: 100%;
        max-width: 100%;
      }
      
      .autocomplete-item {
        font-size: 14px; /* Smaller font for better fit */
      }
    }

/*_______________________________________Skeleton rows for loading tables___________________________*/

    .skeleton {
      background: linear-gradient(-90deg, #e0e0e0 0%, #f8f8f8 50%, #e0e0e0 100%);
      background-size: 200% 100%;
      animation: shimmer 0.5s infinite;
      color: transparent;
    }
    
    .skeleton-row td {
      height: 30px;
      max-width: 150px;
      overflow: hidden;
      white-space: nowrap;
    }

    .skeleton-header {
      color: transparent !important;
      background: linear-gradient(100deg, #f0f0f0 30%, #e0e0e0 50%, #f0f0f0 70%);
      background-size: 400% 100%;
      animation: skeleton-loading 1.5s ease infinite;
      border-radius: 4px;
      user-select: none;
    }

    /* If you don't already have this animation defined for the skeleton rows */
    @keyframes skeleton-loading {
      0% {
        background-position: 100% 50%;
      }
      100% {
        background-position: 0 50%;
      }
    }

    @keyframes shimmer {
      0% { background-position: 200% 0; }
      100% { background-position: -200% 0; }
    }

    @media (max-width: 768px) {
      .skeleton-row .desktop-only-column {
        display: none;
      }
      
      .skeleton-row td {
        padding: 8px 4px;
      }
    }

/*_________________________________________Search, sort and pagination______________________________*/

  /* Search & Sort */
  .search-sort-container {
    display: flex;
    flex-wrap: wrap;               /* allow items to wrap on smaller screens */
    align-items: center;
    justify-content: space-between;
    gap: 1rem;                     /* spacing between sections */
    margin-bottom: 15px;
    padding: 10px;
    background: #f9f9f9;
    border-radius: 8px;
    width: 100%;
    border: 1px solid #eee;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    margin-bottom: 1rem;
    box-sizing: border-box;
    line-height: 1.2;              /* decrease vertical spacing */
  }

  .search-container {
    flex: 0 0 auto;  
    white-space: nowrap;
  }

  .search-container input {
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
    border: 1px solid #ccc;
    font-size: 0.9rem;
    width: 200px;
  }

  .search-container button {
    padding: 10px 20px;
    background-color: #007bff;
    color: #fff;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
  }

  .search-container button:hover {
    background-color: #000000;
    transform: scale(1.01);
  }

  /* Keep each section on one line if there's space, but allow them to wrap as a unit */
  .search-container,
  .all-filters,
  .sort-container {
    flex: 0 0 auto;               /* Do not grow/shrink automatically */
    white-space: nowrap;          /* Keep contents of each section together */
  }

/* MEDIA QUERY: shrink everything on smaller screens */
@media (max-width: 768px) {
  .search-sort-container {
    gap: 0.5rem;                 /* even less spacing on small screens */
  }
  .search-container input {
    width: 68%;
    min-width: 150px;                /* narrower search box */
    font-size: 0.9rem;           /* smaller text */
  }
  .search-container button {
    padding: 6px 12px;           /* smaller button */
    font-size: 0.9rem;
  }
  .sort-container label,
  .sort-container select {
    font-size: 0.85rem;          /* smaller sort labels and selects */
  }

  /* Let them each take a full row if they still don’t fit side by side */
  .search-container,
  .all-filters,
  .sort-container {
    flex: 1 1 100%;
    white-space: normal;         /* allow line-breaks inside each section */
  }
}

  .sort-container select {
    padding: 6px;
    border: 1px solid #ccc;
    border-radius: 5px;
  }

  /* Pagination */
  .pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 15px;
  }

  .pagination button {
    background: #007bff;
    color: white;
    border: none;
    padding: 6px 9px;
    border-radius: 9px;
    cursor: pointer;
  }

  .pagination-btn.active {
      background: #000000;
      color: rgb(255, 255, 255);
  }

  .pagination-ellipsis {
      padding: 0 4px;
  }
  
  @media (min-width: 768px) { 
    .pagination button:hover {
      background-color: #000000;
      transform: scale(1.05);
    }
  }


  /* Page Size Container */
  .page-size-container {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: flex-end;
    margin: 10px;
  }

  .page-size-container label {
    font-weight: 500;
  }

  .page-size-container select {
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background: #fff;
    transition: border-color 0.3s ease;
  }

  .page-size-container select:focus {
    border-color: #007BFF;
    outline: none;
  }


/*_______________Availability buttons and filters for my_books and favorites pages_________________*/
    /* Availability Inactive Buttons */
    .availability-button {
      font-size: 12px;
      font-weight: bold;
      color: white;
      cursor: pointer;
      padding: 2px 4px;
      border: 2px solid;
      border-radius: 4px;
      font-weight: bold;
      display: block;
      margin: auto;
    }

    .availability-0 { border-color: #2E86AB; background-color: #2E86AB; color: white;} /* Borrowed */
    .availability-1 { border-color: #6EA578; background-color: #6EA578; color: white;} /* Free */
    .availability-2 { border-color: #F28D35; background-color: #F28D35; color: white;} /* To Buy */
    .availability-3 { border-color: #9D7CBF; background-color: #9D7CBF; color: white;}  /* Private */

    .availability-all { border-color: #000000; background-color: #000000; color: white;}

    /* Unchecked state: Light grey background */
    input[type="checkbox"]:not(:checked) + .availability-filter-button {
        background-color: #E0E0E0; /* Light grey */
        color: #757575; /* Slightly faded text */
    }
    input[type="checkbox"]:checked + .availability-filter-button {
        background-color: #007bff;
        color: #fff;
        border-color: #0056b3;
    }

    /* Base button styling */
    .availability-filter-button {
      display: inline-block;
      padding: 5px 12px;
      font-size: 14px;
      font-weight: bold;
      cursor: pointer;
      border: 2px solid;
      min-width: 50px;
      text-align: center;
      border-radius: 5px;
      background-color: white;
      transition: background-color 0.3s, color 0.3s;
    }

    /* Unchecked state */
      input[type="checkbox"]:not(:checked) + .availability-filter-button {
        background-color: #E0E0E0;
        color: #757575;
      }

      /* Checked state for each availability type */
      input[type="checkbox"]:checked + .availability-filter-button.availability-0 {
        background-color: #2E86AB;
        color: white;
      }

      input[type="checkbox"]:checked + .availability-filter-button.availability-1 {
        background-color: #6EA578;
        color: white;
      }

      input[type="checkbox"]:checked + .availability-filter-button.availability-2 {
        background-color: #F28D35;
        color: white;
      }

      input[type="checkbox"]:checked + .availability-filter-button.availability-3 {
        background-color: #9D7CBF;
        color: white;
      }

      input[type="checkbox"]:checked + .availability-filter-button.availability-all {
        background-color: #2a2c12;
        color: white;
      }

    .search-sort-container {
      display: flex;
      align-items: center;
      gap: 7px; /* Adjust spacing between the search container and filters */
    }

    /* Container for the buttons */
    .all-filters {
      display: flex;
      gap: 0px;              /* Space between buttons */
      align-items: center;
      flex-direction: column;
    }

  @media (min-width: 768px) {
    .availability-0 {
      min-width: 70px;
    }
  }

@media (max-width: 768px) {
  .availability-filter-button {
    padding: 4px 8px;            /* shrink filter buttons */
    font-size: 0.5rem;
    min-width: 25px;
  }
}

.found-books-counter {
  background-color: rgb(0, 0, 0);
  color: white;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.8em;
  margin: 0 10px 10px 10px;
}

/*_________________________________Users and my-profile pages css__________________________________*/
.user-profile-container {
  background: white;
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.profile-header {
  display: flex;
  gap: 24px;
  margin-bottom: 24px;
}

.profile-image img {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid #815F6C;
}

.button-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.profile-info {
  flex: 1;
}

.profile-info h2 {
  margin: 0 0 12px 0;
  color: #333;
}

.bio {
  font-size: 1.1em;
  color: #666;
  margin-bottom: 16px;
}

.member-info {
  display: flex;
  gap: 24px;
  color: #666;
  font-size: 0.9em;
}

.profile-details {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 16px;
}

.detail-card {
  background: #f8f9fa;
  padding: 16px;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
}

.detail-card .label {
  color: #666;
  font-size: 0.9em;
  margin-bottom: 4px;
}

.detail-card .value {
  color: #333;
  font-weight: 500;
}

@media (max-width: 768px) {
  .profile-header {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  
  .member-info {
    justify-content: center;
  }
}

/*________________________Small profile image shown on public listings pages_______________________*/
.user-profile-link {
  display: flex;
  justify-content: center;
}

.profile-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none; /* Remove underline */
  color: inherit; /* Keep original text color */
  gap: 0px;
}

.user-thumbnail {
  width: 40px;
  height: 40px;
  border-radius: 60%;
  object-fit: cover;
  border: 1px solid #ccc;
}

.username-text {
  color: #0066cc; /* Keep it looking like a link */
}

.owner-details {
  display: flex;
  align-items: center; /* This vertically centers the content */
}

.owner-details strong {
  margin-right: 8px; /* Space between "Owner:" and the profile link */
}

.mobile-profile-link {
  flex-direction: row; /* Change from column to row for mobile */
  align-items: center; /* Vertically center the image and text */
}

.mobile-profile-link .user-thumbnail {
  width: 30px; /* Slightly smaller for mobile view */
  height: 30px;
  margin-right: 8px; /* Space between image and text */
}

.mobile-only-details .user-profile-link {
  display: inline-flex; /* Allow it to flow with the text */
}

.mobile-owner-content {
  display: inline-flex;
  align-items: center;
  margin-left: 8px; /* Space between "Owner:" and the profile link */
}

.mobile-profile-link {
  flex-direction: row; /* Change from column to row for mobile */
  align-items: center; /* Vertically center the image and text */
}

.mobile-profile-link .user-thumbnail {
  width: 30px; /* Slightly smaller for mobile view */
  height: 30px;
  margin-right: 8px; /* Space between image and text */
}

@media (min-width: 768px) {
  .profile-link:hover .username-text {
  text-decoration: underline;
  }
  .mobile-only-details {
    display: none;
  }
}

@media screen and (max-width: 768px) {
  .desktop-only-column {
    display: none !important;
  }
  table th.desktop-only-column,
  table td.desktop-only-column {
    display: none !important;
  }
}

/*__________________________________________Camera helpers_________________________________________*/

.scan-btn {
  /* Existing styles */
  padding: 6px; /* Adjust padding for an icon - maybe make it equal */
  background-color: #000000;
  color: white; /* This color will be inherited by the SVG's fill */
  border: none;
  border-radius: 4px;
  cursor: pointer;
  margin: 0 5px;
  /* font-size: 14px; */ /* Less relevant now */
  /* white-space: nowrap; */ /* Not needed for icon */
  transition: background-color 0.2s ease-in-out;
  height: 30px; /* Keep or adjust height */
  width: 30px; /* Optional: Make it square */
  display: inline-flex; /* Use flex to help center the SVG */
  align-items: center;
  justify-content: center;
  flex-shrink: 0; /* Keep this */
}

/* Target the SVG directly if needed */
.scan-btn svg {
  width: 18px; /* Control size via CSS */
  height: 18px; /* Control size via CSS */
  /* fill: white; */ /* Alternative if not using fill="currentColor" */
}


.mobile-scan-controls {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin: 10px 0;
}

#switchCameraBtn, #stopScanBtn {
    padding: 10px 15px;
    border: none;
    border-radius: 4px;
    color: white;
}

#switchCameraBtn {
    background-color: #4a90e2;
}

#stopScanBtn {
    background-color: #e74c3c;
}

#flashlightBtn {
    background-color: #f39c12;
    padding: 10px 15px;
    border: none;
    border-radius: 4px;
    color: white;
}
/*_______________________________________Currency input group______________________________________*/

    /* Reset the currency input group to full width of the form */
    .currency-input-group {
      display: flex;
      align-items: center;
      gap: 10px;
      width: 100%; /* Use full width of the form-group */
    }

    /* Make the price/fee input field take up more space */
    .currency-input-group input {
      flex: 3; /* Give the input 3x the weight of the dropdown */
      width: auto; /* Let flex handle the width */
      min-width: 0; /* Allow input to shrink below its content size */
    }

    /* Make the currency dropdown wider */
    .currency-select {
      flex: 1; /* Keep the same flex ratio */
      min-width: 320px; /* Smaller minimum width for better mobile compatibility */
      max-width: 50%; /* Allow it to take up to 50% of the container */
      padding: 8px;
      border: 1px solid #ccc;
      border-radius: 4px;
      background-color: #f8f8f8;
    }

    /* Ensure other form inputs maintain consistent width */
    .form-group input[type="text"],
    .form-group input[type="number"],
    .form-group select:not(.currency-select),
    .form-group textarea {
      width: 100%; /* Make other inputs use full width */
      box-sizing: border-box; /* Include padding in width calculation */
    }

    /* Add responsive adjustments for mobile devices */
    @media (max-width: 480px) {
      .currency-input-group {
        gap: 5px; /* Reduce gap on small screens */
      }
      
      .currency-input-group input {
        flex: 2; /* Reduce the ratio on mobile */
      }
      
      .currency-select {
        min-width: 190px; /* Further reduce minimum width on mobile */
        font-size: 0.9em; /* Slightly smaller font size */
        padding: 6px; /* Smaller padding */
      }
    }


/*___________________________________________Footer's css__________________________________________*/
body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  margin: 0;
}

main {
  flex-grow: 1;
}

footer {
  text-align: center;
  padding: 10px;
  background: #f1f1f1;
}

footer {
  margin-top: 30px;
  padding: 10px 20px;
  background-color: #f8f9fa;
  border-top: 1px solid #e9ecef;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  text-align: center;
}

.footer-links {
  margin-bottom: 0px;
}

.footer-links a {
  color: #495057;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease;
}
@media (min-width: 768px) {
  .footer-links a:hover {
    color: #007bff;
  }
}
.footer-divider {
  margin: 0 10px;
  color: #adb5bd;
}

.copyright-text {
  color: #6c757d;
  font-size: 0.9rem;
  margin: 0;
}

@media (max-width: 768px) {
  footer {
    margin-top: 40px;
    padding: 20px 15px;
  }
}
