/* Estilos elaborados para o blog */
:root {
  --primary-color: #2c3e50;
  --secondary-color: #3498db;
  --accent-color: #e74c3c;
  --light-gray: #f8f9fa;
  --dark-gray: #343a40;
  --text-color: #212529;
  --border-radius: 8px;
  --box-shadow: 0 5px 15px rgba(0,0,0,0.1);
  --transition: all 0.3s ease;
}

/* Base */
body {
  font-family: 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  color: var(--text-color);
  background-color: #f5f5f5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.6;
}

a {
  color: var(--secondary-color);
  transition: var(--transition);
  text-decoration: none;
}

a:hover {
  color: var(--primary-color);
}

/* Header and Navigation */
.navbar {
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  padding: 15px 0;
}

.navbar-brand {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.navbar-dark .navbar-nav .nav-link {
  color: rgba(255,255,255,0.8);
  font-weight: 500;
  padding: 10px 15px;
  transition: var(--transition);
}

.navbar-dark .navbar-nav .nav-link:hover {
  color: #fff;
  transform: translateY(-2px);
}

/* Mobile nav improvements */
@media (max-width: 991px) {
  .navbar-collapse {
    background-color: var(--primary-color);
    padding: 15px;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 5px 10px rgba(0,0,0,0.2);
    max-height: calc(100vh - 80px);
    overflow-y: auto;
  }
  
  .navbar-nav .nav-item {
    margin-bottom: 8px;
  }
  
  .navbar-nav .nav-link {
    padding: 12px !important;
    line-height: 1.5 !important;
    border-radius: 5px;
  }
  
  .navbar-nav .nav-link:hover,
  .navbar-nav .nav-link:focus {
    background-color: rgba(255,255,255,0.1);
  }
}

/* Menu suspenso de produtos */
.dropdown-menu {
  background-color: var(--primary-color);
  border: none;
  border-radius: 0.25rem;
  box-shadow: 0 4px 10px rgba(0,0,0,0.2);
  margin-top: 0.5rem;
}

.dropdown-menu .dropdown-item {
  color: rgba(255,255,255,0.8);
  font-weight: 500;
  padding: 0.5rem 1.5rem;
  transition: var(--transition);
}

.dropdown-menu .dropdown-item:hover,
.dropdown-menu .dropdown-item:focus {
  color: #fff;
  background-color: rgba(255,255,255,0.1);
}

.dropdown-menu .dropdown-item.disabled {
  color: rgba(255,255,255,0.5);
}

/* Mobile dropdown improvements */
@media (max-width: 991px) {
  .dropdown-menu {
    background-color: rgba(0,0,0,0.15);
    border: none;
    box-shadow: none;
    padding: 8px;
    margin-top: 10px;
    margin-bottom: 10px;
    width: 100%;
  }
  
  .dropdown-item {
    border-radius: 5px;
    padding: 10px 15px !important;
    margin-bottom: 5px;
  }
  
  .dropdown-item:last-child {
    margin-bottom: 0;
  }
}

/* Content Container */
.container {
  padding: 30px 20px;
}

/* Hero Section */
.hero-section {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
  color: white;
  padding: 80px 20px;
  margin-bottom: 40px;
  text-align: center;
  border-radius: 0 0 30% 30% / 0 0 15% 15%;
  position: relative;
  overflow: hidden;
}

.hero-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: url('/static/images/pattern.png'); /* You need to create or add this pattern */
  opacity: 0.05;
}

.hero-section h1 {
  font-size: 3rem;
  font-weight: 800;
  margin-bottom: 20px;
  text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.hero-section p {
  font-size: 1.2rem;
  max-width: 800px;
  margin: 0 auto;
  opacity: 0.9;
}

/* Blog Grid */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
  margin-bottom: 40px;
}

@media (max-width: 992px) {
  .blog-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 576px) {
  .blog-grid {
    grid-template-columns: 1fr;
  }
}

/* About Section */
.about-section {
  background-color: white;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  padding: 30px;
  margin-bottom: 40px;
  transition: var(--transition);
}

