/* Estilos personalizados para complementar o Bootstrap */

:root {
  --primary-color: #0d6efd;
  --secondary-color: #6c757d;
  --success-color: #198754;
  --info-color: #0dcaf0;
  --warning-color: #ffc107;
  --danger-color: #dc3545;
  --light-color: #f8f9fa;
  --dark-color: #212529;
  --transition: all 0.3s ease;
}

/* CORREÇÃO: Estilos específicos para evitar sobreposição no mobile */
@media (max-width: 768px) {
  /* Garantir espaçamento adequado entre seções */
  header.py-5 + section.py-5 {
    margin-top: 1rem;
  }
  
  /* Ajustar o layout do header para mobile */
  header .row.align-items-center {
    gap: 1rem;
  }
  
  header .col-md-8 .p-4.bg-white.rounded.shadow {
    position: relative;
    z-index: 1;
    margin-bottom: 1.5rem;
  }
  
  /* Garantir que a seção "Sobre Mim" tenha espaço suficiente */
  section.py-5 .container {
    position: relative;
    z-index: 2;
  }
}

/* Estilos para o modo escuro */
.dark-mode {
  background-color: #121212;
  color: #e0e0e0;
}

.dark-mode .navbar {
  background-color: #1e1e1e !important;
}

.dark-mode .bg-light {
  background-color: #1e1e1e !important;
}

.dark-mode .card,
.dark-mode .modal-content,
.dark-mode .list-group-item,
.dark-mode .p-4.bg-white {
  background-color: #2d2d2d !important;
  color: #e0e0e0;
}

.dark-mode .card-header.bg-primary {
  background-color: #0d6efd !important;
}

.dark-mode footer {
  background-color: #1a1a1a !important;
}

.dark-mode .btn-outline-dark {
  color: #e0e0e0;
  border-color: #e0e0e0;
}

.dark-mode .btn-outline-dark:hover {
  background-color: #e0e0e0;
  color: #121212;
}

/* Estilos para a barra de progresso de leitura */
.reading-progress-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  z-index: 9999;
  background-color: transparent;
}

.reading-progress-bar {
  height: 100%;
  width: 0;
  background-color: #0d6efd;
  transition: width 0.1s ease;
}

/* Animações */
.animated {
  animation: fadeIn 0.6s ease-out forwards;
}

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

/* Estilos para cards */
.card {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
  transform: translateY(-10px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1) !important;
}

/* Estilos para links sociais */
.social-links a {
  transition: all 0.3s ease;
}

.social-links a:hover {
  transform: scale(1.1);
}

/* Estilos para habilidades */
.skill-badge {
  padding: 8px 15px;
  margin: 5px;
  border-radius: 20px;
  display: inline-block;
  background-color: var(--light-color);
  color: var(--dark-color);
  transition: var(--transition);
}

.skill-badge:hover {
  background-color: var(--primary-color);
  color: white;
  transform: translateY(-3px);
}

/* Timeline para formação e experiência */
.timeline {
  position: relative;
  padding: 20px 0;
}

.timeline::before {
  content: '';
  position: absolute;
  width: 3px;
  background-color: var(--primary-color);
  top: 0;
  bottom: 0;
  left: 50%;
  margin-left: -1.5px;
}

.timeline-item {
  margin-bottom: 30px;
  position: relative;
}

.timeline-item::after {
  content: '';
  display: table;
  clear: both;
}

.timeline-item .timeline-content {
  width: 45%;
  padding: 20px;
  background-color: white;
  border-radius: 5px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
  position: relative;
}

.timeline-item:nth-child(odd) .timeline-content {
  float: left;
}

.timeline-item:nth-child(even) .timeline-content {
  float: right;
}

.timeline-item .timeline-content::before {
  content: '';
  position: absolute;
  top: 20px;
  width: 20px;
  height: 20px;
  background-color: white;
  transform: rotate(45deg);
}

.timeline-item:nth-child(odd) .timeline-content::before {
  right: -10px;
}

.timeline-item:nth-child(even) .timeline-content::before {
  left: -10px;
}

.timeline-item .timeline-date {
  position: absolute;
  top: 12px;
  width: 100px;
  padding: 5px 10px;
  background-color: var(--primary-color);
  color: white;
  border-radius: 20px;
  text-align: center;
  font-size: 0.8rem;
}

.timeline-item:nth-child(odd) .timeline-date {
  right: -120px;
}

.timeline-item:nth-child(even) .timeline-date {
  left: -120px;
}

.timeline-item .timeline-dot {
  position: absolute;
  width: 16px;
  height: 16px;
  background-color: var(--primary-color);
  border-radius: 50%;
  left: 50%;
  margin-left: -8px;
  top: 20px;
}

/* Botão voltar ao topo */
.back-to-top {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: var(--primary-color);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
  z-index: 1000;
  border: none;
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
}

.back-to-top:hover {
  background-color: var(--dark-color);
}

/* Estilos para as barras de progresso */
.progress-bar-wrap {
  width: 100%;
  height: 10px;
  background-color: #e9ecef;
  border-radius: 5px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  border-radius: 5px;
  transition: width 0.6s ease;
}

