/**
 * Animations CSS for Vocação Técnica Theme
 * Advanced animations, parallax effects, and transitions
 */

/* Loading Screen Styles */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--cor-principal), var(--cor-icones));
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.5s ease;
}

.loading-content {
    text-align: center;
    color: white;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.loading-content p {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 500;
    opacity: 0.9;
}

.loading-logo h2 {
    font-size: 3rem;
    margin-bottom: 1rem;
    animation: logoFloat 2s ease-in-out infinite;
}

.loading-spinner {
    margin: 2rem 0;
    display: flex;
    justify-content: center;
    align-items: center;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes logoFloat {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

/* Scroll Progress Bar */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: rgba(255, 255, 255, 0.1);
    z-index: 1001;
}

.scroll-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--cor-principal), var(--cor-icones));
    width: 0%;
    transition: width 0.1s ease;
    box-shadow: 0 0 10px rgba(247, 145, 55, 0.5);
}

/* Header Animations */
.site-header {
    transform: translateY(0);
    transition: all 0.3s ease;
}

.site-header.hidden {
    transform: translateY(-100%);
}

.site-header.scrolled {
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
}

/* Navigation Animations */
.main-navigation ul li {
    position: relative;
    overflow: hidden;
}

.main-navigation a {
    position: relative;
    transition: all 0.3s ease;
}

.main-navigation a::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(247, 145, 55, 0.1), transparent);
    transition: left 0.5s ease;
}

.main-navigation a:hover::before {
    left: 100%;
}

/* Mobile Navigation */
.mobile-nav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 998;
}

.mobile-nav-overlay.active {
    opacity: 1;
    visibility: visible;
}

@media (max-width: 768px) {
    .main-navigation {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    
    .main-navigation.active {
        transform: translateX(0);
    }
    
    .main-navigation ul li {
        opacity: 0;
        transform: translateX(-20px);
        animation: slideInLeft 0.3s ease forwards;
    }
    
    .main-navigation.active ul li:nth-child(1) { animation-delay: 0.1s; }
    .main-navigation.active ul li:nth-child(2) { animation-delay: 0.2s; }
    .main-navigation.active ul li:nth-child(3) { animation-delay: 0.3s; }
    .main-navigation.active ul li:nth-child(4) { animation-delay: 0.4s; }
    .main-navigation.active ul li:nth-child(5) { animation-delay: 0.5s; }
    .main-navigation.active ul li:nth-child(6) { animation-delay: 0.6s; }
}

@keyframes slideInLeft {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Button Animations */
.btn {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.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;
}

.btn:hover::before {
    left: 100%;
}

.btn:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 8px 25px rgba(247, 145, 55, 0.4);
}

.btn:active {
    transform: translateY(0) scale(0.98);
}

/* Hero Section Animations */
.hero-section {
    position: relative;
    overflow: hidden;
}

.hero-content {
    animation: heroFadeInUp 1s ease-out;
}

.hero-title {
    animation: titleTypewriter 2s steps(20) forwards;
    border-right: 2px solid white;
    white-space: nowrap;
    overflow: hidden;
}

.hero-subtitle {
    opacity: 0;
    animation: fadeInUp 1s ease-out 0.5s forwards;
}

.hero-actions {
    opacity: 0;
    animation: fadeInUp 1s ease-out 1s forwards;
}

@keyframes heroFadeInUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes titleTypewriter {
    from {
        width: 0;
    }
    to {
        width: 100%;
    }
}

/* Scroll Indicator */
.scroll-indicator {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    color: white;
    animation: bounce 2s infinite;
}

.scroll-indicator i {
    display: block;
    margin-top: 10px;
    font-size: 1.5rem;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateX(-50%) translateY(0);
    }
    40% {
        transform: translateX(-50%) translateY(-10px);
    }
    60% {
        transform: translateX(-50%) translateY(-5px);
    }
}

/* Section Animations */
.section {
    opacity: 0;
    animation: sectionFadeIn 0.8s ease-out forwards;
}

@keyframes sectionFadeIn {
    to {
        opacity: 1;
    }
}

/* Card Animations */
.service-card,
.portfolio-item,
.blog-card,
.valor-card {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease-out;
}

.service-card.visible,
.portfolio-item.visible,
.blog-card.visible,
.valor-card.visible {
    opacity: 1;
    transform: translateY(0);
}

.service-card {
    transition: all 0.3s ease;
}

.service-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
}

.service-card:hover .service-icon {
    transform: scale(1.1) rotateY(180deg);
    animation: iconPulse 0.6s ease;
}

