html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
  position: relative;
  min-height: 100%;
}

body {
  margin-bottom: 0;
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  min-height: 100vh;
}

/* ===== ENHANCED NAVIGATION STYLES ===== */

/* Top Notification Bar */
.top-notification-bar {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 0.5rem 0;
  font-size: 0.875rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.top-notification-bar a {
  transition: all 0.3s ease;
}

.top-notification-bar a:hover {
  opacity: 0.8;
  transform: translateY(-1px);
}

/* Enhanced Brand Logo */
.brand-logo {
  width: 50px;
  height: 50px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.brand-text {
  line-height: 1.2;
}

/* Navigation Spacing */
.navbar-brand {
  margin-right: 2rem !important;
  min-width: 180px;
}

.navbar-nav {
  margin-left: 1.5rem;
}

.nav-item {
  margin-right: 1rem;
}

.nav-item:last-child {
  margin-right: 0;
}

/* Enhanced Navigation Links */
.nav-link-enhanced {
  font-weight: 500;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  transition: all 0.3s ease;
  margin: 0 0.25rem;
  position: relative;
  color: #495057 !important;
  white-space: nowrap;
}

.nav-link-enhanced:hover {
  background: rgba(102, 126, 234, 0.1);
  color: #667eea !important;
  transform: translateY(-1px);
}

.nav-link-enhanced::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  transition: all 0.3s ease;
  transform: translateX(-50%);
}

.nav-link-enhanced:hover::after {
  width: 80%;
}

/* Search Container */
.search-container {
  max-width: 300px;
}

.search-box {
  position: relative;
  display: flex;
  align-items: center;
}

.search-input {
  border-radius: 25px;
  border: 2px solid #e9ecef;
  padding: 0.5rem 1rem;
  padding-right: 3rem;
  transition: all 0.3s ease;
  background: #f8f9fa;
}

.search-input:focus {
  border-color: #667eea;
  box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
  background: white;
}

.search-btn {
  position: absolute;
  right: 5px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border: none;
  border-radius: 50%;
  width: 35px;
  height: 35px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  transition: all 0.3s ease;
}

.search-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

/* Enhanced User Menu */
.user-menu-toggle {
  padding: 0.5rem 1rem;
  border-radius: 25px;
  transition: all 0.3s ease;
  background: rgba(102, 126, 234, 0.05);
  border: 1px solid rgba(102, 126, 234, 0.1);
}

.user-menu-toggle:hover {
  background: rgba(102, 126, 234, 0.1);
  transform: translateY(-1px);
}

.user-avatar {
  position: relative;
}

.user-avatar img {
  width: 35px;
  height: 35px;
  object-fit: cover;
  border: 2px solid #e0e7ff;
  transition: all 0.3s ease;
}

.online-indicator {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 12px;
  height: 12px;
  background: #28a745;
  border: 2px solid white;
  border-radius: 50%;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(40, 167, 69, 0.7); }
  70% { box-shadow: 0 0 0 10px rgba(40, 167, 69, 0); }
  100% { box-shadow: 0 0 0 0 rgba(40, 167, 69, 0); }
}

.user-dropdown {
  border: none;
  border-radius: 15px;
  padding: 1rem 0;
  min-width: 280px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
}

.user-dropdown .dropdown-header {
  padding: 1rem 1.5rem;
  background: rgba(102, 126, 234, 0.05);
  border-bottom: 1px solid rgba(102, 126, 234, 0.1);
}

.user-dropdown .dropdown-item {
  padding: 0.75rem 1.5rem;
  transition: all 0.3s ease;
  border-radius: 0;
}

.user-dropdown .dropdown-item:hover {
  background: rgba(102, 126, 234, 0.1);
  color: #667eea;
  transform: translateX(5px);
}

/* Admin Button */
.admin-btn {
  background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
  border: none;
  box-shadow: 0 4px 15px rgba(220, 53, 69, 0.4);
  transition: all 0.3s ease;
}

.admin-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(220, 53, 69, 0.6);
}

/* Enhanced Navbar */
.navbar {
  background: rgba(255, 255, 255, 0.95) !important;
  backdrop-filter: blur(20px);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  padding: 0.75rem 0;
}

.navbar-brand {
  transition: all 0.3s ease;
}

.navbar-brand:hover {
  transform: scale(1.05);
}

.navbar-toggler {
  border: none;
  padding: 0.5rem;
  border-radius: 8px;
  transition: all 0.3s ease;
}