/* Corrigir o modo escuro para as barras de progresso */
.dark-mode .progress-bar-wrap {
  background-color: #333;
}

/* Estilos para a timeline vertical na página de experiências */
.vertical-timeline {
  position: relative;
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px 0;
}

.vertical-timeline::before {
  content: '';
  position: absolute;
  top: 0;
  left: 18px;
  height: 100%;
  width: 4px;
  background: #e9ecef;
}

.timeline-block {
  position: relative;
  margin: 2em 0;
}

.timeline-icon {
  position: absolute;
  top: 0;
  left: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  box-shadow: 0 0 0 4px white, inset 0 2px 0 rgba(0, 0, 0, 0.08), 0 3px 0 4px rgba(0, 0, 0, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
}

.timeline-content {
  position: relative;
  margin-left: 60px;
  margin-bottom: 2em;
  border-radius: 0.25rem;
}

/* Estilos para os cards de projetos */
.project-card {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  overflow: hidden;
}

.project-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 15px 30px rgba(0,0,0,0.1) !important;
}

.project-card img {
  height: 200px;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.project-card:hover img {
  transform: scale(1.05);
}

/* Estilos para os cards de contato */
.contact-card {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.contact-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 15px 30px rgba(0,0,0,0.1) !important;
}

.icon-circle {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  transition: transform 0.3s ease;
}

.contact-card:hover .icon-circle {
  transform: scale(1.1);
}

/* Estilos para as redes sociais */
.social-icons {
  display: flex;
  justify-content: center;
  gap: 20px;
}

.social-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.1);
  color: white;
  transition: all 0.3s ease;
}

.social-icon:hover {
  background-color: white;
  color: #212529;
  transform: translateY(-5px);
}

/* Estilos para o formulário */
.form-control {
  padding: 12px;
  border: 1px solid #ced4da;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-control:focus {
  border-color: #0d6efd;
  box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

/* Estilos para impressão */
@media print {
  .navbar, .btn, .card-footer, .modal, .back-to-top, footer {
      display: none !important;
  }
  
  body {
      background-color: white !important;
      color: black !important;
  }
  
  .container {
      width: 100% !important;
      max-width: none !important;
  }
  
  .card, .bg-light, .bg-white {
      background-color: white !important;
      box-shadow: none !important;
      border: 1px solid #ddd !important;
  }
  
  a {
      text-decoration: none !important;
      color: black !important;
  }
  
  a::after {
      content: " (" attr(href) ")";
      font-size: 80%;
  }
}

/* Estilos responsivos adicionais */
@media (max-width: 768px) {
  .timeline::before {
      left: 40px;
  }
  
  .timeline-item .timeline-content {
      width: calc(100% - 80px);
      float: right !important;
  }
  
  .timeline-item .timeline-dot {
      left: 40px;
  }
  
  .timeline-item .timeline-date {
      position: relative !important;
      top: -30px !important;
      left: 80px !important;
      right: auto !important;
      margin-bottom: -20px;
  }
  
  .timeline-item .timeline-content::before {
      left: -10px !important;
      right: auto !important;
  }
  
  header {
      height: auto !important;
      min-height: auto !important;
  }
  
  .icon-circle {
      width: 60px;
      height: 60px;
  }
  
  .social-icon {
      width: 50px;
      height: 50px;
  }
  
  .vertical-timeline::before {
      left: 18px;
  }
  
  .timeline-block .timeline-content {
      width: calc(100% - 60px);
      float: right;
  }
}

/* Estilos para telas médias */
@media (min-width: 768px) and (max-width: 991px) {
  .vertical-timeline::before {
      left: 50%;
      margin-left: -2px;
  }
  
  .timeline-block {
      margin: 4em 0;
  }
  
  .timeline-icon {
      left: 50%;
      margin-left: -20px;
  }
  
  .timeline-content {
      width: 45%;
      margin-left: 0;
  }
  
  .timeline-block:nth-child(even) .timeline-content {
      float: right;
  }
  
  .timeline-block:nth-child(odd) .timeline-content {
      float: left;
  }
}

/* CORREÇÃO ADICIONAL: Estilos específicos para o problema de sobreposição */
@media (max-width: 576px) {
  /* Forçar layout em coluna única para dispositivos muito pequenos */
  header .row {
    flex-direction: column !important;
  }
  
  header .col-md-4,
  header .col-md-8 {
    width: 100% !important;
    max-width: 100% !important;
    flex: 0 0 100% !important;
  }
  
  /* Garantir espaçamento adequado */
  header .col-md-4 {
    margin-bottom: 1.5rem !important;
  }
  
  header .col-md-8 .p-4 {
    margin-bottom: 2rem !important;
  }
  
  /* Ajustar padding das seções */
  section.py-5 {
    padding-top: 1.5rem !important;
    padding-bottom: 1.5rem !important;
  }
  
  /* Garantir que não há sobreposição */
  .alert.alert-info {
    margin-top: 1rem !important;
    margin-bottom: 1.5rem !important;
  }
}
