/* Custom styles for ReadingTrail */

/* Rating Stars Styling */
* {
  word-wrap: break-word;
  overflow-wrap: break-word;
}


.rating-stars-small {
    display: flex;
    gap: 1px;
}

.rating-stars-small .star {
    color: #ffc107;
    font-size: 0.9rem;
}

.rating-stars-small .star.empty {
    color: #666;
}

.rating-text-small {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.75rem;
}

.rating-display {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.rating-display.loaded {
    opacity: 1;
}

/* Dark Background */
body {
    background-color: var(--bs-body-bg) !important;
    color: var(--bs-body-color) !important;
    min-height: 100vh;
    position: relative;
    padding-top: 70px;
}




.glass-navbar {
    background-color: var(--bs-body-bg) !important;
    color: var(--bs-body-color) !important;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(var(--bs-body-color-rgb, 255,255,255), 0.1);
    transition: background-color 0.3s ease, color 0.3s ease;
    z-index: 1030;
}


.glass-navbar .navbar-brand {
    font-weight: 600;
    font-size: 1.5rem;
    color: #fff !important;
    transition: all 0.3s ease;
}

.glass-navbar .navbar-brand:hover {
    transform: scale(1.05);
    color: #4a90e2 !important;
}

.glass-navbar .nav-link {
    color: rgba(255, 255, 255, 0.8) !important;
    font-weight: 500;
    transition: all 0.3s ease;
    border-radius: 8px;
    margin: 0 4px;
    padding: 8px 12px !important;
}

.glass-navbar .nav-link:hover,
.glass-navbar .nav-link:focus {
    color: #fff !important;
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-1px);
}

.glass-navbar .nav-link.active {
    color: #4a90e2 !important;
    background: rgba(74, 144, 226, 0.1);
}

.glass-dropdown {
    background: rgba(13, 17, 23, 0.95) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 12px !important;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3) !important;
}

.glass-dropdown .dropdown-item {
    color: rgba(255, 255, 255, 0.8) !important;
    transition: all 0.3s ease;
    border-radius: 8px;
    margin: 2px 8px;
}

.glass-dropdown .dropdown-item:hover,
.glass-dropdown .dropdown-item:focus {
    background: rgba(255, 255, 255, 0.1) !important;
    color: #fff !important;
    transform: translateX(4px);
}

.glass-dropdown .dropdown-divider {
    border-color: rgba(255, 255, 255, 0.1);
    margin: 8px 16px;
}

/* Badge Styles for Navbar */
.navbar .badge {
    font-size: 0.6rem;
    padding: 2px 6px;
    transform: translate(-50%, -50%);
}

/* User Dropdown Styling */
.navbar .nav-link .d-flex {
    text-align: left;
}

/* Navbar Toggle Button */
.navbar-toggler {
    border: none;
    padding: 4px 8px;
}

.navbar-toggler:focus {
    box-shadow: none;
}

.navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 0.75%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* Responsive adjustments */
@media (max-width: 991.98px) {
    .glass-navbar .navbar-collapse {
        background: rgba(13, 17, 23, 0.95);
        backdrop-filter: blur(20px);
        border-radius: 12px;
        margin-top: 1rem;
        padding: 1rem;
        border: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    .glass-navbar .nav-link {
        margin: 4px 0;
    }
}

/* Glass Effect Variations */
.glass {
  position: relative;
  border-radius: 1.5rem;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 
    0 8px 32px rgba(31, 38, 135, 0.37),
    inset 0 2px 6px rgba(255, 255, 255, 0.1);
  transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
}

.glass-header {
  background: rgba(255, 255, 255, 0.15);
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  border-radius: 1rem 1rem 0 0;
  color: white;
  font-weight: 600;
}

.glass-footer {
  background: rgba(255, 255, 255, 0.08);
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border-radius: 0 0 1rem 1rem;
}

.glass-card {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 1.25rem;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 
    0 6px 25px rgba(31, 38, 135, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    0 0 0 1px rgba(255, 255, 255, 0.05);
  transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
  position: relative;
  overflow: hidden;
}

.glass-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  transition: left 0.8s ease;
  z-index: 1;
  pointer-events: none;
}

.glass-card:hover {
  transform: translateY(-6px) scale(1.02);
  box-shadow: 
    0 12px 40px rgba(31, 38, 135, 0.4),
    inset 0 2px 0 rgba(255, 255, 255, 0.15),
    0 0 0 2px rgba(255, 255, 255, 0.1),
    0 0 30px rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.25);
}

.glass-card:hover::before {
  left: 100%;
}

.glass-navbar {
  background-color: var(--bs-body-bg) !important;
  color: var(--bs-body-color) !important;
  border-bottom: 1px solid rgba(var(--bs-body-color-rgb, 255,255,255), 0.15);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  transition: background-color 0.3s ease, color 0.3s ease;
}


.glass-navbar::before {
  display: none !important;
}

.glass-button {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.08));
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 1.25rem;
  position: relative;
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  box-shadow: 
    0 8px 25px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.25),
    inset 0 -1px 0 rgba(0, 0, 0, 0.1);
  color: rgba(255, 255, 255, 0.95) !important;
  font-weight: 500;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
}

