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: 60px;
}

/* PWA Styles */

/* Offline mode indicator */
.offline-mode:before {
  content: 'You are offline';
  display: block;
  background-color: #f8d7da;
  color: #721c24;
  text-align: center;
  padding: 0.5rem;
  font-size: 0.875rem;
  position: sticky;
  top: 0;
  z-index: 1030;
}

/* Update notification */
.update-notification {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background-color: #5c2d91;
  color: white;
  padding: 1rem;
  z-index: 1050;
}

.update-notification-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 600px;
  margin: 0 auto;
}

.update-notification p {
  margin: 0;
}

/* iOS install prompt */
.ios-install-instruction {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background-color: #f8f9fa;
  border-top: 1px solid #dee2e6;
  padding: 1rem;
  z-index: 1040;
}

.ios-install-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 600px;
  margin: 0 auto;
}

.ios-install-content p {
  margin: 0;
}

.ios-share-icon {
  display: inline-block;
  width: 20px;
  height: 20px;
  background-image: url('/images/icons/ios-share.svg');
  background-size: contain;
  background-repeat: no-repeat;
  vertical-align: middle;
}

/* Install button */
#install-button {
  display: none;
}

/* Responsive image handling */
.img-fluid {
  max-width: 100%;
  height: auto;
}

/* Book card styles for offline mode */
.offline-mode .book-card {
  opacity: 0.8;
}

.offline-mode .book-card .btn-primary {
  background-color: #6c757d;
  border-color: #6c757d;
}

/* Hide elements that require online functionality when offline */
.offline-mode .online-only {
  display: none !important;
}

/* Show elements only when offline */
.offline-only {
  display: none;
}

.offline-mode .offline-only {
  display: block;
}

/* Skeleton loading placeholders for lazy loading */
.skeleton-loader {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
  border-radius: 4px;
}

@keyframes loading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* Network status notifications */
.network-notification {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 10px 15px;
  border-radius: 5px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  z-index: 1060;
  opacity: 0;
  transform: translateY(-20px);
  transition: opacity 0.3s, transform 0.3s;
}

.network-notification.show {
  opacity: 1;
  transform: translateY(0);
}

.network-notification .notification-content {
  font-size: 0.9rem;
}

.notification-success {
  background-color: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.notification-warning {
  background-color: #fff3cd;
  color: #856404;
  border: 1px solid #ffeeba;
}

.notification-danger {
  background-color: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

/* Lazy loading image styles */
img.lazy {
  opacity: 0;
  transition: opacity 0.5s;
}

img.lazy.loaded {
  opacity: 1;
}

/* Language Switcher Styles */
.flag-icon {
    font-size: 1.2rem;
    line-height: 1;
}

#languageDropdown {
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
}

#languageDropdown:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.language-text {
    font-size: 0.8rem;
    font-weight: 500;
    margin-left: 0.25rem;
}

.dropdown-menu-end {
    right: 0;
    left: auto;
}

/* Ensure the navbar is properly right-aligned */
.navbar .d-flex.align-items-center {
    margin-left: auto;
}

/* Notification Center Styles */
.notification-dropdown .notification-badge {
    position: absolute;
    top: 0;
    right: 0;
    background-color: #dc3545;
    color: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 0.7rem;
    text-align: center;
    line-height: 18px;
    font-weight: bold;
}

.notification-dropdown-menu {
    width: 320px;
    max-height: 400px;
    overflow-y: auto;
}

.notification-list {
    max-height: 300px;
    overflow-y: auto;
}

.notification-item {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid rgba(0,0,0,.05);
    cursor: pointer;
    transition: background-color 0.2s;
}

.notification-item:hover {
    background-color: rgba(0,0,0,.03);
}

.notification-item.unread {
    background-color: rgba(13, 110, 253, 0.05);
}

.notification-item .notification-time {
    font-size: 0.75rem;
    color: #6c757d;
}

.notification-item .notification-title {
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.notification-item .notification-body {
    font-size: 0.875rem;
    margin-bottom: 0;
    color: #6c757d;
}

.notification-item .notification-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 0.75rem;
}

.notification-item .notification-icon i {
    font-size: 1.2rem;
    color: #6c757d;
}

.notification-item .notification-icon.message i {
    color: #0d6efd;
}

.notification-item .notification-icon.transaction i {
    color: #198754;
}

.notification-item .notification-icon.watchlist i {
    color: #fd7e14;
}

.notification-item .notification-icon.book i {
    color: #6610f2;
}