@keyframes iconPulse {
    0%, 100% { transform: scale(1.1) rotateY(180deg); }
    50% { transform: scale(1.2) rotateY(180deg); }
}

/* Portfolio Animations */
.portfolio-item {
    position: relative;
    transition: all 0.3s ease;
}

.portfolio-item:hover {
    transform: scale(1.05);
    z-index: 10;
}

.portfolio-item:hover .portfolio-image {
    transform: scale(1.1);
}

.portfolio-overlay {
    transition: all 0.3s ease;
}

.portfolio-item:hover .portfolio-overlay {
    opacity: 0.95;
}

.portfolio-overlay-content {
    transform: translateY(20px);
    transition: transform 0.3s ease 0.1s;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 1rem;
    max-width: 100%;
    max-height: 100%;
    overflow: hidden;
    box-sizing: border-box;
}

.portfolio-item:hover .portfolio-overlay-content {
    transform: translateY(0);
}

.portfolio-overlay-content h3 {
    color: white;
    font-size: 1.5rem;
    margin: 0;
    font-weight: 600;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    line-height: 1.3;
    max-height: 3.9rem; /* Limita a 3 linhas aproximadamente */
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

.portfolio-overlay-content p {
    color: white;
    font-size: 1rem;
    margin: 0;
    line-height: 1.5;
    opacity: 0.9;
    word-wrap: break-word;
    overflow-wrap: break-word;
    max-height: 4.5rem; /* Limita a 3 linhas aproximadamente */
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

.portfolio-overlay-content .btn {
    margin-top: 0.5rem;
    background: white;
    color: var(--cor-principal);
    border: 2px solid white;
    padding: 0.8rem 1.5rem;
    border-radius: 25px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    max-width: 90%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    box-sizing: border-box;
}

.portfolio-overlay-content .btn:hover {
    background: transparent;
    color: white;
    border-color: white;
    transform: translateY(-2px);
}

/* Blog Card Animations */
.blog-card {
    transition: all 0.3s ease;
}

.blog-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
}

.blog-card:hover .blog-image {
    transform: scale(1.05);
}

.blog-image {
    transition: transform 0.3s ease;
}

/* Statistics Counter Animation */
.stat-number {
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--cor-principal);
    display: block;
    line-height: 1;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--cor-texto-claro);
    margin-top: 0.5rem;
}

.apresentacao-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
    text-align: center;
}

.stat-item {
    padding: 1rem;
    border-radius: 10px;
    background: white;
    box-shadow: var(--sombra-suave);
    transition: all 0.3s ease;
}

.stat-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

/* Values Section Animations */
.valores-section {
    position: relative;
    background-attachment: fixed;
}

.valor-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 2rem;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.valor-card:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-10px);
}

.valor-icon {
    width: 80px;
    height: 80px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    font-size: 2rem;
    color: white;
    transition: all 0.3s ease;
}

.valor-card:hover .valor-icon {
    background: white;
    color: var(--cor-principal);
    transform: scale(1.1) rotateY(360deg);
}

/* Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: var(--cor-principal);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
    z-index: 1000;
    box-shadow: 0 4px 15px rgba(247, 145, 55, 0.3);
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    background: var(--cor-icones);
    transform: translateY(-3px) scale(1.1);
    box-shadow: 0 6px 20px rgba(247, 145, 55, 0.4);
}

/* WhatsApp Float Button */
.whatsapp-float {
    position: fixed;
    bottom: 30px;
    left: 30px;
    z-index: 1000;
}

.whatsapp-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    background: #25D366;
    color: white;
    border-radius: 50%;
    text-decoration: none;
    font-size: 1.5rem;
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.3);
    transition: all 0.3s ease;
    animation: whatsappPulse 2s infinite;
}

.whatsapp-button:hover {
    background: #128C7E;
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.4);
}

@keyframes whatsappPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(37, 211, 102, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(37, 211, 102, 0);
    }
}

/* Search Form Animations */
.header-search {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    padding: 1rem;
    box-shadow: var(--sombra-suave);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-20px);
    transition: all 0.3s ease;
}

