/**
 * Layout 3 - Elegant Modal Cards
 * Clean, minimalist cards with modal popups
 * @version 1.0.0
 */

/* ===== VARIABLES ===== */
:root {
  --layout3-primary: #373435;
  --layout3-accent: #e1f0f3;
  --layout3-bg: #0d0d0d;
  --layout3-bg-secondary: #1a1a1a;
  --layout3-bg-tertiary: #2a2a2a;
  --layout3-text: #ffffff;
  --layout3-text-secondary: #e1e1e1;
  --layout3-text-muted: #d1d5db;
  --layout3-border: #373435;
  --layout3-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  --layout3-radius: 16px;
  --layout3-transition: all 0.3s ease;
}

/* Main content area text color */
.grupo-capitao-container {
  background-color: var(--layout3-bg);
  color: var(--gc-text-primary);
}

.grupo-capitao-container * {
  color: inherit;
}

/* Fix text-muted for dark theme */
.text-muted {
  color: #ffffff !important;
}

/* ===== HEADER SECTION ===== */
.grupo-hero {
  background: linear-gradient(135deg, var(--gc-background) 0%, var(--gc-background-secondary) 50%, var(--gc-primary-dark) 100%);
  min-height: 40vh;
  display: flex;
  align-items: center;
  position: relative;
  border-bottom: 1px solid var(--gc-border-color);
  padding: 6rem 0; /* 50% increase */

  /* Entrance animation */
  opacity: 0;
  transform: translateY(40px) scale(0.95);
  animation: cardEnter 0.8s ease-out 0.2s forwards;
}

.grupo-hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle at center, rgba(225, 240, 243, 0.08) 0%, transparent 70%);
  pointer-events: none;
}

.grupo-logo img {
  max-width: 100%;
  height: auto;
  transition: var(--gc-transition-fast);
}

.grupo-logo img:hover {
  filter: brightness(1.2);
  transform: scale(1.05);
}

.grupo-title {
  color: var(--gc-accent);
  font-weight: 700;
  margin-bottom: 1.5rem; /* 50% increase */
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.grupo-description {
  font-size: 1.1rem;
  color: #ffffff;
  max-width: 600px;
  margin: 0 auto 3rem; /* 50% increase */
  line-height: 1.7;
}

.grupo-description .lead {
  color: #ffffff !important;
}

.grupo-social {
  gap: 1.5rem !important; /* 50% increase */
}

.grupo-social .btn {
  transition: var(--gc-transition);
  border: 2px solid #ffffff;
  color: #ffffff;
  background-color: transparent;
  font-weight: 500;
  min-width: 120px;
  position: relative;
  overflow: hidden;
}

.grupo-social .btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s ease;
}

.grupo-social .btn:hover {
  transform: translateY(-3px);
  box-shadow: var(--gc-shadow-lg);
  background-color: rgba(255, 255, 255, 0.1);
  border-color: #ffffff;
  color: #ffffff;
}

.grupo-social .btn:hover::before {
  left: 100%;
}

/* ===== NOSSA HISTÓRIA BUTTON ===== */
.grupo-historia-button .btn {
  transition: var(--layout3-transition);
  border: 2px solid #ffffff;
  color: #ffffff;
  background-color: transparent;
  font-weight: 500;
  min-width: 180px;
  padding: 0.875rem 2.5rem;
  position: relative;
  overflow: hidden;
  letter-spacing: 0.05em;
  font-size: 1rem;
}

.grupo-historia-button .btn::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.grupo-historia-button .btn:hover::after {
  width: 300px;
  height: 300px;
}

.grupo-historia-button .btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
  transition: left 0.7s ease;
}

.grupo-historia-button .btn:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(255, 255, 255, 0.3);
  background-color: rgba(255, 255, 255, 0.1);
  border-color: #ffffff;
  color: #ffffff;
}

.grupo-historia-button .btn:hover::before {
  left: 100%;
}

/* ===== SEGMENT SECTION ===== */
.layout3-segment {
  background-color: var(--layout3-bg);
  padding: 4.5rem 0 6rem 0;
  border-bottom: 2px solid rgba(0, 0, 0, 0.1);
}

.layout3-segment:last-child {
  border-bottom: none;
}

.layout3-segment-title {
  color: var(--layout3-accent);
  font-size: 1.75rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

/* ===== CARDS GRID ===== */
.layout3-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 3rem; /* 50% increase */
  margin-top: 3rem; /* 50% increase */
  max-width: 100%;
}

