/* resources/views/portal/assets/css/backgrounds.css */

/* ============================================
   BACKGROUND IMAGES - PORTAL CPJ HUÍLA
   Versão com URLs absolutas e fallbacks
   ============================================ */

/* Hero Section com Background Image */
.hero {
    /* Fallback sólido primeiro */
    background: linear-gradient(135deg, #2c3e50 0%, #1a252f 100%);
    
    /* Imagem com overlay */
    background: 
        linear-gradient(rgba(44, 62, 80, 0.85), rgba(26, 37, 47, 0.9)),
        url('http://localhost:8000/assets/img/home.jpg')
        center/cover no-repeat fixed;
    
    color: white;
    padding: 6rem 0;
    position: relative;
    overflow: hidden;
    min-height: 80vh;
    display: flex;
    align-items: center;
}

/* Fallback para caso a imagem não carregue */
.hero.no-image-loaded {
    background: linear-gradient(135deg, #2c3e50 0%, #1a252f 100%) !important;
}

/* CTA Section com Background Image */
.cta {
    /* Fallback sólido primeiro */
    background: linear-gradient(135deg, #1a252f 0%, #0d151d 100%);
    
    /* Imagem com overlay - você pode usar a mesma ou outra */
    background: 
        linear-gradient(rgba(26, 37, 47, 0.9), rgba(13, 21, 29, 0.95)),
        url('http://localhost:8000/assets/img/home.jpg')
        center/cover no-repeat fixed;
    
    color: white;
    padding: 6rem 0;
    position: relative;
    overflow: hidden;
    min-height: 60vh;
    display: flex;
    align-items: center;
}

/* Fallback para CTA */
.cta.no-image-loaded {
    background: linear-gradient(135deg, #1a252f 0%, #0d151d 100%) !important;
}

/* Efeitos visuais para quando a imagem carregar */
.hero.image-loaded::before,
.cta.image-loaded::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 50%, rgba(52, 152, 219, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(231, 76, 60, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 80%, rgba(46, 204, 113, 0.1) 0%, transparent 50%);
    z-index: 1;
    animation: pulse 15s infinite alternate;
}

/* Efeito de gradiente animado para CTA */
.cta.image-loaded::before {
    background: linear-gradient(45deg, 
        rgba(52, 152, 219, 0.2) 0%,
        rgba(231, 76, 60, 0.2) 25%,
        rgba(46, 204, 113, 0.2) 50%,
        rgba(155, 89, 182, 0.2) 75%,
        rgba(52, 152, 219, 0.2) 100%);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
}

/* Conteúdo sobre as imagens */
.hero-content,
.cta-content {
    position: relative;
    z-index: 2;
    width: 100%;
    text-align: center;
}

/* Títulos */
.hero-title {
    color: white;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.5);
    animation: fadeInUp 1s ease-out;
}

.cta-title {
    font-size: 3rem;
    color: white;
    margin-bottom: 1.5rem;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.5);
    animation: fadeInUp 1s ease-out;
}

/* Subtítulos */
.hero-subtitle {
    font-size: 1.4rem;
    opacity: 0.95;
    margin-bottom: 2.5rem;
    line-height: 1.6;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
    text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.5);
    animation: fadeInUp 1s ease-out 0.2s both;
}

.cta-text {
    font-size: 1.3rem;
    opacity: 0.95;
    margin-bottom: 2.5rem;
    line-height: 1.6;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
    text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.5);
    animation: fadeInUp 1s ease-out 0.2s both;
}

/* Botões com efeitos */
.hero .btn-primary,
.cta .btn-light {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.hero .btn-primary:hover,
.cta .btn-light:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.4);
}

.hero .btn-primary:hover {
    background: var(--primary-dark);
    border-color: var(--secondary);
}

.cta .btn-light:hover {
    background: white;
    color: var(--primary);
    border-color: white;
}

/* Linha decorativa abaixo dos títulos */
.hero-title::after,
.cta-title::after {
    content: '';
    display: block;
    width: 100px;
    height: 4px;
    background: var(--secondary);
    margin: 1.5rem auto;
    border-radius: 2px;
    animation: widthGrow 1s ease-out 0.5s both;
}

/* ============================================
   ANIMAÇÕES
   ============================================ */

