body {
    margin: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f8f9fa;
    line-height: 1.6;
}

/* Gradientes e sombras */
.bg-gradient-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.bg-gradient-secondary {
    background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
}

.text-shadow {
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

/* Header melhorado */
header {
    background: linear-gradient(135deg, #2c3e50 0%, #3498db 100%);
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    position: relative;
    z-index: 1000; /* Header sempre no topo */
}

.navbar-brand {
    font-weight: bold;
    font-size: 1.8rem;
}

.nav-link {
    font-weight: 500;
    transition: all 0.3s ease;
}

.nav-link:hover {
    transform: translateY(-2px);
    color: #ffd700 !important;
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 60vh;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
    z-index: 1; /* Garantir que não sobreponha outros elementos */
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 100" fill="white" opacity="0.1"><polygon points="0,100 1000,0 1000,100"/></svg>');
    background-size: cover;
}

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

/* Carousel melhorado e responsivo */
.carousel {
    position: relative;
    width: 100%;
    height: 70vh;
    overflow: hidden;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
    z-index: 3; /* Carousel acima das outras seções */
}

.carousel-inner {
    display: flex;
    transition: transform 0.5s ease;
    height: 100%;
}

.carousel-item {
    min-width: 100%;
    height: 100%;
    position: relative;
}

.carousel-item img {
    object-fit: cover;
    height: 70vh;
    width: 100%;
    filter: brightness(0.8);
    transition: filter 0.3s ease;
}

.carousel-item:hover img {
    filter: brightness(1);
}

.carousel-caption {
    position: absolute;
    bottom: 30px;
    left: 30px;
    right: 30px;
    color: white;
    background: linear-gradient(135deg, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0.5) 100%);
    padding: 25px;
    border-radius: 15px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.1);
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.carousel-item:hover .carousel-caption {
    transform: translateY(0);
}

.carousel-caption h5 {
    font-size: 2rem;
    font-weight: bold;
    margin-bottom: 10px;
    color: #ffd700;
}

.carousel-caption p {
    font-size: 1.1rem;
    margin-bottom: 0;
    line-height: 1.6;
}

/* Controles do carousel */
.carousel-control-prev-icon,
.carousel-control-next-icon {
    background-color: rgba(0,0,0,0.6);
    border-radius: 50%;
    padding: 20px;
    width: 60px;
    height: 60px;
    transition: all 0.3s ease;
}

.carousel-control-prev-icon:hover,
.carousel-control-next-icon:hover {
    background-color: rgba(0,0,0,0.8);
    transform: scale(1.1);
}

/* Cards de destaque */
.feature-card {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid rgba(0,0,0,0.05);
    position: relative;
    z-index: 2; /* Cards acima do background */
}

.feature-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
}

.feature-icon {
    font-size: 3rem;
    color: #3498db;
    margin-bottom: 20px;
}

