/**
 * PDF Viewer Pro - Styles Premium
 * Version: 2.0.0
 * Styles pour les fonctionnalités premium
 */

/* ===== RECHERCHE ===== */
.pdfv-search {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  background: rgba(0, 0, 0, 0.9);
  color: white;
  padding: 10px;
  z-index: 1000;
  display: none;
}

.pdfv-search[data-open="1"] {
  display: block;
}

.pdfv-search-header {
  display: flex;
  align-items: center;
  gap: 10px;
}

.pdfv-search-input {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid #555;
  border-radius: 4px;
  background: #333;
  color: white;
  font-size: 14px;
}

.pdfv-search-input:focus {
  outline: none;
  border-color: #007cba;
  box-shadow: 0 0 0 2px rgba(0, 124, 186, 0.3);
}

.pdfv-search-prev,
.pdfv-search-next {
  padding: 8px 12px;
  background: #555;
  border: none;
  border-radius: 4px;
  color: white;
  cursor: pointer;
  font-size: 16px;
}

.pdfv-search-prev:hover,
.pdfv-search-next:hover {
  background: #666;
}

.pdfv-search-prev:disabled,
.pdfv-search-next:disabled {
  background: #333;
  color: #666;
  cursor: not-allowed;
}

.pdfv-search-count {
  font-size: 14px;
  color: #ccc;
  min-width: 60px;
  text-align: center;
}

.pdfv-search-close {
  padding: 8px 12px;
  background: #d32f2f;
  border: none;
  border-radius: 4px;
  color: white;
  cursor: pointer;
  font-size: 16px;
}

.pdfv-search-close:hover {
  background: #f44336;
}

.pdfv-search-error {
  margin-top: 10px;
  padding: 8px 12px;
  background: #d32f2f;
  border-radius: 4px;
  font-size: 14px;
}

/* ===== MINIATURES ===== */
.pdfv-thumbnails {
  position: absolute;
  top: 0;
  left: 0;
  width: 200px;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  color: white;
  padding: 10px;
  z-index: 1000;
  overflow-y: auto;
  display: none;
}

.pdfv-thumbnails[data-open="1"] {
  display: block;
}

.pdfv-thumbnail {
  margin-bottom: 10px;
  cursor: pointer;
  border: 2px solid transparent;
  border-radius: 4px;
  overflow: hidden;
  transition: border-color 0.2s;
}

.pdfv-thumbnail:hover {
  border-color: #007cba;
}

.pdfv-thumbnail.active {
  border-color: #007cba;
  background: rgba(0, 124, 186, 0.2);
}

.pdfv-thumbnail img {
  width: 100%;
  height: auto;
  display: block;
}

.pdfv-thumbnail-page {
  display: block;
  padding: 4px 8px;
  background: rgba(0, 0, 0, 0.7);
  font-size: 12px;
  text-align: center;
}

/* ===== TABLE DES MATIÈRES ===== */
.pdfv-toc {
  position: absolute;
  top: 0;
  right: 0;
  width: 250px;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  color: white;
  padding: 10px;
  z-index: 1000;
  overflow-y: auto;
  display: none;
}

.pdfv-toc[data-open="1"] {
  display: block;
}

.pdfv-toc-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.pdfv-toc-list li {
  margin-bottom: 5px;
}

.pdfv-toc-list a {
  display: block;
  padding: 8px 12px;
  color: white;
  text-decoration: none;
  border-radius: 4px;
  transition: background-color 0.2s;
}

.pdfv-toc-list a:hover {
  background: rgba(255, 255, 255, 0.1);
}

.pdfv-toc-list a.active {
  background: rgba(0, 124, 186, 0.3);
  color: #007cba;
}

/* ===== WATERMARK ===== */
.pdfv-watermark {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-45deg);
  font-size: 48px;
  color: rgba(255, 0, 0, 0.3);
  pointer-events: none;
  user-select: none;
  z-index: 100;
}

/* ===== LIGHTBOX ===== */
.pdfv-lightbox {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.9);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pdfv-lightbox-content {
  position: relative;
  width: 90%;
  height: 90%;
  max-width: 1200px;
  max-height: 800px;
}

.pdfv-lightbox-close {
  position: absolute;
  top: -40px;
  right: 0;
  background: #d32f2f;
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  color: white;
  font-size: 20px;
  cursor: pointer;
  z-index: 10001;
}

.pdfv-lightbox-close:hover {
  background: #f44336;
}

.pdfv-lightbox-viewer {
  width: 100%;
  height: 100%;
  background: white;
  border-radius: 8px;
  overflow: hidden;
}

/* ===== BOUTONS TOOLBAR PRO ===== */
.pdfv-toolbar .pdfv-btn[data-pro="true"] {
  background: linear-gradient(135deg, #007cba, #005a87);
  color: white;
  border: 1px solid #005a87;
}

.pdfv-toolbar .pdfv-btn[data-pro="true"]:hover {
  background: linear-gradient(135deg, #005a87, #003d5c);
  border-color: #003d5c;
}

.pdfv-toolbar .pdfv-btn[data-pro="true"]:active {
  background: linear-gradient(135deg, #003d5c, #002a3f);
  border-color: #002a3f;
}

/* ===== ANIMATIONS ===== */
@keyframes pdfv-fade-in {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes pdfv-slide-in-left {
  from { transform: translateX(-100%); }
  to { transform: translateX(0); }
}

@keyframes pdfv-slide-in-right {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}

.pdfv-search[data-open="1"] {
  animation: pdfv-fade-in 0.3s ease-out;
}

.pdfv-thumbnails[data-open="1"] {
  animation: pdfv-slide-in-left 0.3s ease-out;
}

.pdfv-toc[data-open="1"] {
  animation: pdfv-slide-in-right 0.3s ease-out;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .pdfv-thumbnails {
    width: 150px;
  }
  
  .pdfv-toc {
    width: 200px;
  }
  
  .pdfv-search-header {
    flex-wrap: wrap;
    gap: 5px;
  }
  
  .pdfv-search-input {
    min-width: 200px;
  }
}

@media (max-width: 480px) {
  .pdfv-thumbnails {
    width: 120px;
  }
  
  .pdfv-toc {
    width: 180px;
  }
  
  .pdfv-search-header {
    flex-direction: column;
  }
  
  .pdfv-search-input {
    width: 100%;
    min-width: auto;
  }
}

/* ===== ACCESSIBILITÉ ===== */
.pdfv-search:focus-within,
.pdfv-thumbnails:focus-within,
.pdfv-toc:focus-within {
  outline: 2px solid #007cba;
  outline-offset: 2px;
}

.pdfv-btn:focus-visible {
  outline: 2px solid #007cba;
  outline-offset: 2px;
}

/* ===== THÈME SOMBRE ===== */
@media (prefers-color-scheme: dark) {
  .pdfv-search {
    background: rgba(20, 20, 20, 0.95);
  }
  
  .pdfv-thumbnails {
    background: rgba(20, 20, 20, 0.95);
  }
  
  .pdfv-toc {
    background: rgba(20, 20, 20, 0.95);
  }
  
  .pdfv-search-input {
    background: #333;
    border-color: #555;
  }
  
  .pdfv-search-input:focus {
    border-color: #007cba;
  }
}

/* ===== PRINT ===== */
@media print {
  .pdfv-search,
  .pdfv-thumbnails,
  .pdfv-toc,
  .pdfv-lightbox {
    display: none !important;
  }
}