@keyframes pulse {
    0% {
        opacity: 0.3;
        transform: scale(1);
    }
    50% {
        opacity: 0.5;
        transform: scale(1.02);
    }
    100% {
        opacity: 0.3;
        transform: scale(1);
    }
}

@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes widthGrow {
    from {
        width: 0;
        opacity: 0;
    }
    to {
        width: 100px;
        opacity: 1;
    }
}

/* ============================================
   RESPONSIVIDADE
   ============================================ */

/* Tablets */
@media (max-width: 992px) {
    .hero,
    .cta {
        padding: 4rem 0;
        min-height: auto;
        background-attachment: scroll; /* Remove parallax em mobile */
    }
    
    .hero-title {
        font-size: 2.8rem;
    }
    
    .cta-title {
        font-size: 2.5rem;
    }
    
    .hero-subtitle {
        font-size: 1.2rem;
    }
    
    .cta-text {
        font-size: 1.1rem;
    }
}

/* Celulares */
@media (max-width: 768px) {
    .hero,
    .cta {
        padding: 3rem 0;
    }
    
    .hero-title {
        font-size: 2.2rem;
    }
    
    .cta-title {
        font-size: 2rem;
    }
    
    .hero-subtitle {
        font-size: 1.1rem;
        padding: 0 1rem;
    }
    
    .cta-text {
        font-size: 1rem;
        padding: 0 1rem;
    }
    
    .hero-actions,
    .cta-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .hero .btn,
    .cta .btn {
        width: 100%;
        max-width: 300px;
        margin-bottom: 1rem;
    }
}

/* Celulares pequenos */
@media (max-width: 576px) {
    .hero-title {
        font-size: 1.8rem;
    }
    
    .cta-title {
        font-size: 1.6rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .cta-text {
        font-size: 0.95rem;
    }
    
    .hero-title::after,
    .cta-title::after {
        width: 80px;
        height: 3px;
    }
}

/* ============================================
   JAVASCRIPT-ENHANCED VERSIONS
   Classes que serão adicionadas via JS
   ============================================ */

/* Para quando a imagem carregar com sucesso */
.hero.image-loaded,
.cta.image-loaded {
    transition: background 1s ease;
}

/* Para loading state */
.hero.loading,
.cta.loading {
    background: linear-gradient(90deg, 
        #2c3e50 25%, 
        #34495e 50%, 
        #2c3e50 75%
    );
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* ============================================
   PADRÕES ALTERNATIVOS (sem imagens)
   ============================================ */

/* Padrão de pontos */
.hero.pattern-dots {
    background: 
        linear-gradient(rgba(44, 62, 80, 0.9), rgba(26, 37, 47, 0.95)),
        radial-gradient(circle at 1px 1px, rgba(255, 255, 255, 0.1) 1px, transparent 2px);
    background-size: cover, 40px 40px;
}

/* Padrão de linhas diagonais */
.cta.pattern-lines {
    background: 
        linear-gradient(rgba(26, 37, 47, 0.95), rgba(13, 21, 29, 0.98)),
        repeating-linear-gradient(
            45deg,
            transparent,
            transparent 10px,
            rgba(255, 255, 255, 0.05) 10px,
            rgba(255, 255, 255, 0.05) 20px
        );
}

/* Gradiente animado */
.hero.gradient-animated {
    background: linear-gradient(45deg, 
        #2c3e50 0%,
        #34495e 25%,
        #2c3e50 50%,
        #34495e 75%,
        #2c3e50 100%);
    background-size: 400% 400%;
    animation: gradientShift 10s ease infinite;
}

/* ============================================
   ACESSIBILIDADE
   ============================================ */

/* Modo alto contraste */
@media (prefers-contrast: high) {
    .hero,
    .cta {
        background: var(--primary-dark) !important;
    }
    
    .hero-title,
    .cta-title {
        text-shadow: none;
        color: white;
    }
    
    .hero-subtitle,
    .cta-text {
        text-shadow: none;
        color: #e0e0e0;
    }
}

/* Prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
    .hero::before,
    .cta::before,
    .hero.image-loaded::before,
    .cta.image-loaded::before,
    .hero.loading,
    .cta.loading {
        animation: none !important;
    }
    
    .hero .btn-primary:hover,
    .cta .btn-light:hover {
        transform: none;
    }
    
    .hero-title::after,
    .cta-title::after {
        animation: none;
        width: 100px;
        opacity: 1;
    }
}