/* Limit to max 4 columns on large screens */
@media (min-width: 1400px) {
  .layout3-cards-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* ===== CARD STYLES ===== */
.layout3-card {
  position: relative;
  background: var(--layout3-bg-secondary);
  border: 1px solid var(--layout3-border);
  border-radius: var(--layout3-radius);
  cursor: pointer;
  transition: var(--layout3-transition);
  box-shadow: var(--layout3-shadow);
  aspect-ratio: 16 / 9;
  outline: none;
  overflow: hidden;

  /* Staggered entrance animation */
  opacity: 0;
  transform: translateY(40px) scale(0.95);
}

/* Staggered delays for cards */
.layout3-card:nth-child(1) { animation: cardEnter 0.6s ease-out 0.1s forwards; }
.layout3-card:nth-child(2) { animation: cardEnter 0.6s ease-out 0.2s forwards; }
.layout3-card:nth-child(3) { animation: cardEnter 0.6s ease-out 0.3s forwards; }
.layout3-card:nth-child(4) { animation: cardEnter 0.6s ease-out 0.4s forwards; }
.layout3-card:nth-child(5) { animation: cardEnter 0.6s ease-out 0.5s forwards; }
.layout3-card:nth-child(6) { animation: cardEnter 0.6s ease-out 0.6s forwards; }
.layout3-card:nth-child(7) { animation: cardEnter 0.6s ease-out 0.7s forwards; }
.layout3-card:nth-child(8) { animation: cardEnter 0.6s ease-out 0.8s forwards; }
.layout3-card:nth-child(n+9) { animation: cardEnter 0.6s ease-out 0.9s forwards; }

@keyframes cardEnter {
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Gold shimmer on card edges */
.layout3-card::after {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  border-radius: var(--layout3-radius);
  background: linear-gradient(45deg,
    transparent 30%,
    #D4AF37 50%,
    transparent 70%
  );
  opacity: 0;
  z-index: 0;
  transition: opacity 0.5s;
  background-size: 200% 200%;
  animation: shimmer 5s linear infinite;
  pointer-events: none;
}

@keyframes shimmer {
  0% { background-position: -100% -100%; }
  100% { background-position: 200% 200%; }
}

.layout3-card:hover::after {
  opacity: 0.3;
}

/* Card with background image */
.layout3-card.has-background {
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.layout3-card.has-background::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  border-radius: var(--layout3-radius);
  transition: var(--layout3-transition);
  z-index: 1;
}

.layout3-card.has-background:hover::before {
  background: rgba(0, 0, 0, 0.4);
}

.layout3-card.has-background .layout3-card-inner {
  position: relative;
  z-index: 2;
}

.layout3-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  border-color: var(--layout3-primary);
}

.layout3-card:focus {
  border-color: var(--layout3-accent);
  box-shadow: 0 0 0 3px rgba(225, 240, 243, 0.3);
}

.layout3-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2.5rem;
  z-index: 2;
}

/* ===== CARD LOGO ===== */
.layout3-card-logo {
  width: 100%;
  max-width: 160px;
  height: auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.layout3-card-logo img {
  max-width: 100%;
  max-height: 140px;
  width: auto;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.3));
  transition: var(--layout3-transition);
}

/* Logo color inversion */
.layout3-card-logo img.logo-invertido {
  filter: invert(1) drop-shadow(0 2px 8px rgba(0, 0, 0, 0.3));
}

.layout3-card:hover .layout3-card-logo img {
  transform: scale(1.08);
}

.layout3-card-logo-placeholder {
  width: 100px;
  height: 100px;
  background: var(--layout3-primary);
  color: var(--layout3-accent);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: 2px;
}

/* ===== PLUS ICON ===== */
.layout3-card-plus {
  position: absolute;
  bottom: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  opacity: 0.8;
  transition: var(--layout3-transition);
  z-index: 10;
}

.layout3-card:hover .layout3-card-plus {
  opacity: 1;
  transform: scale(1.15) rotate(90deg);
  background: var(--layout3-accent);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.layout3-card-plus svg {
  color: var(--layout3-primary);
}

/* ===== MODAL STYLES ===== */
.layout3-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.layout3-modal.active {
  display: flex;
  opacity: 1;
}

/* ===== MODAL BACKDROP ===== */
.layout3-modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(8px);
}

