/* Shared Styles for Internationalized Site (EN/IT) */

:root {
  --primary-blue: #1e3a8a;
  --swiss-red: #dc2626;
  --accent-gold: #f59e0b;
  --text-dark: #1f2937;
  --text-light: #6b7280;
  --bg-light: #f9fafb;
  --border-color: #e5e7eb;
  --success-green: #10b981;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  color: var(--text-dark);
  line-height: 1.7;
  font-size: 16px;
}

/* Flag Menu in Navbar */
.flag-menu-nav {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin-left: 1rem;
}

.flag-menu-nav .flag-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  border: 2px solid var(--border-color);
  text-decoration: none;
  font-size: 1.5rem;
  transition: all 0.3s ease;
  cursor: pointer;
}

.flag-menu-nav .flag-btn:hover {
  transform: scale(1.1);
  border-color: var(--primary-blue);
  box-shadow: 0 2px 8px rgba(30, 58, 138, 0.3);
}

.flag-menu-nav .flag-btn.active {
  border-color: var(--primary-blue);
  box-shadow: 0 0 0 3px rgba(30, 58, 138, 0.2);
}

/* Dropdown Flag Menu */
.flag-dropdown {
  position: relative;
  display: inline-block;
}

.flag-dropdown-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: rgba(255, 255, 255, 0.9);
  border: 2px solid var(--border-color);
  border-radius: 20px;
  text-decoration: none;
  color: var(--text-dark);
  font-weight: 500;
  font-size: 0.875rem;
  transition: all 0.3s ease;
  cursor: pointer;
  font-family: inherit;
}

.flag-dropdown-toggle:hover {
  border-color: var(--primary-blue);
  background: white;
}

.flag-dropdown-toggle:focus {
  outline: 2px solid var(--primary-blue);
  outline-offset: 2px;
}

.flag-dropdown-menu {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  left: auto;
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  padding: 0.5rem;
  min-width: 180px;
  display: none;
  z-index: 1000;
  /* Garante que o menu sempre abra à direita */
  transform-origin: top right;
}

.flag-dropdown:hover .flag-dropdown-menu,
.flag-dropdown:focus-within .flag-dropdown-menu,
.flag-dropdown.show .flag-dropdown-menu,
.flag-dropdown-menu.show {
  display: block;
}

/* Mantém o menu aberto quando o mouse está sobre ele */
.flag-dropdown-menu:hover {
  display: block;
}

/* Delay antes de fechar - dá tempo para mover o mouse */
.flag-dropdown-menu {
  pointer-events: auto;
}

/* Previne fechamento acidental ao mover o mouse */
.flag-dropdown-toggle:hover + .flag-dropdown-menu,
.flag-dropdown:hover .flag-dropdown-menu {
  display: block !important;
}

.flag-dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  text-decoration: none;
  color: var(--text-dark);
  border-radius: 8px;
  transition: all 0.2s ease;
  font-size: 0.875rem;
}

.flag-dropdown-item:hover {
  background: var(--bg-light);
  color: var(--primary-blue);
}

.flag-dropdown-item .flag-emoji {
  font-size: 1.5rem;
  line-height: 1;
  flex-shrink: 0;
}

.flag-dropdown-item .flag-text {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.flag-dropdown-item .flag-name {
  font-weight: 600;
  font-size: 0.875rem;
  line-height: 1.2;
}

.flag-dropdown-item .flag-desc {
  font-size: 0.7rem;
  color: var(--text-light);
  line-height: 1.2;
  margin-top: 0.125rem;
}

.flag-dropdown-item.active {
  background: #eff6ff;
  color: var(--primary-blue);
  font-weight: 600;
}

.flag-dropdown-item.active .flag-desc {
  color: #3b82f6;
}

/* Navigation */
.navbar {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  padding: 1rem 0;
}

.navbar-brand {
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--primary-blue) !important;
}

.nav-link {
  font-weight: 500;
  color: var(--text-dark) !important;
  margin: 0 0.5rem;
  transition: color 0.3s ease;
}

.nav-link:hover,
.nav-link.active {
  color: var(--primary-blue) !important;
}

/* Hero Sections */
.hero-section,
.service-hero,
.articles-hero {
  background: linear-gradient(135deg, var(--primary-blue) 0%, #3b82f6 50%, #60a5fa 100%);
  color: white;
  padding: 8rem 0 6rem;
  margin-top: 0;
  position: relative;
  overflow: hidden;
}

.service-hero,
.articles-hero {
  padding: 6rem 0 4rem;
  margin-top: 76px;
}

.hero-content {
  position: relative;
  z-index: 2;
}

.hero-section h1 {
  font-size: 3rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  line-height: 1.2;
}

.hero-section .lead {
  font-size: 1.5rem;
  margin-bottom: 1rem;
  opacity: 0.95;
}

.hero-tagline {
  font-size: 1.125rem;
  opacity: 0.9;
  margin-top: 1rem;
}

/* Sections */
.section {
  padding: 4rem 0;
}

.section-alt {
  background: var(--bg-light);
}

.section-title {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 1rem;
}

.section-subtitle {
  font-size: 1.125rem;
  color: var(--text-light);
  margin-bottom: 3rem;
}

/* Value Cards */
.value-card {
  background: white;
  border-radius: 16px;
  padding: 2rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
  height: 100%;
  border: 1px solid var(--border-color);
}

.value-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.value-icon {
  font-size: 3rem;
  color: var(--primary-blue);
  margin-bottom: 1rem;
  display: block;
}

.value-card h3 {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 1rem;
}

.value-card h4 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 0.75rem;
}

