/* ============================================
   SITE INSTITUCIONAL APAES
   Estilos principais - Design responsivo
   ============================================ */

/* ========== RESET E VARIÁVEIS ========== */
:root {
  --primary-color: #43A047;
  --secondary-color: #F9A825;
  --accent-color: #FB8C00;
  --text-dark: #333333;
  --text-light: #666666;
  --bg-light: #f5f5f5;
  --white: #ffffff;
  --success: #43A047;
  --danger: #f44336;
  --warning: #FB8C00;
  --border-radius: 8px;
  --box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  --transition: all 0.3s ease;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
  color: var(--text-dark);
  background: var(--white);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  text-decoration: none;
  color: inherit;
  transition: var(--transition);
}

ul {
  list-style: none;
}

/* ========== UTILITÁRIOS ========== */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.btn {
  display: inline-block;
  padding: 12px 30px;
  border-radius: var(--border-radius);
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  border: none;
  transition: var(--transition);
}

.btn-primary {
  background: var(--primary-color);
  color: var(--white);
}

.btn-primary:hover {
  background: #2E7D32;
  transform: translateY(-2px);
  box-shadow: var(--box-shadow);
}

.btn-secondary {
  background: var(--secondary-color);
  color: var(--white);
}

.btn-secondary:hover {
  background: #F57F17;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(249, 168, 37, 0.4);
}

.btn-outline {
  background: transparent;
  border: 2px solid var(--primary-color);
  color: var(--primary-color);
}

.btn-outline:hover {
  background: var(--primary-color);
  color: var(--white);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(67, 160, 71, 0.3);
}

.section-title {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  color: var(--primary-color);
  text-align: center;
}

.section-subtitle {
  font-size: 1.1rem;
  color: var(--text-light);
  text-align: center;
  margin-bottom: 3rem;
}

/* ========== HEADER E NAVEGAÇÃO ========== */
.header {
  background: var(--white);
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  position: sticky;
  top: 0;
  z-index: 1000;
  padding: 1rem 0;
}

.header .nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 60px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--primary-color);
  text-decoration: none;
}

.logo:hover {
  opacity: 0.9;
}

.logo-image {
  height: 50px;
  width: auto;
  max-width: 200px;
  object-fit: contain;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  z-index: 1001;
}

.nav-toggle span {
  width: 25px;
  height: 3px;
  background: var(--text-dark);
  border-radius: 3px;
  transition: var(--transition);
}

.nav-menu {
  display: flex;
  gap: 2rem;
  align-items: center;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-menu li {
  list-style: none;
}

.nav-menu a,
.nav-link {
  color: var(--text-dark);
  font-weight: 500;
  padding: 0.6rem 1rem;
  border-radius: var(--border-radius);
  transition: var(--transition);
  text-decoration: none;
  display: block;
  white-space: nowrap;
}

.nav-menu a:hover,
.nav-menu a.active,
.nav-link:hover,
.nav-link.active {
  background: var(--bg-light);
  color: var(--primary-color);
}

.nav-menu .btn-primary,
.nav-link.btn-primary {
  background: var(--primary-color) !important;
  color: var(--white) !important;
  padding: 0.6rem 1.5rem;
  border-radius: var(--border-radius);
  white-space: nowrap;
}

.nav-menu .btn-primary:hover,
.nav-link.btn-primary:hover {
  background: #2E7D32 !important;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(67, 160, 71, 0.4);
}

/* ========== HERO/BANNER ========== */
.hero {
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  color: var(--white);
  padding: 6rem 0;
  text-align: center;
}

.hero-title {
  font-size: 3rem;
  margin-bottom: 1rem;
  animation: fadeInDown 1s;
}

.hero-subtitle {
  font-size: 1.5rem;
  margin-bottom: 2rem;
  opacity: 0.9;
  animation: fadeInUp 1s;
}

.hero-cta {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* ========== SEÇÕES ========== */
.section {
  padding: 4rem 0;
}

.section-alt {
  background: var(--bg-light);
}

.cta-section {
  padding: 5rem 0;
  text-align: center;
}

.cta-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 2rem;
}

/* ========== ESTATÍSTICAS ========== */
.stats-section {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: var(--white);
  padding: 4rem 0;
}

.stats-section .section-title {
  color: var(--white);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.stat-card {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  padding: 2rem;
  border-radius: var(--border-radius);
  text-align: center;
  transition: var(--transition);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.stat-card:hover {
  transform: translateY(-10px);
  background: rgba(255, 255, 255, 0.15);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.stat-number {
  font-size: 3rem;
  font-weight: bold;
  margin-bottom: 0.5rem;
  color: var(--white);
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.stat-label {
  font-size: 1.1rem;
  color: rgba(255, 255, 255, 0.9);
}

/* ========== FILTROS ========== */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
  margin: 2rem 0 3rem;
  padding: 1.5rem;
  background: #f8f9fa;
  border-radius: 12px;
}

.filter-btn {
  padding: 0.75rem 1.5rem;
  background: white;
  border: 2px solid #dee2e6;
  border-radius: 25px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 500;
  color: #495057;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
}

.filter-btn i {
  font-size: 1.1rem;
}

.filter-btn:hover {
  background: #e9ecef;
  border-color: #adb5bd;
  transform: translateY(-2px);
}

.filter-btn.active {
  background: linear-gradient(135deg, #43a047, #66bb6a);
  color: white;
  border-color: #43a047;
  box-shadow: 0 4px 12px rgba(67, 160, 71, 0.3);
}

/* ========== CARDS ========== */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.card {
  background: var(--white);
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--box-shadow);
  transition: var(--transition);
}

.card:hover {
  transform: translateY(-10px);
  box-shadow: 0 10px 25px rgba(0,0,0,0.15);
}

.card-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

.card-body {
  padding: 1.5rem;
}

.card-title {
  font-size: 1.3rem;
  margin-bottom: 0.5rem;
  color: var(--primary-color);
}

.card-text {
  color: var(--text-light);
  margin-bottom: 1rem;
}

.card-footer {
  padding: 1rem 1.5rem;
  background: var(--bg-light);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.9rem;
  color: var(--text-light);
}

/* ========== BADGES ========== */
.badge {
  display: inline-block;
  padding: 0.4rem 0.8rem;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
}

.badge-success {
  background: var(--success);
  color: var(--white);
}

.badge-info {
  background: #2196F3;
  color: var(--white);
}

.badge-warning {
  background: var(--warning);
  color: var(--white);
}

.badge-danger {
  background: var(--danger);
  color: var(--white);
}

/* ========== GALERIA ========== */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1rem;
}

.gallery-item {
  position: relative;
  overflow: hidden;
  border-radius: var(--border-radius);
  cursor: pointer;
  aspect-ratio: 1;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--transition);
}

.gallery-item:hover img {
  transform: scale(1.1);
}

.gallery-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: var(--transition);
}

.gallery-item:hover .gallery-overlay {
  opacity: 1;
}

/* ========== FORMULÁRIOS ========== */
.form-group {
  margin-bottom: 1.5rem;
}

.form-label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: var(--text-dark);
}

