/* ==========================================
   1. CONFIGURAÇÕES GERAIS
   ========================================== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&display=swap');

:root {
  --primary-color: #2563eb;
  --bg-color: #f8fafc;
  --text-color: #1e293b;
  --border-color: #e2e8f0;
  --card-bg: #ffffff;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-color);
  margin: 0;
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: background-color 0.3s ease;
}

/* ==========================================
   2. ABAS (TABS)
   ========================================== */
.tabs-container {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  width: 100%;
  max-width: 800px;
  justify-content: center;
}

.tab {
  padding: 12px 24px;
  font-size: 15px;
  font-weight: 500;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background-color: var(--card-bg);
  color: #64748b;
  cursor: pointer;
  transition: all 0.2s ease;
}

.tab.active {
  background-color: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}

.tab.disabled {
  background-color: #f1f5f9;
  color: #94a3b8;
  cursor: not-allowed;
  opacity: 0.8;
}

.badge {
  background-color: #f59e0b;
  color: white;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 12px;
  margin-left: 8px;
  font-weight: 600;
  text-transform: uppercase;
}

/* ==========================================
   3. ÁREA DE UPLOAD
   ========================================== */
.upload-section {
  width: 100%;
  max-width: 800px;
  background-color: var(--card-bg);
  padding: 24px;
  border-radius: 12px;
  border: 2px dashed var(--border-color);
  text-align: center;
  box-sizing: border-box;
  margin-bottom: 20px;
}

.upload-section label {
  display: block;
  font-weight: 500;
  margin-bottom: 12px;
}

/* ==========================================
   4. NOVO LAYOUT LATERAL (WORKSPACE)
   ========================================== */
#reader-workspace {
  width: 100%;
  max-width: 1200px; 
  margin-top: 20px;
  gap: 20px;
  align-items: flex-start;
}

/* Coluna de Ferramentas (Esquerda) */
.sidebar-tools {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.tool-btn {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  background-color: var(--card-bg);
  color: var(--text-color);
  font-weight: bold;
  font-size: 16px;
  cursor: pointer;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
  transition: all 0.2s ease;
}

.tool-btn:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
  transform: translateY(-2px);
}

/* Área Central do Livro */
.book-area {
  flex: 1;
  display: flex;
  align-items: center;
  background-color: var(--card-bg);
  border-radius: 12px;
  border: 1px solid var(--border-color);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  height: 85vh;
  min-height: 600px;
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

#viewer {
  flex: 1;
  height: 100%;
}

/* Setas Laterais (Dentro da book-area) */
.side-nav {
  height: 100%;
  width: 60px;
  border: none;
  background: transparent;
  font-size: 28px;
  color: #94a3b8;
  cursor: pointer;
  transition: all 0.2s ease;
}

.side-nav:hover {
  background-color: rgba(37, 99, 235, 0.05);
  color: var(--primary-color);
}

/* ==========================================
   5. RESPONSIVIDADE (MOBILE)
   ========================================== */
@media (max-width: 768px) {
  #reader-workspace {
    flex-direction: column-reverse;
    align-items: center;
  }
  
  .sidebar-tools {
    flex-direction: row;
    justify-content: center;
    width: 100%;
  }
  
  .book-area {
    width: 100%;
    height: 70vh;
  }
  
  .side-nav {
    width: 40px; 
  }
}