#home-library-modal {
  position: fixed !important;
  top: var(--topbar-height, 56px) !important;
  left: 0 !important;
  width: 100% !important;
  height: calc(100% - var(--topbar-height, 56px)) !important;
  z-index: 100180 !important;
  background-color: rgba(0, 0, 0, 0.7);
  display: flex;
  justify-content: center;
  align-items: center;
}

.home-library-modal-content {
  max-width: 95vw;
  width: 95vw;
  max-height: 90vh;
  height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--color-hover, #f8f9fa);
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.home-library-modal-content .modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--color-border-light, #dee2e6);
  background: var(--color-hover, #f8f9fa);
  border-radius: 12px 12px 0 0;
  flex-shrink: 0;
}

.home-library-modal-content .modal-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: var(--color-text, #1f2933);
}

.home-library-modal-content .modal-close {
  background: none;
  border: none;
  color: var(--color-text, #1f2933);
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  transition: background-color 0.2s ease;
  font-size: 24px;
  line-height: 1;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.home-library-modal-content .modal-close:hover {
  background: var(--color-panel-bg, #fff);
}

.home-library-modal-content .modal-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0;
}

#home-library-modal .library-content {
  display: flex;
  flex-direction: column;
  gap: 0;
  height: 100%;
  overflow: hidden;
  position: relative;
}

.books-zone-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--color-border, #e2e8f0);
  gap: 16px;
}

.books-zone-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--color-text, #1f2933);
}

.books-language-selector {
  flex-shrink: 0;
  min-width: 120px;
  min-height: 32px;
}

.books-zone-header-right {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
}

.books-language-selector .language-selector-group {
  margin: 0;
}

.btn-new-book {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  background: var(--color-button-yellow, #fbbf24);
  color: var(--color-button-text-yellow, #1f2933);
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
  flex-shrink: 0;
}

.btn-new-book:hover {
  background: var(--color-button-yellow-dark, #eab308);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.btn-new-book i {
  width: 18px;
  height: 18px;
}

.books-list {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 12px;
}

.books-list::-webkit-scrollbar {
  width: 6px;
}

.books-list::-webkit-scrollbar-track {
  background: transparent;
}

.books-list::-webkit-scrollbar-thumb {
  background: var(--color-border, #dee2e6);
  border-radius: 3px;
}

.book-card-mini {
  width: 100px;
  min-height: 100px;
  background: var(--color-panel-bg, #fff);
  border: 2px solid transparent;
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  transition: none;
  position: relative;
  display: flex;
  flex-direction: column;
}

.book-card-mini:hover {
  box-shadow: none;
  transform: none;
}

.book-card-mini.active {
  border-color: var(--color-text, #1f2933);
  box-shadow: none;
}

.book-card-mini.foreign {
  background: var(--color-panel-bg, #fff);
}

.book-card-mini-cover-wrapper {
  width: 100px;
  height: 100px;
  position: relative;
  overflow: hidden;
  border-radius: 12px 12px 0 0;
  background: var(--color-hover, #f8f9fa);
  flex-shrink: 0;
}

.book-card-mini-cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.book-card-mini-cover-placeholder {
  width: 100%;
  height: 100%;
  background: var(--color-hover, #f8f9fa);
  display: flex;
  align-items: center;
  justify-content: center;
}

.book-card-mini-cover-placeholder i {
  width: 48px;
  height: 48px;
  color: var(--color-text-secondary, #6b7280);
}

.book-card-mini-creator-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0, 0, 0, 0.5);
  padding: 4px 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.book-card-mini-creator {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}

.book-card-mini-creator img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.book-card-mini-creator-name {
  color: #ffffff;
  font-size: 11px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}

.book-card-mini-title {
  padding: 4px 6px;
  font-size: 11px;
  font-weight: 600;
  color: var(--color-text, #1f2933);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  background: var(--color-panel-bg, #fff);
  border-radius: 0 0 12px 12px;
}