.form-control {
  width: 100%;
  padding: 0.75rem;
  border: 2px solid #ddd;
  border-radius: var(--border-radius);
  font-size: 1rem;
  transition: var(--transition);
}

.form-control:hover {
  border-color: #bbb;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(30, 136, 229, 0.1);
}

textarea.form-control {
  resize: vertical;
  min-height: 120px;
}

/* ========== MENSAGENS (Alerts) ========== */
.alert {
  padding: 1rem;
  border-radius: var(--border-radius);
  margin-bottom: 1rem;
}

.alert-success {
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.alert-error {
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

.alert-info {
  background: #d1ecf1;
  color: #0c5460;
  border: 1px solid #bee5eb;
}

/* ========== FOOTER ========== */
.main-footer {
  background: var(--text-dark);
  color: var(--white);
  padding: 3rem 0 1rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-column h3 {
  margin-bottom: 1rem;
  color: var(--accent-color);
  font-size: 1.2rem;
}

.footer-column p {
  color: rgba(255,255,255,0.8);
  margin-bottom: 1rem;
  line-height: 1.6;
}

.footer-column ul {
  list-style: none;
  padding: 0;
}

.footer-column ul li {
  margin-bottom: 0.75rem;
}

.footer-column a {
  color: rgba(255,255,255,0.8);
  transition: var(--transition);
}

.footer-column a:hover {
  color: var(--accent-color);
}

.footer-bottom {
  text-align: center;
  padding-top: 2rem;
  border-top: 1px solid rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.8);
}

.footer-bottom p {
  margin: 0.5rem 0;
}

.footer-bottom a {
  color: rgba(255,255,255,0.8);
  transition: var(--transition);
}

.footer-bottom a:hover {
  color: var(--accent-color);
}

.newsletter-form {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
}

.newsletter-form input {
  flex: 1;
  padding: 0.75rem;
  border: none;
  border-radius: var(--border-radius);
  font-size: 0.95rem;
}

.newsletter-form button {
  padding: 0.75rem 1.5rem;
  white-space: nowrap;
}

.footer {
  background: var(--text-dark);
  color: var(--white);
  padding: 3rem 0 1rem;
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-section h3 {
  margin-bottom: 1rem;
  color: var(--accent-color);
}

.footer-section a {
  display: block;
  margin-bottom: 0.5rem;
  color: rgba(255,255,255,0.8);
}

.footer-section a:hover {
  color: var(--accent-color);
}

.social-links {
  display: flex;
  gap: 1rem;
  margin-top: 1rem;
}

.social-link {
  width: 40px;
  height: 40px;
  background: var(--primary-color);
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  color: white;
  font-size: 1.1rem;
  text-decoration: none;
}

.social-link i {
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  vertical-align: middle;
}

.social-link:hover {
  background: var(--accent-color);
  transform: scale(1.1);
}

.footer-bottom {
  text-align: center;
  padding-top: 2rem;
  border-top: 1px solid rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.6);
}

/* ========== TABELAS RESPONSIVAS ========== */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
}

table th,
table td {
  padding: 0.75rem;
  text-align: left;
  border-bottom: 1px solid #ddd;
}

table th {
  background: var(--bg-light);
  font-weight: 600;
}

/* ========== IMAGENS RESPONSIVAS ========== */
img {
  max-width: 100%;
  height: auto;
}

.card-image,
.project-image,
.news-image {
  width: 100%;
  height: auto;
  object-fit: cover;
}

/* ========== VÍDEOS RESPONSIVOS ========== */
.video-container {
  position: relative;
  padding-bottom: 56.25%; /* 16:9 */
  height: 0;
  overflow: hidden;
}

.video-container iframe,
.video-container video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

/* ========== RESPONSIVO ========== */


/* Tablets em paisagem e desktops pequenos */
@media (max-width: 1024px) {
  .container {
    padding: 0 15px;
  }

  .cards-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
  }

  .hero-title {
    font-size: 2.5rem;
  }

  .section-title {
    font-size: 2.2rem;
  }
}