.navbar-toggler:hover {
  background: rgba(102, 126, 234, 0.1);
}

.navbar-toggler:focus {
  box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

/* Responsive Navigation */
@media (max-width: 991.98px) {
  .search-container {
    order: 3;
    margin: 1rem 0;
    max-width: 100%;
  }
  
  .navbar-nav {
    margin-bottom: 1rem;
  }
  
  .user-info {
    display: none !important;
  }
  
  .user-menu-toggle {
    justify-content: center;
  }
}

@media (max-width: 767.98px) {
  .top-notification-bar {
    font-size: 0.75rem;
    padding: 0.25rem 0;
  }
  
  .top-notification-bar .d-flex {
    flex-direction: column;
    gap: 0.5rem;
    text-align: center;
  }
  
  .brand-logo {
    width: 40px;
    height: 40px;
  }
  
  .brand-text .fs-4 {
    font-size: 1.1rem !important;
  }
  
  .brand-text .fs-6 {
    font-size: 0.8rem !important;
  }
}

/* ===== EXISTING STYLES CONTINUE BELOW ===== */

/* Modern Card Enhancements */
.book-cover {
    width: 100%;
    height: 300px;
    object-fit: cover;
    border-radius: 16px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.12);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.book-card:hover .book-cover {
    transform: scale(1.05);
    box-shadow: 0 12px 40px rgba(0,0,0,0.25);
}

.author-photo {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: 50%;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    border: 4px solid #fff;
    margin: 0 auto 1rem auto;
    display: block;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.author-card:hover .author-photo {
    transform: scale(1.1);
    box-shadow: 0 8px 32px rgba(0,0,0,0.25);
}

.table td {
    vertical-align: middle;
}

/* Enhanced Card Styling */
.book-card, .author-card, .review-card {
    margin-bottom: 2rem;
    transition: all 0.3s ease;
    border-radius: 1.5rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    background: #fff;
    border: none;
    overflow: hidden;
}
.book-card:hover, .author-card:hover, .review-card:hover {
    box-shadow: 0 12px 40px rgba(102,126,234,0.25);
    transform: translateY(-8px) scale(1.02);
}

.book-cover {
    width: 100%;
    height: 300px;
    object-fit: cover;
    border-radius: 1.5rem 1.5rem 0 0;
    background: #e9ecef;
    transition: all 0.3s ease;
    display: block;
}

.img-placeholder {
    width: 100%;
    height: 300px;
    background: #e9ecef url('/images/placeholder.jpg') center center/cover no-repeat;
    border-radius: 1.5rem 1.5rem 0 0;
}

.card-skeleton {
    width: 100%;
    height: 300px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    border-radius: 1.5rem 1.5rem 0 0;
    animation: skeleton-loading 1.2s infinite linear;
}
@keyframes skeleton-loading {
    0% { background-position: -200px 0; }
    100% { background-position: calc(200px + 100%) 0; }
}

/* Modern Button Styling */
.btn {
    border-radius: 12px;
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    transition: all 0.3s ease;
    border: none;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.6);
}

.btn-success {
    background: linear-gradient(135deg, #56ab2f 0%, #a8e6cf 100%);
    box-shadow: 0 4px 15px rgba(86, 171, 47, 0.4);
}

.btn-danger {
    background: linear-gradient(135deg, #ff416c 0%, #ff4b2b 100%);
    box-shadow: 0 4px 15px rgba(255, 65, 108, 0.4);
}

/* Enhanced Form Styling */
.form-control {
    border-radius: 12px;
    border: 2px solid #e9ecef;
    padding: 0.75rem 1rem;
    transition: all 0.3s ease;
}

.form-control:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

/* Modern Alert Styling */
.alert {
    border-radius: 12px;
    border: none;
    padding: 1rem 1.5rem;
    margin-bottom: 1.5rem;
}

.alert-success {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    color: #155724;
    border-left: 4px solid #28a745;
}

.alert-danger {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    color: #721c24;
    border-left: 4px solid #dc3545;
}

/* Enhanced Navigation */
.navbar {
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(20px);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.navbar-nav .nav-link {
    font-weight: 500;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    margin: 0 0.25rem;
}

.navbar-nav .nav-link:hover {
    background: rgba(102, 126, 234, 0.1);
    color: #667eea !important;
    transform: translateY(-1px);
}

/* Responsive Improvements */
@media (max-width: 768px) {
    .book-card, .author-card {
        margin-bottom: 1.5rem;
    }
    
    .btn {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }
    
    .navbar-brand {
        font-size: 1.1rem !important;
    }
}

/* Loading States */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.spinner-border-sm {
    width: 1rem;
    height: 1rem;
}

/* Enhanced Footer */
.footer-blue {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    padding: 2rem 0;
    margin-top: 3rem;
    border-radius: 1.5rem 1.5rem 0 0;
    position: relative;
    z-index: 1000;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.1);
    margin-bottom: 0 !important;
}

.footer-blue .social-icons a {
    color: #fff;
    margin: 0 0.5rem;
    font-size: 1.5rem;
    transition: all 0.3s ease;
    opacity: 0.8;
    text-decoration: none;
    padding: 0.5rem;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 45px;
    height: 45px;
}

.footer-blue .social-icons a:hover {
    color: #fff;
    opacity: 1;
    transform: translateY(-3px) scale(1.1);
    text-decoration: none;
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* Individual social media icon colors on hover */
.footer-blue .social-icons a[href*="tiktok"]:hover {
    background: rgba(0, 0, 0, 0.8);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.4);
}

.footer-blue .social-icons a[href*="instagram"]:hover {
    background: linear-gradient(45deg, rgba(225, 48, 108, 0.8), rgba(252, 175, 69, 0.8));
    box-shadow: 0 5px 15px rgba(225, 48, 108, 0.4);
}

.footer-blue .social-icons a[href*="linkedin"]:hover {
    background: rgba(0, 119, 181, 0.8);
    box-shadow: 0 5px 15px rgba(0, 119, 181, 0.4);
}

/* Toast Notifications */
.toast-container {
    z-index: 1060;
}

/* Trademark Badge Enhancement */
.trademark-badge {
    position: fixed;
    right: 18px;
    bottom: 120px; /* Increased distance from bottom to avoid footer overlap */
    background: rgba(34, 54, 94, 0.95);
    color: #ffd700;
    font-size: 1.15rem;
    padding: 12px 24px 12px 18px;
    border-radius: 25px 10px 25px 10px;
    z-index: 9999;
    box-shadow: 0 8px 32px rgba(58,123,213,0.3);
    font-family: 'Segoe UI Semibold', 'Segoe UI', Arial, sans-serif;
    letter-spacing: 0.7px;
    pointer-events: auto; /* Changed to auto so links work */
    user-select: none;
    display: flex;
    align-items: center;
    gap: 0.5em;
    animation: trademark-glow 3s infinite alternate;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.trademark-badge:hover {
    transform: scale(1.05);
    box-shadow: 0 12px 40px rgba(58,123,213,0.4);
}

.trademark-badge .trademark-link {
    color: #ffd700;
    text-decoration: none;
    transition: color 0.3s ease;
}

.trademark-badge .trademark-link:hover {
    color: #fff;
}

/* Responsive adjustments for trademark badge */
@media (max-width: 768px) {
    .trademark-badge {
        right: 10px;
        bottom: 100px;
        font-size: 1rem;
        padding: 10px 20px 10px 15px;
    }
}

@keyframes trademark-glow {
    from { 
        box-shadow: 0 8px 32px rgba(58,123,213,0.3), 0 0 12px #00d2ff99;
        transform: scale(1);
    }
    to { 
        box-shadow: 0 12px 40px #00d2ff66, 0 0 20px #ffd70099;
        transform: scale(1.02);
    }
}

/* Ensure main content never gets hidden by footer */
main.container {
    padding-bottom: 0;
    min-height: calc(100vh - 200px); /* Ensure minimum height for content */
}

/* Card content styling */
.card-body {
    padding: 1.5rem;
}

.card-title {
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 0.75rem;
}

.card-text {
    color: #6c757d;
    line-height: 1.6;
}

/* Rating stars */
.rating {
    color: #ffc107;
    font-size: 1.2rem;
}

/* Responsive grid improvements */
@media (min-width: 768px) {
    .book-list .row > [class^='col-']:last-child {
        margin-bottom: 3rem;
    }
}

/* Focus improvements for accessibility */
.btn:focus, .btn:focus-visible, .nav-link:focus, .nav-link:focus-visible {
    outline: 3px solid #667eea !important;
    outline-offset: 2px;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.25);
    z-index: 2;
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Enhanced form validation styling */
.form-control.is-invalid {
    border-color: #dc3545;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
}

.form-control.is-valid {
    border-color: #28a745;
    box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.25);
}

/* Loading animation for async operations */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    backdrop-filter: blur(5px);
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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