/*
Theme Name: Biblioteca Virtual Acadêmica
Description: Tema completo para biblioteca virtual com funcionalidades de upload de PDFs, leitor integrado, player de vídeo avançado e sistema de categorização acadêmica.
Author: Manus AI
Version: 1.0.0
License: GPL v2 or later
Text Domain: biblioteca-virtual
Tags: education, library, academic, pdf-reader, video-player, responsive
*/

/* Reset e Base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  line-height: 1.6;
  color: #1f2937;
  background-color: #f9fafb;
}

/* Container Principal */
.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* Header */
.site-header {
  background: #ffffff;
  border-bottom: 1px solid #e5e7eb;
  position: sticky;
  top: 0;
  z-index: 50;
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 4rem;
  padding: 0 1rem;
}

.site-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: #1f2937;
}

.site-logo h1 {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0;
}

.logo-icon {
  width: 2rem;
  height: 2rem;
  color: #2563eb;
}

/* Navegação */
.main-navigation {
  display: none;
}

.main-navigation.active {
  display: block;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #ffffff;
  border-bottom: 1px solid #e5e7eb;
  padding: 1rem;
}

.nav-menu {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.nav-menu a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  text-decoration: none;
  color: #374151;
  border-radius: 0.5rem;
  transition: background-color 0.2s;
}

.nav-menu a:hover {
  background-color: #f3f4f6;
}

/* Busca */
.search-form {
  position: relative;
  flex: 1;
  max-width: 32rem;
  margin: 0 2rem;
}

.search-input {
  width: 100%;
  padding: 0.5rem 0.75rem 0.5rem 2.5rem;
  border: 1px solid #d1d5db;
  border-radius: 0.5rem;
  font-size: 0.875rem;
}

.search-icon {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  width: 1rem;
  height: 1rem;
  color: #9ca3af;
}

/* Menu Toggle */
.menu-toggle {
  display: block;
  background: none;
  border: none;
  padding: 0.5rem;
  cursor: pointer;
}

/* Hero Section */
.hero-section {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  color: white;
  padding: 2rem 0;
  border-radius: 0.5rem;
  margin: 1.5rem 0;
}

.hero-content {
  text-align: center;
  padding: 0 1rem;
}

.hero-title {
  font-size: 1.875rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.hero-description {
  font-size: 1.125rem;
  margin-bottom: 2rem;
  opacity: 0.9;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-top: 2rem;
}

.stat-item {
  text-align: center;
}

.stat-number {
  font-size: 1.5rem;
  font-weight: 700;
}

.stat-label {
  font-size: 0.875rem;
  opacity: 0.8;
}

/* Cards */
.card {
  background: white;
  border-radius: 0.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  transition: box-shadow 0.3s;
}

.card:hover {
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.card-header {
  padding: 1.5rem 1.5rem 0.75rem;
}

.card-title {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  line-height: 1.4;
}

.card-description {
  font-size: 0.875rem;
  color: #6b7280;
}

.card-content {
  padding: 0 1.5rem 1.5rem;
}

/* Grid de Documentos */
.documents-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  margin: 2rem 0;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 500;
  border-radius: 9999px;
  border: 1px solid transparent;
}

.badge-mestrado {
  background-color: #dbeafe;
  color: #1e40af;
}

.badge-doutorado {
  background-color: #dcfce7;
  color: #166534;
}

.badge-pos-graduacao {
  background-color: #f3e8ff;
  color: #7c3aed;
}

.badge-videos {
  background-color: #fed7aa;
  color: #c2410c;
}

/* Botões */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 0.375rem;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s;
}

.btn-primary {
  background-color: #2563eb;
  color: white;
}

.btn-primary:hover {
  background-color: #1d4ed8;
}

.btn-outline {
  background-color: transparent;
  color: #374151;
  border: 1px solid #d1d5db;
}

.btn-outline:hover {
  background-color: #f9fafb;
}

.btn-sm {
  padding: 0.375rem 0.75rem;
  font-size: 0.75rem;
}

/* Leitor de PDF */
.pdf-reader {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: #1f2937;
  z-index: 9999;
  display: none; /* Oculto por padrão */
  flex-direction: column;
}

.pdf-reader.active {
  display: flex; /* Mostrar quando ativo */
}