.about-section:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.about-section h2 {
  color: var(--primary-color);
  font-weight: 700;
  font-size: 1.8rem;
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--light-gray);
}

/* Blog Posts Grid */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 25px;
  margin-top: 30px;
  margin-bottom: 40px;
}

.blog-card {
  background-color: white;
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--box-shadow);
  transition: var(--transition);
  height: 100%;
  display: flex;
  flex-direction: column;
  position: relative;
}

.blog-card:hover {
  transform: translateY(-7px);
  box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}

.blog-card-image {
  height: 200px;
  overflow: hidden;
  position: relative;
  max-height: 200px;
}

.blog-card-image img.blog-thumbnail {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
  max-height: 200px;
}

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

.blog-card-content {
  padding: 25px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.blog-card-title {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 15px;
  line-height: 1.3;
  color: var(--primary-color);
}

.blog-card-categories {
  font-size: 0.85rem;
  margin-bottom: 15px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px; /* Adiciona espaçamento entre os itens */
}

.blog-card-categories .badge {
  margin-bottom: 4px;  /* Adiciona espaçamento vertical entre linhas */
  line-height: 1.5;  /* Aumenta a altura da linha para melhor legibilidade */
}

.blog-card-excerpt {
  color: #666;
  margin-bottom: 20px;
  flex-grow: 1;
}

.blog-card-link {
  display: inline-block;
  padding: 8px 20px;
  background-color: var(--secondary-color);
  color: white;
  border-radius: 30px;
  font-weight: 500;
  text-align: center;
  transition: var(--transition);
  align-self: flex-start;
}

.blog-card-link:hover {
  background-color: var(--primary-color);
  color: white;
}

.blog-card-category {
  position: absolute;
  top: 15px;
  right: 15px;
  background-color: var(--accent-color);
  color: white;
  padding: 5px 15px;
  border-radius: 30px;
  font-size: 0.85rem;
  font-weight: 500;
  z-index: 1;
}

/* Pagination */
.pagination {
  margin-top: 50px;
  display: flex;
  justify-content: center;
}

.pagination .page-item .page-link {
  color: var(--secondary-color);
  border-radius: 50%;
  margin: 0 5px;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pagination .page-item.active .page-link {
  background-color: var(--secondary-color);
  border-color: var(--secondary-color);
}

/* Footer */
footer {
  background-color: var(--primary-color);
  color: white;
  padding: 50px 0 20px;
  margin-top: auto;
}

footer h4 {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 20px;
  color: white;
}

footer ul {
  list-style-type: none;
  padding: 0;
}

/* Move a coluna de Links Rápidos 5cm para a direita */
footer .quick-links-section {
  transform: translateX(50px);
}

footer ul li {
  margin-bottom: 10px;
}

footer ul li a {
  color: rgba(255,255,255,0.7);
}

footer ul li a:hover {
  color: white;
}

.footer-bottom {
  text-align: center;
  padding-top: 30px;
  margin-top: 30px;
  border-top: 1px solid rgba(255,255,255,0.1);
  font-size: 0.9rem;
  color: rgba(255,255,255,0.6);
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .hero-section {
    padding: 60px 20px;
  }
  
  .hero-section h1 {
    font-size: 2.5rem;
  }
  
  .blog-grid {
    grid-template-columns: 1fr;
  }
  
  .post-meta {
    display: flex;
    flex-direction: column;
  }
  
  .post-meta .mx-2 {
    display: none;
  }
  
  /* Melhorias para mobile */
  html, body {
    overflow-x: hidden;
  }
  
  .container {
    padding-left: 15px;
    padding-right: 15px;
  }
  
  /* Ajustes para o footer no mobile */
  footer h4 {
    margin-top: 20px;
    font-size: 1.1rem;
  }
  
  footer ul li {
    margin-bottom: 8px;
  }
  
  footer .quick-links-section {
    transform: none;
  }
  
  /* Melhorias para cards e botões em mobile */
  .btn {
    padding: 8px 15px;
    font-size: 0.9rem;
  }
  
  .blog-card-title {
    font-size: 1.2rem;
  }
  
  .blog-card-excerpt {
    font-size: 0.9rem;
  }
}

/* Blog Post Detail Page */
.blog-post {
  background-color: white;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  padding: 40px;
  margin-bottom: 40px;
}

.blog-post h1 {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--primary-color);
  margin-bottom: 20px;
}

.blog-post .post-meta {
  font-size: 1rem;
  color: #6c757d;
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 1px solid #f0f0f0;
}

.blog-post .post-image {
  margin-bottom: 30px;
  border-radius: var(--border-radius);
  overflow: hidden;
  text-align: center;
}

.blog-post .post-image img {
  max-width: 100%;
  max-height: 400px;
  object-fit: contain;
  height: auto;
  display: inline-block;
}

.blog-post .post-content {
  font-size: 1.1rem;
  line-height: 1.8;
  color: #333;
}

.blog-post .post-content h2 {
  font-size: 1.8rem;
  margin-top: 40px;
  margin-bottom: 20px;
  color: var(--primary-color);
}

.blog-post .post-content p {
  margin-bottom: 20px;
}

.blog-post .post-content ul, 
.blog-post .post-content ol {
  margin-bottom: 20px;
  padding-left: 20px;
}

.blog-post .post-content blockquote {
  border-left: 4px solid var(--secondary-color);
  padding-left: 20px;
  margin-left: 0;
  font-style: italic;
  color: #555;
}

/* Admin Panel Styles */
.admin-header {
  background-color: var(--dark-gray);
  color: white;
  padding: 20px;
  margin-bottom: 30px;
  border-radius: var(--border-radius);
}

.admin-header h1, .admin-header h2 {
  font-size: 1.8rem;
  margin: 0;
  color: white;
}

.admin-card {
  background-color: white;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  margin-bottom: 30px;
  overflow: hidden;
}

.admin-card .card-header {
  padding: 15px 20px;
  border-bottom: 1px solid #eee;
  font-weight: 600;
}

.table.admin-table {
  margin-bottom: 0;
}

.table.admin-table th {
  font-weight: 600;
  color: var(--primary-color);
}

.table.admin-table td {
  vertical-align: middle;
}

.btn-admin-primary {
  background-color: var(--secondary-color);
  border-color: var(--secondary-color);
}

.btn-admin-primary:hover {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
}

/* Form Styles */
.form-control:focus {
  border-color: var(--secondary-color);
  box-shadow: 0 0 0 0.25rem rgba(52, 152, 219, 0.25);
}

.btn-primary {
  background-color: var(--secondary-color);
  border-color: var(--secondary-color);
  padding: 10px 20px;
  font-weight: 500;
}

.btn-primary:hover {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
}

/* Login Page */
.login-card {
  max-width: 400px;
  margin: 60px auto;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  overflow: hidden;
}

.login-card .card-header {
  background-color: var(--secondary-color);
  color: white;
  text-align: center;
  padding: 20px;
}

.login-card .card-header h2 {
  margin: 0;
  font-size: 1.8rem;
}

.login-card .card-body {
  padding: 30px;
}

.login-card .form-label {
  font-weight: 500;
}

.login-card .btn-primary {
  width: 100%;
  padding: 12px;
}

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

.blog-card {
  animation: fadeInUp 0.5s ease forwards;
}

.blog-card:nth-child(2) {
  animation-delay: 0.1s;
}

.blog-card:nth-child(3) {
  animation-delay: 0.2s;
}

.blog-card:nth-child(4) {
  animation-delay: 0.3s;
}

/* Alerts */
.alert {
  border-radius: var(--border-radius);
  padding: 15px 20px;
  margin-bottom: 20px;
  border: none;
  box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.alert-info {
  background-color: rgba(52, 152, 219, 0.1);
  color: var(--secondary-color);
}

/* Comment Form Styles */
.comment-form {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid #eee;
}

.comment-form h4 {
  margin-bottom: 1.5rem;
  color: var(--primary-color);
  font-weight: 600;
}

.comment-form .btn-primary {
  transition: all 0.3s ease;
  font-weight: 500;
}

.comment-form .btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.comment-form .btn-primary:active {
  transform: translateY(0);
}

.comment-form .btn-primary.disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

/* Comments Display */
.comment {
  transition: all 0.3s ease;
}

.comment:hover {
  background-color: rgba(0,0,0,0.02);
  border-radius: 8px;
}

/* Responsive Comment Form */
@media (max-width: 576px) {
  .comment-form .btn-primary {
    display: block;
    width: 100%;
    padding: 12px;
    margin-bottom: 1rem;
  }
  
  .comment-form .form-text {
    text-align: center;
  }
}

/* Utility Classes */
.text-primary {
  color: var(--primary-color) !important;
}

.text-secondary {
  color: var(--secondary-color) !important;
}

.text-accent {
  color: var(--accent-color) !important;
}

.bg-primary-gradient {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
}

.shadow-sm {
  box-shadow: 0 2px 5px rgba(0,0,0,0.1) !important;
}

.shadow {
  box-shadow: var(--box-shadow) !important;
}

.rounded {
  border-radius: var(--border-radius) !important;
}

.font-weight-bold {
  font-weight: 700 !important;
}

.overflow-hidden {
  overflow: hidden !important;
}

/* Responsive modal fixes */
@media (max-width: 767px) {
  .modal-dialog {
    margin: 10px;
  }
  
  .modal-body {
    padding: 15px;
  }
  
  .modal-header, .modal-footer {
    padding: 10px 15px;
  }
  
  #testimonialModal .form-label {
    margin-bottom: 6px;
    font-size: 0.9rem;
  }
  
  #testimonialModal .star-rating {
    margin-bottom: 10px;
  }
  
  #testimonialModal .form-text {
    font-size: 0.8rem;
  }
}