.value-card p {
  color: var(--text-light);
  line-height: 1.7;
  margin-bottom: 1rem;
}

.value-card ul {
  list-style: none;
  padding-left: 0;
}

.value-card ul li {
  padding: 0.5rem 0;
  color: var(--text-light);
  position: relative;
  padding-left: 1.5rem;
}

.value-card ul li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--primary-blue);
  font-weight: bold;
}

/* Badges */
.badge-custom {
  display: inline-block;
  padding: 0.5rem 1rem;
  background: rgba(255, 255, 255, 0.2);
  color: white;
  border-radius: 20px;
  font-size: 0.875rem;
  font-weight: 500;
  margin: 0.25rem;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.badge-location {
  background: rgba(255, 255, 255, 0.15);
}

/* Buttons */
.btn-primary-custom {
  background: var(--primary-blue);
  color: white;
  padding: 0.75rem 2rem;
  border-radius: 30px;
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.3s ease;
  border: none;
}

.btn-primary-custom:hover {
  background: #1e40af;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(30, 58, 138, 0.3);
  color: white;
}

.btn-outline-custom {
  background: transparent;
  color: white;
  padding: 0.75rem 2rem;
  border-radius: 30px;
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border: 2px solid white;
  transition: all 0.3s ease;
}

.btn-outline-custom:hover {
  background: white;
  color: var(--primary-blue);
  transform: translateY(-2px);
}

/* Service Cards */
.service-card {
  background: white;
  border-radius: 16px;
  padding: 2rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
  height: 100%;
  border: 1px solid var(--border-color);
}

.service-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.service-icon {
  font-size: 3rem;
  color: var(--primary-blue);
  margin-bottom: 1rem;
}

.service-feature {
  display: flex;
  align-items: start;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.service-feature i {
  color: var(--success-green);
  font-size: 1.25rem;
  margin-top: 0.25rem;
  flex-shrink: 0;
}

/* Article Cards */
.article-card {
  background: white;
  border-radius: 16px;
  padding: 2rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
  height: 100%;
  border: 1px solid var(--border-color);
  border-left: 4px solid var(--primary-blue);
}

.article-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.article-category {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.category-gamp {
  background: #dcfce7;
  color: #166534;
}

.category-oauth {
  background: #dbeafe;
  color: #1e40af;
}

.category-java {
  background: #fef3c7;
  color: #92400e;
}

.category-automation {
  background: #f3e8ff;
  color: #6b21a8;
}

.legacy-link {
  color: var(--primary-blue);
  text-decoration: none;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.2s ease;
}

.legacy-link:hover {
  color: #1e40af;
  text-decoration: underline;
}

.intro-box {
  background: #eff6ff;
  border-left: 4px solid var(--primary-blue);
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 2rem;
}

.intro-box h3 {
  color: var(--primary-blue);
  margin-bottom: 1rem;
  font-size: 1.25rem;
}

.intro-box p {
  color: var(--text-dark);
  line-height: 1.7;
}

/* Footer */
.footer {
  background: var(--text-dark);
  color: white;
  padding: 3rem 0 2rem;
  margin-top: 4rem;
}

.footer h5 {
  font-weight: 600;
  margin-bottom: 1rem;
  color: white;
}

.footer a {
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  transition: color 0.3s ease;
}

.footer a:hover {
  color: white;
}

.footer .list-unstyled {
  list-style: none;
  padding-left: 0;
}

.footer .list-unstyled li {
  margin-bottom: 0.5rem;
}

/* Responsive */
@media (max-width: 768px) {
  .hero-section h1 {
    font-size: 2rem;
  }
  
  .hero-section .lead {
    font-size: 1.25rem;
  }
  
  .section-title {
    font-size: 2rem;
  }
  
  
  .flag-dropdown-toggle {
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
  }
  
  /* Menu sempre alinhado à direita no mobile */
  .flag-dropdown-menu {
    min-width: 160px;
    right: 0;
    left: auto;
    /* Garante que o menu não saia da tela */
    max-width: calc(100vw - 1rem);
    width: auto;
    /* Força alinhamento à direita */
    transform: translateX(0);
  }
  
  /* Limita largura máxima em telas maiores */
  @media (min-width: 400px) {
    .flag-dropdown-menu {
      max-width: 180px;
    }
  }
  
  /* Garante que o dropdown tenha contexto correto */
  .flag-dropdown {
    position: relative;
  }
  
  /* Em mobile, ajusta posição para garantir que não saia da tela */
  @media (max-width: 768px) {
    .flag-dropdown-menu {
      /* Posiciona com margem da borda direita */
      right: 0.5rem;
      left: auto;
      max-width: calc(100vw - 1rem);
      /* Garante que o menu não ultrapasse a viewport */
      position: absolute;
    }
    
    /* Se o menu estiver muito à direita, ajusta para dentro */
    .navbar-nav .flag-dropdown .flag-dropdown-menu {
      right: 0.5rem;
      left: auto;
    }
    
    /* Classe para ajuste dinâmico via JavaScript */
    .flag-dropdown-menu.menu-adjusted {
      right: 0.5rem !important;
      left: auto !important;
    }
  }
}