/* Seção de estatísticas */
.stats-section {
    background: linear-gradient(135deg, #2c3e50 0%, #3498db 100%);
    color: white;
    padding: 80px 0;
    position: relative;
    z-index: 2; /* Garantir que fique acima do hero-section */
}

.stat-item {
    text-align: center;
    padding: 20px;
}

.stat-number {
    font-size: 3rem;
    font-weight: bold;
    color: #ffd700;
    display: block;
}

.stat-label {
    font-size: 1.1rem;
    margin-top: 10px;
}

/* Footer melhorado */
footer {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: white;
    padding: 50px 0 20px;
    position: relative;
    z-index: 2; /* Footer acima do hero-section */
}

.footer-section {
    margin-bottom: 30px;
}

.footer-section h5 {
    color: #ffd700;
    margin-bottom: 20px;
    font-weight: bold;
}

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

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

.footer-section ul li a {
    color: #bdc3c7;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-section ul li a:hover {
    color: #ffd700;
}

/* RESPONSIVIDADE MOBILE-FIRST */

/* Tablets e telas menores que 768px */
@media (max-width: 768px) {
    .carousel {
        height: auto; /* Altura automática para acomodar caption embaixo */
        border-radius: 10px;
    }
    
    .carousel-item {
        position: relative;
        background: white;
        border-radius: 10px;
        overflow: hidden;
        box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    }
    
    .carousel-item img {
        height: 45vh;
        width: 100%;
        object-fit: cover;
        border-radius: 10px 10px 0 0;
    }
    
    .carousel-caption {
        position: static; /* Caption embaixo da imagem */
        bottom: auto;
        left: auto;
        right: auto;
        padding: 20px;
        background: white;
        color: #333;
        border-radius: 0 0 10px 10px;
        box-shadow: none;
        backdrop-filter: none;
        border: none;
        transform: none;
        margin: 0;
    }
    
    .carousel-caption h5 {
        font-size: 1.2rem;
        margin-bottom: 10px;
        color: #2c3e50;
        font-weight: 600;
    }
    
    .carousel-caption p {
        font-size: 0.85rem;
        margin-bottom: 12px;
        line-height: 1.4;
        color: #555;
        /* Limita o texto a 3 linhas para melhor legibilidade */
        display: -webkit-box;
        -webkit-line-clamp: 3;
        line-clamp: 3;
        -webkit-box-orient: vertical;
        overflow: hidden;
        text-overflow: ellipsis;
        max-height: 4.2em;
    }
    
    .carousel-caption .mt-3 {
        margin-top: 10px !important;
    }
    
    .carousel-caption .badge {
        font-size: 0.7rem;
        padding: 4px 8px;
        margin-right: 5px;
        margin-bottom: 5px;
        display: inline-block;
    }
    
    /* Ajustar controles do carousel */
    .carousel-control-prev,
    .carousel-control-next {
        width: 8%;
        top: 0;
        bottom: 45%; /* Posiciona os controles apenas na área da imagem */
    }
    
    .carousel-control-prev-icon,
    .carousel-control-next-icon {
        width: 35px;
        height: 35px;
        background-color: rgba(0,0,0,0.6);
        border-radius: 50%;
    }
    
    /* Remove hover effects no mobile */
    .carousel-item:hover .carousel-caption {
        transform: none;
    }
    
    .hero-section {
        min-height: 50vh;
        padding: 30px 0;
    }
    
    .hero-section h1 {
        font-size: 2.5rem;
        margin-bottom: 20px;
    }
    
    .hero-section p {
        font-size: 1rem;
        margin-bottom: 25px;
    }
    
    .stat-number {
        font-size: 2.2rem;
    }
    
    .feature-card {
        margin-bottom: 20px;
        padding: 25px 20px;
    }
    
    .feature-icon {
        font-size: 2.5rem;
    }
    
    /* Header responsivo */
    header .container {
        flex-direction: column;
        text-align: center;
        padding: 15px;
    }
    
    header .d-flex {
        margin-bottom: 10px;
    }
    
    header nav {
        width: 100%;
    }
    
    header .nav {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    header .nav-item {
        margin: 2px 5px;
    }
    
    header .nav-link {
        font-size: 0.9rem;
        padding: 8px 12px;
    }
    
    .stats-section {
        padding: 50px 0;
    }
    
    .carousel-control-prev-icon,
    .carousel-control-next-icon {
        width: 45px;
        height: 45px;
        padding: 15px;
    }
}

/* Smartphones pequenos (iPhone SE, etc.) */
@media (max-width: 480px) {
    .carousel {
        height: auto; /* Mantém altura automática */
        border-radius: 8px;
    }
    
    .carousel-item {
        border-radius: 8px;
    }
    
    .carousel-item img {
        height: 35vh; /* Reduz altura para mostrar mais imagem */
        border-radius: 8px 8px 0 0;
    }
    
    .carousel-caption {
        position: static; /* Caption embaixo da imagem */
        bottom: auto;
        left: auto;
        right: auto;
        padding: 15px;
        background: white;
        color: #333;
        border-radius: 0 0 8px 8px;
    }
    
    .carousel-caption h5 {
        font-size: 1.1rem;
        margin-bottom: 8px;
        color: #2c3e50;
        font-weight: 600;
    }
    
    .carousel-caption p {
        font-size: 0.8rem;
        line-height: 1.3;
        color: #555;
        margin-bottom: 10px;
        /* Limita o texto a 2 linhas em telas muito pequenas */
        display: -webkit-box;
        -webkit-line-clamp: 2;
        line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        text-overflow: ellipsis;
        max-height: 2.6em;
    }
    
    .carousel-caption .badge {
        font-size: 0.65rem;
        padding: 3px 6px;
        margin-right: 3px;
        margin-bottom: 3px;
    }
    
    .carousel-control-prev,
    .carousel-control-next {
        width: 10%;
        top: 0;
        bottom: 50%;
    }
    
    .carousel-control-prev-icon,
    .carousel-control-next-icon {
        width: 30px;
        height: 30px;
        background-color: rgba(0,0,0,0.6);
        border-radius: 50%;
    }
    
    .hero-section h1 {
        font-size: 2rem;
        margin-bottom: 15px;
    }
    
    .hero-section p {
        font-size: 0.9rem;
        margin-bottom: 20px;
    }
    
    .btn-lg {
        font-size: 0.9rem;
        padding: 10px 25px;
    }
    
    /* Header mais compacto */
    header .container {
        padding: 10px 15px;
    }
    
    header h1 {
        font-size: 1.3rem;
    }
    
    header small {
        font-size: 0.75rem;
    }
    
    header .nav-link {
        font-size: 0.8rem;
        padding: 6px 8px;
    }
    
    header i[style*="font-size: 3rem"] {
        font-size: 2rem !important;
    }
    
    .stat-number {
        font-size: 1.8rem;
    }
    
    .stat-label {
        font-size: 0.9rem;
    }
    
    .feature-card {
        padding: 20px 15px;
    }
    
    .feature-icon {
        font-size: 2rem;
    }
    
    .carousel-control-prev-icon,
    .carousel-control-next-icon {
        width: 35px;
        height: 35px;
        padding: 10px;
    }
}

/* Responsividade para tablets */
@media (min-width: 769px) and (max-width: 1024px) {
    .carousel {
        height: 60vh;
    }
    
    .carousel-item img {
        height: 60vh;
    }
    
    .carousel-caption {
        bottom: 20px;
        left: 20px;
        right: 20px;
        padding: 20px;
    }
    
    .carousel-caption h5 {
        font-size: 1.8rem;
    }
    
    .carousel-caption p {
        font-size: 1rem;
        /* Limita o texto a 3 linhas em tablets */
        display: -webkit-box;
        -webkit-line-clamp: 3;
        line-clamp: 3;
        -webkit-box-orient: vertical;
        overflow: hidden;
        text-overflow: ellipsis;
        max-height: 4.5em; /* Fallback para browsers que não suportam line-clamp */
    }
    
    .hero-section h1 {
        font-size: 3rem;
    }
}

/* Landscape mobile */
@media (max-height: 500px) and (orientation: landscape) {
    .hero-section {
        min-height: 100vh;
        padding: 15px 0;
    }
    
    .hero-section h1 {
        font-size: 2rem;
        margin-bottom: 10px;
    }
    
    .hero-section p {
        font-size: 0.9rem;
        margin-bottom: 15px;
    }
    
    .carousel {
        height: 70vh;
    }
    
    .carousel-item img {
        height: 70vh;
        border-radius: 10px; /* Volta ao border-radius completo */
    }
    
    .carousel-caption {
        position: absolute; /* Volta ao posicionamento absoluto */
        bottom: 10px;
        left: 10px;
        right: 10px;
        padding: 10px;
        background: rgba(0,0,0,0.4); /* Mais transparente */
        color: white;
        border-radius: 8px;
        backdrop-filter: blur(5px);
    }
    
    .carousel-caption h5 {
        font-size: 1rem;
        margin-bottom: 5px;
        color: #ffd700;
    }
    
    .carousel-caption p {
        font-size: 0.75rem;
        color: white;
        display: -webkit-box;
        -webkit-line-clamp: 1;
        line-clamp: 1;
        -webkit-box-orient: vertical;
        overflow: hidden;
        text-overflow: ellipsis;
        max-height: 0.75em;
        margin-bottom: 5px;
    }
    
    .carousel-caption .badge {
        font-size: 0.6rem;
        padding: 1px 3px;
    }
}

/* Animações */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

/* Melhorias de acessibilidade e UX */
@media (prefers-reduced-motion: reduce) {
    .carousel-inner {
        transition: none;
    }
    
    .fade-in-up {
        animation: none;
    }
    
    .carousel-item:hover .carousel-caption {
        transform: none;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    body {
        background-color: #1a1a1a;
    }
    
    .feature-card {
        background: #2d3748;
        color: white;
    }
}