/* ===== MODAL CONTENT ===== */
.layout3-modal-content {
  position: relative;
  background: var(--layout3-bg-secondary);
  border: 1px solid var(--layout3-border);
  border-radius: 20px;
  width: 100%;
  max-width: 700px;
  max-height: 85vh;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 2.5rem;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  z-index: 2;
  animation: modalSlideIn 0.3s ease;
}

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

/* ===== MODAL CLOSE BUTTON ===== */
.layout3-modal-close {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--layout3-border);
  border-radius: 50%;
  color: var(--layout3-text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--layout3-transition);
  z-index: 3;
}

.layout3-modal-close:hover {
  background: var(--layout3-primary);
  border-color: var(--layout3-accent);
  color: var(--layout3-accent);
  transform: scale(1.1) rotate(90deg);
}

/* ===== MODAL HEADER ===== */
.layout3-modal-header {
  display: flex;
  align-items: center;
  gap: 2.25rem; /* 50% increase */
  margin-bottom: 3rem; /* 50% increase */
  padding-bottom: 2.25rem; /* 50% increase */
  border-bottom: 1px solid var(--layout3-border);
}

.layout3-modal-logo {
  flex-shrink: 0;
  width: 80px;
  height: 80px;
  background: var(--layout3-bg-tertiary);
  border: 1px solid var(--layout3-border);
  border-radius: 12px;
  padding: 1.125rem; /* 50% increase */
  display: flex;
  align-items: center;
  justify-content: center;
}

.layout3-modal-logo img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.layout3-modal-logo img.logo-invertido {
  filter: invert(1);
}

.layout3-modal-logo-placeholder {
  width: 100%;
  height: 100%;
  background: var(--layout3-primary);
  color: var(--layout3-accent);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 700;
}

.layout3-modal-title {
  flex: 1;
  color: var(--layout3-accent);
  font-size: 1.75rem;
  font-weight: 600;
  margin: 0;
  line-height: 1.3;
}

/* ===== MODAL BODY ===== */
.layout3-modal-body {
  color: var(--layout3-text-secondary);
}

.layout3-modal-description {
  margin-bottom: 3rem; /* 50% increase */
  line-height: 1.7;
  font-size: 1rem;
}

/* ===== MODAL GALLERY ===== */
.layout3-modal-gallery {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  margin-bottom: 3rem; /* 50% increase */
  margin-left: -3.75rem;
  margin-right: -3.75rem;
}

.layout3-gallery-item {
  position: relative;
  aspect-ratio: 16/9;
  border-radius: 0;
  overflow: hidden;
  cursor: pointer;
  background: var(--layout3-bg-tertiary);
  border: none;
  border-top: 1px solid var(--layout3-border);
  border-bottom: 1px solid var(--layout3-border);
  transition: var(--layout3-transition);
  width: 100%;
}

.layout3-gallery-item:hover {
  transform: scale(1.02);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

.layout3-gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--layout3-transition);
}

.layout3-gallery-item:hover img {
  transform: scale(1.05);
}

/* ===== MODAL LINKS ===== */
.layout3-modal-links {
  margin-top: 3rem; /* 50% increase */
}

.layout3-modal-links h4 {
  color: var(--layout3-accent);
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 1.5rem; /* 50% increase */
}

.layout3-links-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1.125rem; /* 50% increase */
}

.layout3-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem; /* 50% increase */
  padding: 1.3rem 1.5rem; /* 50% increase */
  background: var(--layout3-bg-tertiary);
  border: 1px solid var(--layout3-border);
  border-radius: 10px;
  color: var(--layout3-text-secondary);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  transition: var(--layout3-transition);
}

.layout3-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
  color: var(--layout3-text);
}

.layout3-link-instagram:hover {
  background: #E4405F;
  border-color: #E4405F;
  color: white;
}

.layout3-link-facebook:hover {
  background: #1877F2;
  border-color: #1877F2;
  color: white;
}

.layout3-link-tiktok:hover {
  background: #000;
  border-color: #000;
  color: white;
}

.layout3-link-whatsapp:hover {
  background: #25D366;
  border-color: #25D366;
  color: white;
}

.layout3-link-tripadvisor:hover {
  background: #00AF87;
  border-color: #00AF87;
  color: white;
}

/* ===== IMAGE LIGHTBOX ===== */
.layout3-lightbox {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.layout3-lightbox.active {
  display: flex;
  opacity: 1;
}

.layout3-lightbox-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.95);
  backdrop-filter: blur(10px);
}

.layout3-lightbox-container {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  z-index: 2;
}