.glass-button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.6s ease;
}

.glass-button:hover {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.25), rgba(255, 255, 255, 0.15));
  border-color: rgba(255, 255, 255, 0.5);
  color: white !important;
  transform: translateY(-3px) scale(1.02);
  box-shadow: 
    0 15px 35px rgba(0, 0, 0, 0.3),
    inset 0 2px 0 rgba(255, 255, 255, 0.35),
    inset 0 -2px 0 rgba(0, 0, 0, 0.15),
    0 0 25px rgba(255, 255, 255, 0.15);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.glass-button:hover::before {
  left: 100%;
}

.glass-button:active {
  transform: translateY(-1px) scale(0.98);
  box-shadow: 
    0 5px 15px rgba(0, 0, 0, 0.2),
    inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

.glass-input {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0.75rem;
  color: white;
}

.glass-input:focus {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(74, 144, 226, 0.6);
  box-shadow: 
    0 0 0 0.2rem rgba(74, 144, 226, 0.25),
    0 4px 15px rgba(74, 144, 226, 0.2);
  transform: translateY(-1px);
}

.form-control.glass-input,
.form-select.glass-input {
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  transition: all 0.3s ease;
}

.form-control.glass-input:focus,
.form-select.glass-input:focus {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(74, 144, 226, 0.6);
  box-shadow: 
    0 0 0 0.2rem rgba(74, 144, 226, 0.25),
    0 4px 15px rgba(74, 144, 226, 0.2);
  transform: translateY(-1px);
}

.glass-badge {
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 2rem;
}

/* Book Cover Styling - Enhanced for Physical Books */
.book-cover {
    height: 250px;
    object-fit: cover;
    width: 100%;
    border-radius: 1rem;
    transition: transform 0.3s ease-in-out, box-shadow 0.3s ease-in-out;
    box-shadow: 
        0 8px 25px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1),
        0 0 0 1px rgba(255, 255, 255, 0.05);
    position: relative;
}

.book-cover:hover {
    transform: scale(1.05) rotate(1deg);
    box-shadow: 
        0 12px 35px rgba(0, 0, 0, 0.4),
        inset 0 2px 0 rgba(255, 255, 255, 0.15),
        0 0 0 2px rgba(255, 255, 255, 0.1),
        0 0 20px rgba(255, 255, 255, 0.05);
}

.book-cover-container {
    position: relative;
    overflow: hidden;
    border-radius: 1rem;
}

