/* ====================================
   LORE.CSS - Estilos refinados
   ==================================== */

:root {
  --lore-accent: #c9a87c;
  --lore-accent-light: #e4c9a8;
  --lore-secondary: #5d4e3c;
  --lore-bg-parchment: #faf3e0;
  --lore-border: #b89b7b;
  --lore-text-dark: #2c241a;
  --lore-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  --lore-glow: 0 0 15px rgba(201, 168, 124, 0.2);
  --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== TAB BAR REFINADA ===== */
.tab-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1.5rem 0 2rem;
  padding: 0.5rem;
  background: rgba(26, 26, 46, 0.8);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--lore-border);
  border-radius: 40px;
  box-shadow: var(--lore-shadow);
}

.tab-button {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: 'Cinzel', serif;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.7rem 1.2rem;
  border-radius: 30px;
  cursor: pointer;
  transition: var(--transition-smooth);
  flex: 1 1 auto;
  text-transform: uppercase;
  letter-spacing: 1px;
  position: relative;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
}

.tab-button::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(201, 168, 124, 0.2);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.tab-button:hover::before {
  width: 150%;
  height: 150%;
}

.tab-button:hover {
  color: var(--lore-accent-light);
  transform: translateY(-1px);
}

.tab-button.active {
  background: var(--lore-accent);
  color: var(--bg-dark);
  box-shadow: var(--lore-glow);
}

/* ===== CARDS REFINADOS ===== */
.lore-page .card {
  background: linear-gradient(
    135deg,
    rgba(250, 243, 224, 0.1),
    rgba(250, 243, 224, 0.05)
  );
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--lore-border);
  border-radius: 24px;
  padding: 2rem;
  margin-bottom: 2rem;
  box-shadow: var(--lore-shadow);
  transition: var(--transition-smooth);
  position: relative;
  overflow: hidden;
}

.lore-page .card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, 
    transparent, 
    var(--lore-accent), 
    transparent
  );
  opacity: 0;
  transition: opacity 0.3s;
}

.lore-page .card:hover::before {
  opacity: 1;
}

.lore-page .card:hover {
  transform: translateY(-4px);
  border-color: var(--lore-accent);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
}

.card-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 2rem;
  border-bottom: 2px solid var(--lore-border);
  padding-bottom: 1rem;
}

.card-icon {
  font-size: 1.8rem;
  color: var(--lore-accent);
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

.card-header h2 {
  margin: 0;
  font-size: 1.8rem;
  color: var(--lore-accent-light);
  font-family: 'Cinzel', serif;
  letter-spacing: 1px;
}

/* ===== PERFIL DO AUTOR ===== */
.author-profile {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 2rem;
  padding: 1.5rem;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 16px;
}

.author-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--lore-accent), var(--lore-secondary));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  font-weight: bold;
  color: var(--bg-dark);
  border: 3px solid var(--lore-accent-light);
  box-shadow: var(--lore-glow);
  aspect-ratio: 1 / 1;
  flex-shrink: 0;
}

.author-info h3 {
  margin: 0 0 0.5rem;
  font-size: 1.4rem;
  color: var(--lore-accent-light);
}

.author-title {
  color: var(--lore-accent);
  font-style: italic;
  margin-bottom: 0.8rem;
  font-size: 0.95rem;
}

.author-bio {
  line-height: 1.6;
  color: var(--text-muted);
}

/* ===== LISTA DE TRABALHOS ===== */
.works-list {
  list-style: none;
  padding: 0;
  margin: 1rem 0;
}

.work-link {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  margin-bottom: 0.5rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  text-decoration: none;
  color: var(--text-primary);
  transition: var(--transition-smooth);
  border-left: 3px solid transparent;
}

.work-link:hover {
  background: rgba(201, 168, 124, 0.15);
  border-left-color: var(--lore-accent);
  padding-left: 1.5rem;
}

.work-title {
  font-weight: 500;
  color: var(--lore-accent-light);
}

.work-type {
  font-size: 0.8rem;
  padding: 0.2rem 0.8rem;
  background: rgba(201, 168, 124, 0.2);
  border-radius: 20px;
  color: var(--lore-accent);
}

/* ===== AUTHOR SOCIAL ===== */
.author-social {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 2px solid var(--lore-border);
  display: flex;
  justify-content: center;
}

.author-social .social-link {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.8rem 1.5rem;
  background: linear-gradient(135deg, 
    rgba(201, 168, 124, 0.15), 
    rgba(201, 168, 124, 0.05)
  );
  border: 1px solid var(--lore-border);
  border-radius: 40px;
  color: var(--text-primary);
  text-decoration: none;
  font-family: 'Crimson Text', serif;
  font-size: 1.1rem;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.author-social .social-link::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(201, 168, 124, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
  z-index: 0;
}

.author-social .social-link:hover::before {
  width: 300%;
  height: 300%;
}

.author-social .social-link:hover {
  border-color: var(--lore-accent);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(201, 168, 124, 0.3);
}

.author-social .social-icon {
  font-size: 1.4rem;
  position: relative;
  z-index: 1;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

.author-social span:not(.social-icon) {
  position: relative;
  z-index: 1;
  font-weight: 600;
  color: var(--lore-accent-light);
}

/* Versão mobile */
@media (max-width: 480px) {
  .author-social .social-link {
    width: 100%;
    justify-content: center;
    padding: 0.8rem;
  }
}

/* ===== TIMELINE DA LORE ===== */
.lore-timeline {
  position: relative;
  padding-left: 2rem;
  margin: 2rem 0;
}

.lore-timeline::before {
  content: '';
  position: absolute;
  left: 7px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, 
    transparent, 
    var(--lore-accent), 
    var(--lore-accent), 
    transparent
  );
}

.timeline-item {
  position: relative;
  margin-bottom: 2rem;
}

.timeline-marker {
  position: absolute;
  left: -2rem;
  top: 0.5rem;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--lore-accent);
  border: 3px solid var(--lore-accent-light);
  box-shadow: var(--lore-glow);
  z-index: 1;
}