/* Banner Carousel Styles */
.banner-carousel-section {
  margin-bottom: 40px;
  box-shadow: var(--box-shadow);
  border-radius: 0;
  overflow: hidden;
  width: 100vw;
  position: relative;
  left: 50%;
  right: 50%;
  margin-left: -50vw;
  margin-right: -50vw;
}

#bannerCarousel {
  max-height: 650px; /* 500px + 30% = 650px */
}

#bannerCarousel .carousel-item {
  max-height: 650px; /* 500px + 30% = 650px */
  border-radius: 0;
}

.banner-image {
  object-fit: cover;
  height: 650px; /* 500px + 30% = 650px */
  width: 100%;
  border-radius: 0;
}

.carousel-caption {
  background-color: rgba(0, 0, 0, 0.5);
  border-radius: 10px;
  padding: 15px;
  bottom: 30px;
}

.carousel-control-prev,
.carousel-control-next {
  width: 10%;
  opacity: 0.7;
  transition: opacity 0.3s ease;
}

.carousel-control-prev:hover,
.carousel-control-next:hover {
  opacity: 1;
}

.banner-link {
  display: block;
  height: 100%;
  color: inherit;
  text-decoration: none;
}

@media (max-width: 991px) {
  #bannerCarousel,
  #bannerCarousel .carousel-item,
  .banner-image {
    max-height: 450px;
    height: 450px;
  }
  
  .carousel-caption {
    padding: 12px;
    bottom: 20px;
  }
}

@media (max-width: 768px) {
  #bannerCarousel,
  #bannerCarousel .carousel-item,
  .banner-image {
    max-height: 350px;
    height: 350px;
  }
  
  .carousel-caption {
    padding: 10px;
    bottom: 20px;
  }
}

@media (max-width: 576px) {
  #bannerCarousel,
  #bannerCarousel .carousel-item,
  .banner-image {
    max-height: 250px;
    height: 250px;
  }
  
  .carousel-caption {
    padding: 8px;
    bottom: 15px;
    font-size: 0.9rem;
  }
  
  /* Ajustes para banners em celular */
  .carousel-indicators {
    margin-bottom: 0.5rem;
  }
  
  .carousel-indicators button {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin: 0 3px;
  }
  
  .carousel-control-prev,
  .carousel-control-next {
    width: 15%;
  }
}