.pdf-reader-header {
  background: #374151;
  color: white;
  padding: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.pdf-reader-content {
  flex: 1;
  display: flex;
  overflow: hidden;
}

.pdf-sidebar {
  width: 16rem;
  background: #f3f4f6;
  border-right: 1px solid #d1d5db;
  overflow-y: auto;
}

.pdf-viewer {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.pdf-toolbar {
  background: #e5e7eb;
  padding: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #d1d5db;
}

.pdf-canvas-container {
  flex: 1;
  overflow: auto;
  background: #d1d5db;
  padding: 1rem;
  display: flex;
  justify-content: center;
}

.pdf-canvas {
  background: white;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  max-width: 100%;
  height: auto;
}

/* Player de Vídeo */
.video-player {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: black;
  z-index: 9999;
  display: none; /* Oculto por padrão */
  flex-direction: column;
}

.video-player.active {
  display: flex; /* Mostrar quando ativo */
}

.video-player-header {
  background: rgba(0, 0, 0, 0.8);
  color: white;
  padding: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.video-container {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.video-element {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.video-controls {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
  padding: 1rem;
  color: white;
}

.video-progress {
  width: 100%;
  height: 0.5rem;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 0.25rem;
  margin-bottom: 1rem;
  cursor: pointer;
}

.video-progress-bar {
  height: 100%;
  background: #ef4444;
  border-radius: 0.25rem;
  transition: width 0.1s;
}

.video-controls-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Formulário de Upload */
.upload-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 1rem;
}

.upload-form {
  background: white;
  border-radius: 0.5rem;
  max-width: 42rem;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
}

.upload-header {
  padding: 1.5rem;
  border-bottom: 1px solid #e5e7eb;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.upload-content {
  padding: 1.5rem;
}

.upload-dropzone {
  border: 2px dashed #d1d5db;
  border-radius: 0.5rem;
  padding: 3rem 1.5rem;
  text-align: center;
  transition: border-color 0.2s;
  cursor: pointer;
  margin-bottom: 1.5rem;
}

.upload-dropzone:hover {
  border-color: #9ca3af;
}

.upload-dropzone.active {
  border-color: #10b981;
  background-color: #f0fdf4;
}

/* Responsividade */
@media (min-width: 768px) {
  .main-navigation {
    display: block;
    position: static;
    background: none;
    border: none;
    padding: 0;
  }

  .nav-menu {
    flex-direction: row;
  }

  .menu-toggle {
    display: none;
  }

  .search-form {
    display: block;
  }

  .hero-title {
    font-size: 3rem;
  }

  .hero-description {
    font-size: 1.25rem;
  }

  .stats-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .documents-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .documents-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Utilitários */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.hidden {
  display: none;
}

.text-center {
  text-align: center;
}

.mb-4 {
  margin-bottom: 1rem;
}

.mb-6 {
  margin-bottom: 1.5rem;
}

.mt-8 {
  margin-top: 2rem;
}

.p-4 {
  padding: 1rem;
}

.p-6 {
  padding: 1.5rem;
}


/* Seção de Categorias */
.categories-section {
  padding: 2rem 0;
}

.categories-header {
  text-align: center;
}

.section-title {
  font-size: 2rem;
  font-weight: 600;
  color: #1a202c;
  margin-bottom: 0.5rem;
}

.section-subtitle {
  font-size: 1.1rem;
  color: #718096;
  margin-bottom: 0;
}

.categories-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  margin-top: 2rem;
}

@media (min-width: 640px) {
  .categories-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .categories-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.category-card {
  background: white;
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  border: 1px solid #e2e8f0;
  transition: all 0.3s ease;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.category-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 25px -3px rgba(0, 0, 0, 0.1);
}

.category-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 60px;
  height: 60px;
  background: #f7fafc;
  border-radius: 12px;
  margin-bottom: 1rem;
  color: #4a5568;
}

.category-content {
  margin-bottom: 1.5rem;
}

.category-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: #1a202c;
  margin-bottom: 0.5rem;
}

.category-count {
  font-size: 2rem;
  font-weight: 700;
  color: #2d3748;
  margin-bottom: 0.75rem;
}

.category-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.875rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.category-badge.orange {
  background: #fed7d7;
  color: #c53030;
}

.category-badge.purple {
  background: #e9d8fd;
  color: #805ad5;
}

.category-badge.blue {
  background: #bee3f8;
  color: #3182ce;
}

.category-badge.green {
  background: #c6f6d5;
  color: #38a169;
}

.category-button {
  width: 100%;
  padding: 0.75rem 1rem;
  background: #4299e1;
  color: white;
  border: none;
  border-radius: 8px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.category-button:hover {
  background: #3182ce;
}

/* Animações para os cards */
.category-card[data-category="tese"] .category-icon {
  background: linear-gradient(135deg, #fed7d7 0%, #feb2b2 100%);
  color: #c53030;
}

.category-card[data-category="monografia"] .category-icon {
  background: linear-gradient(135deg, #e9d8fd 0%, #d6bcfa 100%);
  color: #805ad5;
}

.category-card[data-category="dissertacao"] .category-icon {
  background: linear-gradient(135deg, #bee3f8 0%, #90cdf4 100%);
  color: #3182ce;
}

.category-card[data-category="videos"] .category-icon {
  background: linear-gradient(135deg, #c6f6d5 0%, #9ae6b4 100%);
  color: #38a169;
}

/* Responsividade adicional */
@media (max-width: 640px) {
  .categories-section {
    padding: 1rem 0;
  }
  
  .section-title {
    font-size: 1.5rem;
  }
  
  .category-card {
    padding: 1rem;
  }
  
  .category-icon {
    width: 50px;
    height: 50px;
  }
  
  .category-count {
    font-size: 1.5rem;
  }
}