.timeline-content {
  background: rgba(0, 0, 0, 0.2);
  padding: 1.2rem;
  border-radius: 12px;
  border: 1px solid var(--lore-border);
}

.timeline-content p {
  font-family: 'Crimson Text', serif;
  font-size: 1.1rem;
}

.timeline-content h3 {
  margin-top: 0;
  color: var(--lore-accent);
  font-size: 1.2rem;
}

.lore-quote {
  margin-top: 2rem;
  padding: 1.5rem;
  background: rgba(201, 168, 124, 0.1);
  border-radius: 12px;
  text-align: center;
  font-style: italic;
  border: 1px solid var(--lore-accent);
}

.lore-quote p {
  font-size: 1.1rem;
  line-height: 1.6;
  margin-bottom: 0.5rem;
}

.lore-quote cite {
  color: var(--lore-accent);
  font-size: 0.9rem;
}

/* ===== FAQ REFINADO ===== */
.faq-grid {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.faq-item {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 12px;
  border: 1px solid var(--lore-border);
  overflow: hidden;
}

.faq-item summary {
  padding: 1.2rem;
  font-weight: 600;
  color: var(--lore-accent-light);
  cursor: pointer;
  list-style: none;
  position: relative;
  transition: background 0.3s;
}

.faq-item summary:hover {
  background: rgba(201, 168, 124, 0.1);
}

.faq-item summary::after {
  content: '▼';
  position: absolute;
  right: 1.2rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.8rem;
  color: var(--lore-accent);
  transition: transform 0.3s;
}

.faq-item[open] summary::after {
  transform: translateY(-50%) rotate(180deg);
}

.faq-item p {
  padding: 0 1.2rem 1.2rem;
  margin: 0;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ===== COMMUNITY GRID ===== */
.community-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}

.community-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 1.5rem 1rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 16px;
  text-decoration: none;
  transition: var(--transition-smooth);
  border: 1px solid transparent;
}

.community-card:hover {
  background: rgba(201, 168, 124, 0.15);
  border-color: var(--lore-accent);
  transform: translateY(-4px);
}

.community-icon {
  font-size: 2.2rem;
  margin-bottom: 0.8rem;
}

.community-name {
  color: var(--lore-accent-light);
  font-weight: 600;
  margin-bottom: 0.3rem;
}

.community-handle {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ===== CONTACT GRID ===== */
.contact-grid {
  display: grid;
  gap: 1rem;
  margin: 1.5rem 0;
}

.contact-item {
  display: flex;
  align-items: center;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 12px;
  transition: var(--transition-smooth);
}

.contact-item:hover {
  background: rgba(201, 168, 124, 0.15);
  transform: translateX(4px);
}

.contact-label {
  min-width: 100px;
  color: var(--lore-accent);
  font-weight: 600;
  letter-spacing: 0.5px;
}

.contact-email {
  color: var(--text-primary);
  text-decoration: none;
  padding: 0.3rem 0.8rem;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.05);
  transition: var(--transition-smooth);
}

.contact-email:hover {
  background: var(--lore-accent);
  color: var(--bg-dark);
}

.contact-form-placeholder {
  margin-top: 2rem;
  padding: 1.5rem;
  text-align: center;
  background: rgba(201, 168, 124, 0.05);
  border-radius: 12px;
  border: 2px dashed var(--lore-border);
}

.placeholder-decoration {
  margin-top: 0.8rem;
  color: var(--lore-accent);
  letter-spacing: 4px;
}

/* ===== INDICADOR DE ABA ATIVA ===== */
.tab-button.active {
  position: relative;
}

.tab-button.active::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 30%;
  right: 30%;
  height: 2px;
  background: var(--lore-accent);
  border-radius: 2px;
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from {
    left: 50%;
    right: 50%;
    opacity: 0;
  }
  to {
    left: 30%;
    right: 30%;
    opacity: 1;
  }
}

/* ===== TRANSIÇÃO SUAVE ENTRE ABAS ===== */
.tab-content {
  display: none;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.tab-content.active {
  display: block;
  animation: fadeInUp 0.4s ease forwards;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===== ESTADO CARREGANDO (OPCIONAL) ===== */
.tab-content.loading {
  display: block;
  opacity: 0.5;
  pointer-events: none;
  position: relative;
}

.tab-content.loading::after {
  content: '✧';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 2rem;
  color: var(--lore-accent);
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from { transform: translate(-50%, -50%) rotate(0deg); }
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* ===== RESPONSIVIDADE REFINADA ===== */
@media (max-width: 740px) {
  .author-profile {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .work-title {
  width: 240px;
  }
  
  .community-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .contact-item {
    flex-direction: column;
    gap: 0.5rem;
    text-align: center;
  }
  
  .card-header {
    flex-direction: column;
    text-align: center;
  }
  
  .lore-timeline {
    padding-left: 1.5rem;
  }
}

@media (max-width: 480px) {
  .tab-bar {
    border-radius: 20px;
  }
  
  .tab-button {
    font-size: 0.7rem;
    padding: 0.5rem 0.8rem;
  }

  .work-title {
  width: 140px;
}

  .card {
    padding: 1.2rem;
  }
  
  .card-header h2 {
    font-size: 1.4rem;
  }
  
  .community-grid {
    grid-template-columns: 1fr;
  }
}