.layout3-lightbox-close {
  position: absolute;
  top: -50px;
  right: 0;
  width: 44px;
  height: 44px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--layout3-transition);
}

.layout3-lightbox-close:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.1) rotate(90deg);
}

.layout3-lightbox-image {
  max-width: 100%;
  max-height: 85vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

/* ===== SCROLLBAR STYLING ===== */
.layout3-modal-content::-webkit-scrollbar {
  width: 8px;
}

.layout3-modal-content::-webkit-scrollbar-track {
  background: var(--layout3-bg-tertiary);
  border-radius: 4px;
}

.layout3-modal-content::-webkit-scrollbar-thumb {
  background: var(--layout3-primary);
  border-radius: 4px;
}

.layout3-modal-content::-webkit-scrollbar-thumb:hover {
  background: #4a4647;
}

/* ===== BODY NO SCROLL ===== */
body.layout3-modal-open {
  overflow: hidden;
}

/* ===== FOOTER ===== */
.grupo-footer {
  background: var(--layout3-bg-secondary);
  border-top: 1px solid var(--layout3-border);
  padding: 0 0 2rem;
  margin-top: 0;
}

.footer-logo {
  text-align: center;
  margin-bottom: 2.25rem; /* 50% increase */
  padding-top: 4.5rem; /* 50% increase */
}

.footer-logo-img {
  max-height: 80px;
  max-width: 350px;
  width: auto;
  opacity: 0.9;
}

.footer-logo-text {
  color: var(--layout3-accent);
  font-size: 1.5rem;
  font-weight: 600;
  margin: 0;
}

.footer-social {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 2.25rem; /* 50% increase */
  margin-bottom: 3rem; /* 50% increase */
}

.footer-social-link {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--layout3-bg-tertiary);
  border: 1px solid var(--layout3-border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--layout3-text-secondary);
  font-size: 1.2rem;
  transition: var(--layout3-transition);
  text-decoration: none;
}

.footer-social-link:hover {
  transform: translateY(-3px);
  background: var(--layout3-primary);
  border-color: var(--layout3-accent);
  color: var(--layout3-accent);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 3rem; /* 50% increase */
  border-top: 1px solid var(--layout3-border);
  flex-wrap: wrap;
  gap: 1.5rem; /* 50% increase */
}

.footer-copyright {
  color: var(--layout3-text-muted);
  font-size: 0.9rem;
}

.footer-links {
  display: flex;
  gap: 2.25rem; /* 50% increase */
  flex-wrap: wrap;
}

.footer-link {
  color: var(--layout3-text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  transition: var(--layout3-transition);
  position: relative;
}

.footer-link:hover {
  color: var(--layout3-accent);
}

.footer-link:not(:last-child)::after {
  content: '|';
  position: absolute;
  right: -1.275rem; /* 50% increase */
  color: var(--layout3-border);
}

@media (max-width: 768px) {
  .footer-bottom {
    flex-direction: column;
    text-align: center;
  }

  .footer-links {
    justify-content: center;
  }

  .footer-copyright {
    order: 2;
  }

  .footer-links {
    order: 1;
  }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1200px) {
  .layout3-cards-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 2.25rem; /* 50% increase */
  }
}

@media (max-width: 768px) {
  .layout3-cards-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.875rem; /* 50% increase */
  }

  .layout3-card-inner {
    padding: 2rem;
  }

  .layout3-card-logo {
    max-width: 120px;
  }

  .layout3-card-logo img {
    max-height: 100px;
  }

  .layout3-card-plus {
    width: 32px;
    height: 32px;
  }

  .layout3-modal {
    padding: 1rem;
  }

  .layout3-modal-content {
    padding: 2rem 1.5rem;
    max-height: 90vh;
  }

  .layout3-modal-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .layout3-modal-title {
    font-size: 1.5rem;
  }

  .layout3-modal-gallery {
    margin-left: -2.25rem;
    margin-right: -2.25rem;
  }

  .layout3-links-grid {
    grid-template-columns: 1fr;
  }

  .layout3-lightbox-close {
    top: -60px;
    right: 50%;
    transform: translateX(50%);
  }
}

@media (max-width: 480px) {
  .layout3-cards-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem; /* 50% increase */
  }

  .layout3-card-inner {
    padding: 1.5rem;
  }

  .layout3-modal-content {
    padding: 1.5rem 1rem;
  }

  .layout3-modal-gallery {
    margin-left: -1rem;
    margin-right: -1rem;
  }

  .layout3-modal-title {
    font-size: 1.25rem;
  }
}