.header-search.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.search-form-container {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.search-form-container input {
    flex: 1;
    padding: 0.8rem 1rem;
    border: 2px solid #e9ecef;
    border-radius: 25px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.search-form-container input:focus {
    outline: none;
    border-color: var(--cor-principal);
    box-shadow: 0 0 0 3px rgba(247, 145, 55, 0.1);
}

/* Cookie Notice */
.cookie-notice {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--cor-texto-escuro);
    color: white;
    padding: 1rem;
    z-index: 1001;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.cookie-notice.show {
    transform: translateY(0);
}

.cookie-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1200px;
    margin: 0 auto;
}

.cookie-actions {
    display: flex;
    gap: 1rem;
}

/* Form Animations */
.form-control {
    position: relative;
    transition: all 0.3s ease;
}

.form-control:focus {
    transform: scale(1.02);
}

.form-label {
    transition: all 0.3s ease;
    transform-origin: left top;
}

.form-label.floating {
    transform: translateY(-1.5rem) scale(0.85);
    color: var(--cor-principal);
}

/* Page Transition */
body.page-transition {
    overflow: hidden;
}

body.page-transition::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--cor-principal), var(--cor-icones));
    z-index: 9999;
    animation: pageSlideIn 0.3s ease forwards;
}

@keyframes pageSlideIn {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

/* Custom Cursor */
.custom-cursor {
    position: fixed;
    width: 20px;
    height: 20px;
    background: var(--cor-principal);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    mix-blend-mode: difference;
    transition: transform 0.1s ease;
}

.custom-cursor.hover {
    transform: scale(2);
    background: var(--cor-icones);
}

/* Notification System */
.vt-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 1rem 1.5rem;
    background: white;
    border-left: 4px solid var(--cor-principal);
    border-radius: 5px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    z-index: 1002;
    transform: translateX(400px);
    transition: transform 0.3s ease;
    min-width: 300px;
}

.vt-notification.show {
    transform: translateX(0);
}

.vt-notification.success {
    border-left-color: #28a745;
}

.vt-notification.error {
    border-left-color: #dc3545;
}

.vt-notification.warning {
    border-left-color: #ffc107;
}

.notification-close {
    background: none;
    border: none;
    float: right;
    font-size: 1.2rem;
    cursor: pointer;
    margin-left: 1rem;
}

/* Responsive Animations */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2rem;
        animation: none;
        border: none;
        white-space: normal;
    }
    
    .stat-item {
        margin-bottom: 1rem;
    }
    
    .apresentacao-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    .whatsapp-float {
        bottom: 20px;
        left: 20px;
    }
    
    .back-to-top {
        bottom: 90px;
        right: 20px;
        width: 45px;
        height: 45px;
    }
    
    .cookie-content {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .portfolio-overlay-content {
        padding: 0.5rem;
        gap: 0.8rem;
    }
    
    .portfolio-overlay-content h3 {
        font-size: 1.2rem;
        max-height: 3.1rem; /* Ajusta para o tamanho menor */
        -webkit-line-clamp: 2; /* Reduz para 2 linhas em tablets */
    }
    
    .portfolio-overlay-content p {
        font-size: 0.9rem;
        max-height: 2.7rem; /* Ajusta para 2 linhas em tablets */
        -webkit-line-clamp: 2;
    }
    
    .portfolio-overlay-content .btn {
        padding: 0.6rem 1.2rem;
        font-size: 0.9rem;
        max-width: 85%;
    }
}

@media (max-width: 480px) {
    .apresentacao-stats {
        grid-template-columns: 1fr;
    }
    
    .vt-notification {
        top: 10px;
        right: 10px;
        left: 10px;
        min-width: auto;
        transform: translateY(-100px);
    }
    
    .vt-notification.show {
        transform: translateY(0);
    }
    
    .portfolio-overlay-content {
        padding: 0.5rem;
        gap: 0.5rem;
    }
    
    .portfolio-overlay-content h3 {
        font-size: 1rem;
        max-height: 2.6rem; /* Ajusta para o tamanho menor */
        -webkit-line-clamp: 2; /* Mantém 2 linhas em móveis */
    }
    
    .portfolio-overlay-content p {
        font-size: 0.8rem;
        max-height: 2.4rem; /* Ajusta para 2 linhas em móveis */
        -webkit-line-clamp: 2;
    }
    
    .portfolio-overlay-content .btn {
        padding: 0.5rem 1rem;
        font-size: 0.8rem;
        max-width: 80%;
    }
    
    /* Loading screen responsivo */
    .loading-content {
        padding: 1rem;
        gap: 0.8rem;
    }
    
    .loading-content p {
        font-size: 1rem;
    }
    
    .spinner {
        width: 40px;
        height: 40px;
        border-width: 3px;
    }
}

/* Reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .scroll-progress-bar {
        transition: none;
    }
    
    .hero-title {
        animation: none;
        border: none;
    }
} 