.book-cover-large {
    height: 400px;
    object-fit: cover;
    width: 100%;
    border-radius: 1rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.book-cover-container-large {
    position: relative;
    overflow: hidden;
    border-radius: 1rem;
}

.book-cover-small {
    height: 120px;
    object-fit: cover;
    width: 100%;
    border-radius: 0.75rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

/* Book Card Styling - Enhanced for Physical Books */
.book-card {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 1.25rem;
    box-shadow: 
        0 6px 25px rgba(31, 38, 135, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
    overflow: hidden;
    position: relative;
}

.book-card:hover::before,
.book-card:hover::after {
    opacity: 0 !important;
}



/* Enhanced Physical Book Styling */
.physical-book-badge {
    position: absolute;
    top: 15px;
    left: 15px;
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.3);
    z-index: 5;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.physical-book-badge::before {
    content: '📚 ';
    margin-right: 0.25rem;
}

/* Enhanced visual feedback for physical book interaction */
.book-card:hover .physical-book-badge {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.4);
}

/* Physical book themed button enhancements */
.btn.glass-button .fa-hand-holding,
.btn.glass-button .fa-hand-receiving {
    color: #ffd700;
    text-shadow: 0 0 4px rgba(255, 215, 0, 0.3);
}

/* Community library theme colors */
.community-library-theme {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.book-card:hover {
    transform: translateY(-6px) scale(1.02);
    box-shadow: 
        0 12px 40px rgba(31, 38, 135, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.25);
}

.book-info {
    font-size: 0.875rem;
}

/* Alert Animations with Glass Effect */
.alert {
    animation: slideIn 0.3s ease-out;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 1.25rem;
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    box-shadow: 
        0 8px 25px rgba(31, 38, 135, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
}

.alert::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shimmer 2s ease-in-out infinite;
}

.alert-success {
    background: rgba(40, 167, 69, 0.15);
    border-color: rgba(40, 167, 69, 0.4);
    box-shadow: 
        0 8px 25px rgba(40, 167, 69, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.alert-danger {
    background: rgba(220, 53, 69, 0.15);
    border-color: rgba(220, 53, 69, 0.4);
    box-shadow: 
        0 8px 25px rgba(220, 53, 69, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.alert-warning {
    background: rgba(255, 193, 7, 0.15);
    border-color: rgba(255, 193, 7, 0.4);
    box-shadow: 
        0 8px 25px rgba(255, 193, 7, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.alert-info {
    background: rgba(13, 202, 240, 0.15);
    border-color: rgba(13, 202, 240, 0.4);
    box-shadow: 
        0 8px 25px rgba(13, 202, 240, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

@keyframes shimmer {
    0%, 100% { transform: translateX(-100%); }
    50% { transform: translateX(100%); }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Loading States */
.btn.loading {
    position: relative;
    color: transparent;
}

.btn.loading::after {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Mobile Responsive Improvements */
@media (max-width: 767px) {
    .display-4 {
        font-size: 1.75rem;
        line-height: 1.2;
    }

    .lead {
        font-size: 1rem;
    }

    .book-cover {
        height: 180px;
    }

    .book-cover-large {
        height: 250px;
    }

    .card-body {
        padding: 0.875rem;
    }

    .btn-lg {
        padding: 0.75rem 1.5rem;
        font-size: 1rem;
    }

    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    /* Adjust search form for mobile */
    .row.g-3 > .col-md-6,
    .row.g-3 > .col-md-4,
    .row.g-3 > .col-md-2 {
        margin-bottom: 0.75rem;
    }

    /* Stack buttons vertically on mobile */
    .d-grid.gap-2.d-md-flex {
        gap: 0.5rem !important;
    }

    .d-grid.gap-2.d-md-flex .btn {
        margin-bottom: 0.5rem;
    }

    /* Adjust book grid for mobile */
    .col-lg-3.col-md-4.col-sm-6 {
        flex: 0 0 100%;
        max-width: 100%;
        margin-bottom: 1.5rem;
    }
}

@media (max-width: 575px) {
    .display-4 {
        font-size: 1.5rem;
    }

    .book-cover {
        height: 160px;
    }

    .card-body {
        padding: 0.75rem;
    }

    .btn {
        font-size: 0.875rem;
        padding: 0.5rem 1rem;
    }

    .btn-lg {
        font-size: 0.95rem;
        padding: 0.625rem 1.25rem;
    }

    /* Single column layout for very small screens */
    .row > .col-md-8,
    .row > .col-md-4 {
        flex: 0 0 100%;
        max-width: 100%;
        margin-bottom: 1rem;
    }

    .col-md-4.d-flex.align-items-center.justify-content-end {
        justify-content: center !important;
    }
}

/* Tablet Responsive Adjustments */
@media (min-width: 768px) and (max-width: 991px) {
    .col-lg-3.col-md-4.col-sm-6 {
        flex: 0 0 50%;
        max-width: 50%;
    }

    .book-cover {
        height: 220px;
    }

    .display-4 {
        font-size: 2.25rem;
    }
}

/* Large screen optimizations */
@media (min-width: 1200px) {
    .container {
        max-width: 1140px;
    }

    .book-cover {
        height: 280px;
    }

    .book-cover-large {
        height: 450px;
    }
}

/* Text wrapping and overflow fixes */
.card-title {
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    line-height: 1.3;
}

.card-text {
    word-wrap: break-word;
    overflow-wrap: break-word;
    line-height: 1.4;
}

/* Better button spacing */
.d-grid.gap-2 {
    gap: 0.75rem !important;
}

.d-grid.gap-2 .btn {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Enhanced navbar responsiveness */
@media (max-width: 991px) {
    .navbar-text {
        display: none;
    }

    .navbar-collapse {
        margin-top: 1rem;
        padding-top: 1rem;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
    }

    .dropdown-menu {
        position: static !important;
        transform: none !important;
        width: 100%;
        box-shadow: none;
        border: none;
        background: rgba(255, 255, 255, 0.05);
        margin-top: 0.5rem;
    }
}

/* Form improvements for better mobile UX */
.form-control,
.form-select {
    min-height: 44px; /* Touch-friendly minimum */
}

@media (max-width: 767px) {
    .form-control,
    .form-select {
        font-size: 16px; /* Prevents zoom on iOS */
    }

    .input-group .form-control {
        border-radius: 0.75rem 0 0 0.75rem;
    }

    .input-group .btn {
        border-radius: 0 0.75rem 0.75rem 0;
    }
}

/* Improved alert spacing and visibility */
.alert {
    margin-bottom: 1.5rem;
    padding: 1rem 1.25rem;
}

@media (max-width: 767px) {
    .alert {
        padding: 0.875rem 1rem;
        font-size: 0.9rem;
    }
}

/* Better sidebar responsiveness */
@media (max-width: 768px) {
    .sidebar {
        width: min(90vw, 350px);
        left: calc(-1 * min(90vw, 350px));
    }

    .sidebar-header h4 {
        font-size: 1.3rem;
    }

    .sidebar-link {
        padding: 0.875rem 1rem;
        font-size: 0.9rem;
    }

    .user-info {
        padding: 0.875rem 1rem;
        font-size: 0.9rem;
    }
}

/* Action buttons improvements */
.action-buttons .flex-fill {
    min-width: 0;
}

@media (max-width: 575px) {
    .action-buttons .d-grid.gap-2.d-sm-flex {
        gap: 0.5rem !important;
    }
    
    .action-buttons .btn {
        font-size: 0.9rem;
        padding: 0.75rem 1rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
}

/* Sticky positioning fix for mobile */
@media (max-width: 768px) {
    .sticky-top {
        position: relative !important;
        top: auto !important;
    }
}

/* Enhanced container padding */
@media (max-width: 575px) {
    .container {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }
}

/* Enhanced dropdown styling */
.glass-dropdown {
    background: rgba(13, 17, 23, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 1rem;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 
        0 10px 40px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    padding: 0.5rem 0;
    min-width: 200px;
}

.glass-dropdown .dropdown-item {
    color: rgba(255, 255, 255, 0.9);
    padding: 0.75rem 1.25rem;
    border-radius: 0.75rem;
    margin: 0.25rem 0.5rem;
    transition: all 0.3s ease;
}

.glass-dropdown .dropdown-item:hover,
.glass-dropdown .dropdown-item:focus {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    transform: translateX(2px);
}

.glass-dropdown .dropdown-header {
    color: rgba(255, 255, 255, 0.8);
    font-weight: 600;
    padding: 0.75rem 1.25rem 0.5rem;
    margin-bottom: 0.25rem;
}

.glass-dropdown .dropdown-divider {
    border-color: rgba(255, 255, 255, 0.1);
    margin: 0.5rem 0;
}

/* Improved text truncation */
.text-truncate-custom {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

/* Loading state improvements */
.btn.loading {
    pointer-events: none;
    opacity: 0.8;
}

.btn.loading .fas {
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Better focus states for accessibility */
.btn:focus,
.form-control:focus,
.form-select:focus {
    outline: 2px solid rgba(74, 144, 226, 0.5);
    outline-offset: 2px;
}

/* Improved navbar toggler */
.navbar-toggler {
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 0.5rem;
    padding: 0.375rem 0.5rem;
}

.navbar-toggler:focus {
    box-shadow: 0 0 0 0.2rem rgba(74, 144, 226, 0.25);
}

/* Better button group spacing */
.btn-group-responsive {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

@media (max-width: 576px) {
    .btn-group-responsive {
        flex-direction: column;
    }
    
    .btn-group-responsive .btn {
        flex: 1;
        min-width: 0;
    }
}

/* Footer improvements */
footer {
    margin-top: 3rem;
}

@media (max-width: 767px) {
    footer .row > .col-md-6 {
        text-align: center !important;
        margin-bottom: 1rem;
    }

    footer .col-md-6:last-child {
        margin-bottom: 0;
    }
}

/* Navbar Improvements */
.navbar-brand {
    font-weight: bold;
    font-size: 1.5rem;
}

.navbar-text {
    font-size: 0.9rem;
}

/* Footer Styling */
footer {
    margin-top: auto;
}

/* Custom Badge Positioning */
.position-absolute.top-0.end-0 {
    z-index: 10;
}

/* Enhanced Search Form */
.input-group-text {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
}

/* Improve text visibility */
.text-muted {
    color: rgba(255, 255, 255, 0.7) !important;
}

.lead {
    color: rgba(255, 255, 255, 0.9);
}

/* Enhanced Stats Cards */
.card.bg-primary,
.card.bg-warning,
.card.bg-success {
    color: white;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
}

.card.bg-primary {
    background: linear-gradient(135deg, rgba(13, 110, 253, 0.7), rgba(13, 110, 253, 0.5));
    box-shadow: 
        0 8px 32px rgba(13, 110, 253, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.card.bg-warning {
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.8), rgba(255, 193, 7, 0.6));
    box-shadow: 
        0 8px 32px rgba(255, 193, 7, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    color: rgba(0, 0, 0, 0.8);
}

.card.bg-success {
    background: linear-gradient(135deg, rgba(25, 135, 84, 0.7), rgba(25, 135, 84, 0.5));
    box-shadow: 
        0 8px 32px rgba(25, 135, 84, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.card.bg-primary .card-text,
.card.bg-warning .card-text,
.card.bg-success .card-text {
    opacity: 0.95;
    font-weight: 500;
}

.card.bg-primary::before,
.card.bg-warning::before,
.card.bg-success::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.6s ease;
}

.card.bg-primary:hover::before,
.card.bg-warning:hover::before,
.card.bg-success:hover::before {
    left: 100%;
}

.card.bg-primary:hover,
.card.bg-warning:hover,
.card.bg-success:hover {
    transform: translateY(-2px) scale(1.02);
    transition: all 0.3s ease;
}

/* Overdue Styling */
.border-danger {
    border-color: var(--bs-danger) !important;
    border-width: 2px !important;
}

.text-danger {
    color: var(--bs-danger) !important;
}

/* Smooth Transitions */
* {
    transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, 
                border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

/* Enhanced Button Variants */
.btn-primary.glass-button {
  background: linear-gradient(145deg, rgba(13, 110, 253, 0.8), rgba(13, 110, 253, 0.6));
  border-color: rgba(13, 110, 253, 0.9);
  color: white;
}

.btn-primary.glass-button:hover {
  background: linear-gradient(145deg, rgba(13, 110, 253, 0.9), rgba(13, 110, 253, 0.7));
  border-color: rgba(13, 110, 253, 1);
  box-shadow: 
    0 15px 35px rgba(13, 110, 253, 0.3),
    inset 0 2px 0 rgba(255, 255, 255, 0.3),
    inset 0 -2px 0 rgba(0, 0, 0, 0.15),
    0 0 25px rgba(13, 110, 253, 0.4);
}

.btn-success.glass-button {
  background: linear-gradient(145deg, rgba(25, 135, 84, 0.8), rgba(25, 135, 84, 0.6));
  border-color: rgba(25, 135, 84, 0.9);
  color: white;
}

.btn-success.glass-button:hover {
  background: linear-gradient(145deg, rgba(25, 135, 84, 0.9), rgba(25, 135, 84, 0.7));
  border-color: rgba(25, 135, 84, 1);
  box-shadow: 
    0 15px 35px rgba(25, 135, 84, 0.3),
    inset 0 2px 0 rgba(255, 255, 255, 0.3),
    inset 0 -2px 0 rgba(0, 0, 0, 0.15),
    0 0 25px rgba(25, 135, 84, 0.4);
}

.btn-warning.glass-button {
  background: linear-gradient(145deg, rgba(255, 193, 7, 0.8), rgba(255, 193, 7, 0.6));
  border-color: rgba(255, 193, 7, 0.9);
  color: rgba(0, 0, 0, 0.85);
}

.btn-warning.glass-button:hover {
  background: linear-gradient(145deg, rgba(255, 193, 7, 0.9), rgba(255, 193, 7, 0.7));
  border-color: rgba(255, 193, 7, 1);
  color: rgba(0, 0, 0, 0.9);
  box-shadow: 
    0 15px 35px rgba(255, 193, 7, 0.3),
    inset 0 2px 0 rgba(255, 255, 255, 0.3),
    inset 0 -2px 0 rgba(0, 0, 0, 0.15),
    0 0 25px rgba(255, 193, 7, 0.4);
}

.btn-outline-primary.glass-button {
  background: linear-gradient(145deg, rgba(13, 110, 253, 0.1), rgba(13, 110, 253, 0.05));
  border-color: rgba(13, 110, 253, 0.5);
  color: #6ea8fe;
}

.btn-outline-primary.glass-button:hover {
  background: linear-gradient(145deg, rgba(13, 110, 253, 0.2), rgba(13, 110, 253, 0.1));
  border-color: rgba(13, 110, 253, 0.8);
  color: white;
  box-shadow: 
    0 15px 35px rgba(13, 110, 253, 0.2),
    inset 0 2px 0 rgba(255, 255, 255, 0.2),
    inset 0 -2px 0 rgba(0, 0, 0, 0.1),
    0 0 20px rgba(13, 110, 253, 0.3);
}

/* Small button variants */
.btn-sm.glass-button {
  border-radius: 1rem;
  padding: 0.375rem 1rem;
}

.btn-lg.glass-button {
  border-radius: 1.5rem;
  padding: 0.75rem 2rem;
  font-size: 1.125rem;
  min-height: 3.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  letter-spacing: 0.025em;
  text-transform: uppercase;
}

.btn-lg.glass-button:hover {
  transform: translateY(-4px) scale(1.03);
}

.btn-lg.glass-button:active {
  transform: translateY(-2px) scale(1.01);
}

/* Focus States */
.btn:focus,
.form-control:focus,
.form-select:focus {
    box-shadow: 0 0 0 0.2rem rgba(var(--bs-primary-rgb), 0.25);
}

/* Profile Dropdown Styling */
.dropdown-menu.glass-dropdown {
    background: rgba(13, 17, 23, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 1rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
    min-width: 200px;
    max-width: 280px;
    padding: 0.5rem;
    margin-top: 0.5rem;
    z-index: 1050;
}

.glass-dropdown .dropdown-item {
    color: rgba(255, 255, 255, 0.9);
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    margin: 0.125rem 0;
    transition: all 0.2s ease;
    border: none;
    background: transparent;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.glass-dropdown .dropdown-item:hover,
.glass-dropdown .dropdown-item:focus {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    transform: none;
}

.glass-dropdown .dropdown-item:active {
    background: rgba(255, 255, 255, 0.15);
}

.glass-dropdown .dropdown-header {
    color: rgba(255, 255, 255, 0.8);
    font-weight: 600;
    padding: 0.75rem 1rem 0.25rem;
    font-size: 0.875rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.glass-dropdown .dropdown-divider {
    border-color: rgba(255, 255, 255, 0.1);
    margin: 0.5rem 0;
    opacity: 0.5;
}

.dropdown-toggle::after {
    display: none;
}

#profileDropdown {
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    padding: 0;
}

#profileDropdown:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.1);
}

#profileDropdown:focus {
    box-shadow: 0 0 0 0.2rem rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.1);
}

#profileDropdown .fa-user-circle {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.25rem;
}

/* Sidebar Styles */
.sidebar-trigger {
    position: fixed;
    top: 0;
    left: 0;
    width: 60px;
    height: 100vh;
    z-index: 1060;
    cursor: pointer;
    background: transparent;
    transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
}

.sidebar-trigger:hover {
    width: 80px;
    background: rgba(255, 255, 255, 0.05);
}

.sidebar.active ~ .sidebar-trigger {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.sidebar {
    position: fixed;
    top: 0;
    left: -400px;
    width: 400px;
    height: 100vh;
    background: rgba(13, 17, 23, 0.95);
    border-right: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 4px 0 30px rgba(0, 0, 0, 0.5);
    z-index: 1055;
    transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    overflow-y: auto;
    overflow-x: hidden;
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
}

.sidebar.active {
    left: 0;
    box-shadow: 8px 0 30px rgba(0, 0, 0, 0.4);
}

.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: radial-gradient(circle at center, rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.4));
    z-index: 1050;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
}

.sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
}

.sidebar-header {
    padding: 2rem 1.5rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.04));
    display: flex;
    align-items: center;
    justify-content: space-between;
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    position: relative;
}

.sidebar-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(74, 144, 226, 0.6), transparent);
}

.sidebar-header h4 {
    color: white;
    margin: 0;
    font-weight: 700;
    font-size: 1.6rem;
    letter-spacing: 1px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    background: linear-gradient(135deg, #ffffff, #e6edf3);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}



.sidebar-nav {
    padding: 1.5rem 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.sidebar-section-title {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 0.5rem 1.5rem;
    margin: 1rem 1rem 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-link {
    display: flex;
    align-items: center;
    padding: 1rem 1.5rem;
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    transition: all 0.3s ease;
    gap: 1rem;
    margin: 0.25rem 1rem;
    border-radius: 1rem;
    background: transparent;
    font-weight: 500;
    font-size: 0.95rem;
    min-height: 56px;
    position: relative;
    overflow: hidden;
    border: 1px solid transparent;
}

.sidebar-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.05);
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: inherit;
}

.sidebar-link:hover {
    color: white;
    background: rgba(255, 255, 255, 0.1);
    text-decoration: none;
    transform: translateX(6px);
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.sidebar-link:hover::before {
    opacity: 1;
}

.sidebar-link.active {
    color: white;
    background: linear-gradient(135deg, rgba(74, 144, 226, 0.3), rgba(74, 144, 226, 0.15));
    border-color: rgba(74, 144, 226, 0.4);
    box-shadow: 
        0 4px 15px rgba(74, 144, 226, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.sidebar-link i {
    width: 24px;
    text-align: center;
    font-size: 1.2rem;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.sidebar-link:hover i {
    color: #74a8e2;
    transform: scale(1.1);
}

.sidebar-link span {
    flex: 1;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.4;
}

.sidebar-link.logout {
    color: rgba(220, 53, 69, 0.8);
}

.sidebar-link.logout:hover {
    color: #dc3545;
    background: rgba(220, 53, 69, 0.1);
}

.sidebar-badge {
    background: linear-gradient(145deg, #dc3545, #b02a37);
    color: white;
    border-radius: 50%;
    padding: 0.25rem 0.5rem;
    font-size: 0.7rem;
    font-weight: 700;
    min-width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
    border: 2px solid rgba(255, 255, 255, 0.3);
    box-shadow: 
        0 4px 12px rgba(220, 53, 69, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.3),
        0 0 20px rgba(220, 53, 69, 0.3);
    animation: pulseGlow 2s ease-in-out infinite;
    position: relative;
}

.sidebar-badge::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    border-radius: 50%;
    background: linear-gradient(45deg, #dc3545, #b02a37, #dc3545);
    z-index: -1;
    opacity: 0.3;
    animation: rotateBorder 3s linear infinite;
}

@keyframes pulseGlow {
    0%, 100% { 
        transform: scale(1);
        box-shadow: 
            0 4px 12px rgba(220, 53, 69, 0.5),
            inset 0 1px 0 rgba(255, 255, 255, 0.3),
            0 0 20px rgba(220, 53, 69, 0.3);
    }
    50% { 
        transform: scale(1.1);
        box-shadow: 
            0 6px 16px rgba(220, 53, 69, 0.7),
            inset 0 1px 0 rgba(255, 255, 255, 0.4),
            0 0 30px rgba(220, 53, 69, 0.5);
    }
}

@keyframes rotateBorder {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.sidebar-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 1.5rem 2rem;
}

.sidebar-stats {
    padding: 0 1.5rem;
    margin: 1.5rem 0;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
    font-weight: 500;
    padding: 0.75rem 1rem;
    margin: 0.5rem 0;
    border-radius: 0.5rem;
    background: transparent;
    transition: all 0.3s ease;
}

.stat-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: white;
}

.stat-item i {
    width: 20px;
    text-align: center;
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.6);
    transition: all 0.3s ease;
}

.stat-item:hover i {
    color: #74a8e2;
}

.sidebar-user,
.sidebar-auth {
    padding: 2rem 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.04));
    margin-top: auto;
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: rgba(255, 255, 255, 0.95);
    margin-bottom: 1.5rem;
    font-weight: 600;
    font-size: 0.95rem;
    padding: 1.25rem;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 1rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.user-info::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.6s ease;
}

.user-info:hover {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.08));
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.user-info:hover::before {
    left: 100%;
}

.user-info i {
    font-size: 2rem;
    color: rgba(255, 255, 255, 0.8);
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.user-info:hover i {
    color: #74a8e2;
    transform: scale(1.1);
}

.user-info span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .sidebar {
        width: 350px;
        left: -350px;
    }

    .sidebar-trigger {
        width: 50px;
    }

    .sidebar-trigger:hover {
        width: 70px;
    }

    .sidebar-header {
        padding: 1.5rem 1rem 1rem;
    }

    .sidebar-header h4 {
        font-size: 1.4rem;
    }

    .sidebar-link {
        margin: 0.25rem 0.75rem;
        padding: 1rem 1.25rem;
        font-size: 0.9rem;
    }

    .sidebar-link i {
        font-size: 1.1rem;
    }
}

@media (max-width: 480px) {
    .sidebar {
        width: 300px;
        left: -300px;
    }

    .sidebar-header h4 {
        font-size: 1.3rem;
    }

    .sidebar-link {
        padding: 0.875rem 1rem;
        font-size: 0.85rem;
    }

    .user-info {
        padding: 1rem;
        font-size: 0.9rem;
    }

    .user-info i {
        font-size: 1.75rem;
    }
}

/* Custom Scrollbar for Sidebar */
.sidebar::-webkit-scrollbar {
    width: 8px;
}

.sidebar::-webkit-scrollbar-track {
    background: rgba(13, 17, 23, 0.3);
    border-radius: 4px;
    margin: 10px 0;
}

.sidebar::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, 
        rgba(74, 144, 226, 0.6), 
        rgba(74, 144, 226, 0.4));
    border-radius: 4px;
    border: 1px solid rgba(74, 144, 226, 0.2);
    box-shadow: 
        0 2px 8px rgba(74, 144, 226, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, 
        rgba(74, 144, 226, 0.8), 
        rgba(74, 144, 226, 0.6));
    box-shadow: 
        0 4px 12px rgba(74, 144, 226, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.sidebar::-webkit-scrollbar-corner {
    background: rgba(13, 17, 23, 0.3);
}

/* Smooth scroll behavior */
.sidebar {
    scroll-behavior: smooth;
}

/* Custom Scrollbar for Webkit Browsers */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bs-secondary-bg);
}

::-webkit-scrollbar-thumb {
    background: var(--bs-secondary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--bs-secondary-color);
}
/* User Rank Display Styles */
.user-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.user-name {
    font-weight: 600;
    color: #fff;
    font-size: 0.95rem;
}

.user-rank {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: #ccc;
}

.user-rank i {
    font-size: 0.8rem !important;
}

.points-badge {
    background: rgba(255, 255, 255, 0.2);
    padding: 0.1rem 0.4rem;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 600;
    color: #fff;
}

.rank-progress {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.7rem;
    color: #aaa;
}

.progress-bar-mini {
    flex: 1;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    transition: width 0.3s ease;
}

.progress-text {
    white-space: nowrap;
    font-size: 0.6rem;
}

/* Rank Display in Achievements Page */
.rank-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 2rem;
    text-align: center;
    margin-bottom: 2rem;
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
}

.rank-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.rank-name {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: #fff;
}

.rank-points {
    font-size: 1.2rem;
    color: #ccc;
    margin-bottom: 1rem;
}

.rank-progress-bar {
    width: 100%;
    height: 12px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 1rem;
}

.rank-progress-fill {
    height: 100%;
    transition: width 0.3s ease;
}

.rank-next-info {
    font-size: 0.9rem;
    color: #aaa;
}



.user-info-link {
    text-decoration: none;
    color: inherit;
    display: block;
    border-radius: 0.75rem;
    padding: 0.5rem;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
    background: transparent;
}

.user-info-link:hover {
    background: rgba(255, 255, 255, 0.1);
    color: inherit;
    text-decoration: none;
    transform: translateY(-1px);
}

.glass-dropdown {
    background-color: rgba(var(--bs-body-bg-rgb), 0.95) !important;
}
.footer-glass {
    margin-top: auto;
    width: 100%;
    background-color: var(--bs-body-bg) !important;
    color: var(--bs-body-color) !important;
    border-top: 1px solid rgba(var(--bs-body-color-rgb, 255,255,255), 0.15);
    text-align: center;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: background-color 0.3s ease, color 0.3s ease;
}
body, html, header, nav.navbar, .glass-navbar {
  background-color: var(--bs-body-bg) !important;
  color: var(--bs-body-color) !important;
  transition: background-color 0.3s ease, color 0.3s ease;
  border: none !important;
}
[data-bs-theme="light"] nav.glass-navbar,
[data-bs-theme="light"] .glass-navbar {
  background-color: #ffffff !important;
  color: #000000 !important;
  box-shadow: none !important;
}

[data-bs-theme="dark"] nav.glass-navbar,
[data-bs-theme="dark"] .glass-navbar {
  background-color: #0d1117 !important;
  color: #ffffff !important;
}

html, body, nav.glass-navbar {
  background-color: var(--bs-body-bg) !important;
  color: var(--bs-body-color) !important;
  border: none !important;
  box-shadow: none !important;
}
/* ==== FIX VẠCH ĐEN Ở TRÊN NAVBAR (CHUYỂN THEME) ==== */

/* Ép trình duyệt vẽ toàn bộ vùng top đúng màu nền */
html, body {
  background-color: var(--bs-body-bg) !important;
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
  overflow-x: hidden;
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

/* Loại bỏ layer đen giả tạo phía trên navbar */
html::before,
body::before {
  content: none !important;
  display: none !important;
  background: none !important;
  height: 0 !important;
}

/* Ép navbar luôn dính sát top và không tạo border ảo */
.glass-navbar {
  position: fixed !important;
  top: 0 !important;
  left: 0;
  right: 0;
  z-index: 1050;
  margin: 0 !important;
  border: none !important;
  background-color: var(--bs-body-bg) !important;
  box-shadow: none !important;
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
}

/* Khi theme thay đổi, ép repaint lại vùng nền để xóa viền đen */
[data-bs-theme] {
  animation: repaintFix 0.01s linear;
}

@keyframes repaintFix {
  from { opacity: 0.99; }
  to { opacity: 1; }
}
/* ==========================================
   📱 TỐI ƯU HIỂN THỊ CHO MOBILE / NHỎ MÀN HÌNH
   ========================================== */

/* Giảm nhẹ padding và margin khi trên thiết bị nhỏ */
@media (max-width: 768px) {

  html {
    font-size: 14px !important; /* Nhỏ hơn một chút để vừa khít mobile */
  }

  body {
    padding: 0 0.5rem !important;
  }

  /* Navbar - gọn hơn, tránh bị tràn */
  .navbar {
    padding: 0.4rem 0.6rem !important;
  }

  .navbar-brand span {
    font-size: 1rem !important;
  }

  .navbar .nav-link {
    font-size: 0.9rem !important;
    padding: 0.3rem 0.5rem !important;
  }

  /* Dropdown - chữ nhỏ gọn */
  .dropdown-menu {
    font-size: 0.9rem !important;
  }

  /* Giảm kích thước avatar */
  .avatar {
    width: 30px !important;
    height: 30px !important;
    font-size: 0.9rem !important;
  }

  /* Giảm khoảng cách card */
  .card {
    margin-bottom: 1rem !important;
  }

  /* Card trong trang danh sách sách */
  .card-title {
    font-size: 1rem !important;
  }

  .card-text {
    font-size: 0.9rem !important;
  }

  /* Nút bấm */
  .btn {
    font-size: 0.9rem !important;
    padding: 0.35rem 0.75rem !important;
  }

  /* Thanh tìm kiếm */
  .form-control,
  .form-select {
    font-size: 0.9rem !important;
    padding: 0.35rem 0.6rem !important;
  }

  /* Footer - căn giữa, tránh bị tràn */
  footer .row {
    text-align: center !important;
  }
  footer .col-md-6 {
    flex: 0 0 100%;
    max-width: 100%;
  }

  /* Giảm khoảng cách trên/dưới để tránh scroll thừa */
  main {
    padding-top: 70px !important;
    padding-bottom: 80px !important;
  }
}

/* Extra nhỏ - điện thoại dưới 480px */
@media (max-width: 480px) {
  html {
    font-size: 13px !important;
  }

  .navbar-brand span {
    display: none; /* ẩn text 'ReadingTrail' để tiết kiệm không gian */
  }

  .navbar-brand i {
    font-size: 1.2rem !important;
  }

  .btn {
    font-size: 0.85rem !important;
  }

  .card-body {
    padding: 0.75rem !important;
  }
}
/* ======= SỬA LỖI CHỮ "ĐĂNG SÁCH" BỊ ẨN TRÊN MOBILE ======= */
@media (max-width: 768px) {
  /* Giữ cho tiêu đề không bị che */
  h1, h2, h3, .page-title {
    font-size: 1.3rem !important;
    text-align: center !important;
    margin-bottom: 0.75rem !important;
  }

  /* Nút Đăng sách hiển thị đầy đủ */
  .btn,
  .btn-lg {
    white-space: normal !important; /* Cho phép xuống dòng khi hẹp */
    font-size: 0.95rem !important;
    padding: 0.5rem 0.9rem !important;
    min-width: 130px;
  }

  /* Không để container hoặc card bóp quá nhỏ */
  .container, .container-fluid {
    padding-left: 0.75rem !important;
    padding-right: 0.75rem !important;
  }

  /* Nếu nút nằm trong hàng flex, cho nó full chiều rộng */
  .d-flex > .btn {
    flex: 1 1 100% !important;
    text-align: center;
  }

  /* Bố cục phần tiêu đề trang (nếu có flex) - căn giữa */
  .page-header, .book-list-header, .section-header {
    flex-direction: column !important;
    align-items: center !important;
    text-align: center !important;
  }
}

/* Cực nhỏ (điện thoại rất nhỏ như iPhone SE) */
@media (max-width: 480px) {
  .btn {
    font-size: 0.9rem !important;
    padding: 0.45rem 0.8rem !important;
  }
}