/* Tablets em retrato */
@media (max-width: 768px) {
  .nav-toggle {
    display: flex;
  }
  
  .nav-menu {
    position: fixed;
    left: -100%;
    top: 80px;
    flex-direction: column;
    background: var(--white);
    width: 100%;
    text-align: center;
    transition: left 0.3s ease;
    box-shadow: 0 10px 27px rgba(0,0,0,0.15);
    padding: 2rem 0;
    z-index: 999;
    gap: 0;
    max-height: calc(100vh - 80px);
    overflow-y: auto;
  }
  
  .nav-menu li {
    width: 100%;
  }
  
  .nav-menu a,
  .nav-link {
    width: 100%;
    padding: 1rem;
    display: block;
  }

  .nav-menu.active {
    left: 0;
  }

  .hero {
    min-height: 60vh;
    padding: 4rem 0;
  }

  .hero-title {
    font-size: 2rem;
  }

  .hero-subtitle {
    font-size: 1.1rem;
  }

  .hero-cta {
    flex-direction: column;
    gap: 1rem;
  }

  .hero-cta .btn {
    width: 100%;
    max-width: 300px;
  }

  .section {
    padding: 3rem 0;
  }

  .section-title {
    font-size: 1.8rem;
  }
  
  .filters {
    flex-direction: column;
    align-items: stretch;
  }
  
  .filter-btn {
    justify-content: center;
  }
  
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .cards-grid {
    grid-template-columns: 1fr;
  }
  
  .footer-grid {
    grid-template-columns: 1fr;
  }

  .section-subtitle {
    font-size: 1rem;
  }

  .cards-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }

  .footer-content {
    grid-template-columns: 1fr;
    gap: 2rem;
    text-align: center;
  }

  .donation-grid {
    grid-template-columns: 1fr !important;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .quick-amounts {
    grid-template-columns: repeat(2, 1fr);
  }

  table {
    font-size: 0.9rem;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Smartphones */
@media (max-width: 480px) {
  .container {
    padding: 0 10px;
  }

  .header {
    padding: 0.8rem 0;
  }

  .logo-image {
    height: 40px;
  }

  .hero {
    min-height: 50vh;
    padding: 3rem 0;
  }

  .hero-title {
    font-size: 1.5rem;
    line-height: 1.3;
  }

  .hero-subtitle {
    font-size: 0.95rem;
  }

  .btn {
    padding: 10px 20px;
    font-size: 0.9rem;
  }

  .section {
    padding: 2rem 0;
  }

  .section-title {
    font-size: 1.5rem;
  }

  .section-subtitle {
    font-size: 0.9rem;
  }

  .card {
    padding: 1rem;
  }

  .card-title {
    font-size: 1.1rem;
  }

  .card-text {
    font-size: 0.9rem;
  }

  .gallery-grid {
    grid-template-columns: 1fr;
  }

  .quick-amounts {
    grid-template-columns: 1fr;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .stat-card {
    padding: 1.5rem;
  }

  .stat-number {
    font-size: 2rem;
  }

  .footer-content {
    gap: 1.5rem;
  }

  .footer-section h3 {
    font-size: 1.1rem;
  }

  table {
    font-size: 0.8rem;
  }

  .form-group label {
    font-size: 0.9rem;
  }

  .form-control {
    padding: 0.6rem;
    font-size: 0.9rem;
  }
}

/* Smartphones muito pequenos */
@media (max-width: 360px) {
  .hero-title {
    font-size: 1.3rem;
  }

  .section-title {
    font-size: 1.3rem;
  }

  .card {
    padding: 0.8rem;
  }

  .btn {
    padding: 8px 16px;
    font-size: 0.85rem;
  }
}

/* ========== ANIMAÇÕES ========== */
@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ========== LOADING ========== */
.loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255,255,255,.3);
  border-radius: 50%;
  border-top-color: var(--white);
  animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}
