/* INPACTO MÍDIA - CSS Mobile Otimizado para App */

/* ========================================
   PRESENÇA GLOBAL
   ======================================== */
.global-presence {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-top: 30px;
    padding: 15px 25px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 50px;
    width: fit-content;
}

.global-flags {
    display: flex;
    gap: 8px;
}

.flag-item {
    font-size: 1.5rem;
    transition: transform 0.3s ease;
    cursor: default;
}

.flag-item:hover {
    transform: scale(1.2);
}

.global-text {
    color: rgba(248, 250, 252, 0.7);
    font-size: 0.9rem;
    font-weight: 500;
}

@media (max-width: 768px) {
    .global-presence {
        flex-direction: column;
        gap: 10px;
        padding: 12px 20px;
        margin: 25px auto 0;
    }
    
    .global-text {
        font-size: 0.8rem;
        text-align: center;
    }
}

/* ========================================
   MELHORIAS MOBILE & PWA
   ======================================== */

/* Evitar zoom indesejado em inputs */
input, select, textarea {
    font-size: 16px !important;
}

/* Safe area para iPhones com notch */
@supports (padding: max(0px)) {
    body {
        padding-top: env(safe-area-inset-top);
        padding-bottom: env(safe-area-inset-bottom);
        padding-left: env(safe-area-inset-left);
        padding-right: env(safe-area-inset-right);
    }
    
    #header {
        padding-top: env(safe-area-inset-top);
    }
    
    .whatsapp-float {
        bottom: calc(30px + env(safe-area-inset-bottom));
    }
    
    #backToTop {
        bottom: calc(100px + env(safe-area-inset-bottom));
    }
}

/* ========================================
   TELA MUITO PEQUENA (até 375px)
   ======================================== */
@media (max-width: 375px) {
    html {
        font-size: 14px;
    }
    
    .container {
        padding: 0 15px;
    }
    
    .hero-title {
        font-size: 1.8rem !important;
    }
    
    .section-title {
        font-size: 1.5rem !important;
    }
    
    .hero-stats {
        flex-direction: column;
        gap: 20px;
    }
    
    .stat-divider {
        display: none;
    }
    
    .hero-cta {
        flex-direction: column;
    }
    
    .btn-lg {
        padding: 14px 24px;
        font-size: 0.95rem;
    }
    
    .service-card {
        padding: 25px 20px;
    }
    
    .result-card {
        padding: 25px 15px;
    }
    
    .result-number {
        font-size: 2rem;
    }
}

/* ========================================
   MOBILE PORTRAIT (até 480px)
   ======================================== */
@media (max-width: 480px) {
    /* Header Mobile */
    .navbar {
        padding: 15px 0;
    }
    
    .logo-text {
        font-size: 1.2rem;
    }
    
    .logo-accent {
        font-size: 1.2rem;
    }
    
    /* Hero ajustes */
    .hero {
        min-height: auto;
        padding: 100px 0 60px;
    }
    
    .hero-badge {
        font-size: 0.8rem;
        padding: 8px 15px;
    }
    
    .hero-title {
        font-size: 2rem;
        margin-bottom: 20px;
    }
    
    .hero-description {
        font-size: 1rem;
        margin-bottom: 30px;
    }
    
    .hero-visual {
        display: none;
    }
    
    .scroll-indicator {
        display: none;
    }
    
    /* Stats horizontais no mobile */
    .hero-stats {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 15px;
        text-align: center;
    }
    
    .stat-item {
        align-items: center;
    }
    
    .stat-number {
        font-size: 1.5rem;
    }
    
    .stat-suffix {
        font-size: 1.1rem;
    }
    
    .stat-label {
        font-size: 0.7rem;
    }
    
    /* Seções */
    .about-section,
    .services-section,
    .portfolio-section,
    .results-section,
    .testimonials-section {
        padding: 60px 0;
    }
    
    .section-header {
        margin-bottom: 40px;
    }
    
    .section-badge {
        font-size: 0.8rem;
        padding: 6px 12px;
    }
    
    .section-title {
        font-size: 1.6rem;
    }
    
    .section-description {
        font-size: 0.95rem;
    }
    
    /* Cards de serviço */
    .services-grid {
        gap: 20px;
    }
    
    .service-card {
        padding: 30px 20px;
    }
    
    .service-title {
        font-size: 1.2rem;
    }
    
    .service-description {
        font-size: 0.9rem;
    }
    
    .service-features li {
        font-size: 0.85rem;
    }

    /* Evitar sobreposição nos dados do card (stats) */
    .service-stats {
        flex-wrap: wrap;
        justify-content: center;
        gap: 12px;
    }

    .service-stat {
        flex: 1;
        min-width: 130px;
    }

    .stat-value {
        font-size: 1.15rem;
    }

    .stat-desc {
        font-size: 0.8rem;
        line-height: 1.2;
    }
    
    /* Portfolio */
    .portfolio-filter {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .filter-btn {
        padding: 8px 16px;
        font-size: 0.8rem;
    }
    
    .portfolio-grid {
        gap: 15px;
    }
    
    /* Resultados */
    .results-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .result-card {
        padding: 20px;
    }
    
    .result-number {
        font-size: 2.2rem;
    }
    
    .result-label {
        font-size: 0.75rem;
    }
    
    /* Depoimentos */
    .testimonial-card {
        padding: 25px 20px;
    }
    
    .testimonial-text {
        font-size: 0.95rem;
    }
    
    /* FAQ */
    .faq-question {
        font-size: 0.95rem;
        padding: 18px;
    }
    
    .faq-answer {
        font-size: 0.9rem;
    }
    
    /* Contato */
    .contact-grid {
        gap: 30px;
    }
    
    .contact-form {
        padding: 25px 20px;
    }
    
    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: 14px 16px;
        font-size: 16px;
    }
    
    /* Footer */
    .footer-grid {
        gap: 30px;
    }
    
    .footer-bottom {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    /* Botões fixos */
    .whatsapp-float {
        width: 55px;
        height: 55px;
        font-size: 1.4rem;
    }
    
    #backToTop {
        width: 45px;
        height: 45px;
    }
}

/* ========================================
   MOBILE LANDSCAPE (até 768px)
   ======================================== */
@media (max-width: 768px) {
    /* Evitar que o botão flutuante cubra conteúdo no fim da página */
    body {
        padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 110px);
    }

    /* Menu Mobile */
    .nav-links,
    .nav-cta {
        display: none;
    }
    
    .hamburger {
        display: flex;
    }
    
    /* Mobile Menu Fullscreen */
    .mobile-menu {
        width: 100%;
        right: -100%;
        padding-top: 80px;
    }
    
    .mobile-nav-links {
        text-align: center;
    }
    
    .mobile-nav-link {
        font-size: 1.3rem;
        display: block;
        padding: 10px 0;
    }
    
    .mobile-cta {
        margin-top: 30px;
    }
    
    /* Hero Grid */
    .hero .container {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    /* Em telas <= 768px, o mockup/floating cards podem causar sobreposição */
    .hero-visual {
        display: none;
    }
    
    .hero-content {
        text-align: center;
    }
    
    .hero-cta {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .hero-description {
        max-width: 100%;
    }
    
    /* About Grid */
    .about-grid {
        grid-template-columns: 1fr;
        gap: 50px;
    }
    
    .about-content {
        text-align: center;
    }
    
    .about-features {
        text-align: left;
    }
    
    .about-visual {
        order: -1;
    }
    
    .about-image-wrapper {
        height: 350px;
    }
    
    /* Services Grid */
    .services-grid {
        grid-template-columns: 1fr;
    }
    
    /* Portfolio Grid */
    .portfolio-grid {
        grid-template-columns: 1fr;
    }
    
    /* Results Grid */
    .results-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Process */
    .process-timeline {
        flex-direction: column;
    }
    
    .process-line {
        width: 3px;
        height: 100%;
        left: 50%;
        transform: translateX(-50%);
    }
    
    .process-step {
        width: 100%;
    }
    
    /* Contact Grid */
    .contact-grid {
        grid-template-columns: 1fr;
    }
    
    /* Footer Grid */
    .footer-grid {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .footer-social {
        justify-content: center;
    }
}

/* ========================================
   TABLET (até 1024px)
   ======================================== */
@media (max-width: 1024px) {
    .hero .container {
        grid-template-columns: 1fr;
    }
    
    .hero-visual {
        display: none;
    }
    
    .services-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .portfolio-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .about-grid {
        gap: 40px;
    }
}

/* ========================================
   TOUCH DEVICE IMPROVEMENTS
   ======================================== */
@media (hover: none) and (pointer: coarse) {
    /* Remove hover effects em touch devices */
    .service-card:hover,
    .portfolio-item:hover,
    .result-card:hover {
        transform: none;
    }
    
    /* Mostrar overlay sempre em portfolio */
    .portfolio-overlay {
        opacity: 1;
        background: linear-gradient(
            to top,
            rgba(10, 10, 15, 0.95) 0%,
            rgba(10, 10, 15, 0.7) 50%,
            transparent 100%
        );
    }
    
    /* Botões com area de toque maior */
    .btn {
        min-height: 48px;
    }
    
    .nav-link,
    .mobile-nav-link {
        min-height: 44px;
        display: flex;
        align-items: center;
    }
    
    /* Remover efeitos de tilt 3D */
    .service-card,
    .portfolio-item,
    .result-card {
        transform: none !important;
    }
}

/* ========================================
   PWA INSTALL BANNER
   ======================================== */
.pwa-install-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, var(--dark-light), var(--dark));
    padding: 15px 20px;
    padding-bottom: calc(15px + env(safe-area-inset-bottom, 0px));
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    z-index: 9999;
    transform: translateY(100%);
    transition: transform 0.3s ease;
    box-shadow: 0 -5px 30px rgba(0, 0, 0, 0.3);
    border-top: 1px solid rgba(0, 212, 255, 0.2);
}

.pwa-install-banner.show {
    transform: translateY(0);
}

.pwa-install-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.pwa-install-icon {
    width: 45px;
    height: 45px;
    background: var(--gradient);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    color: white;
}

.pwa-install-text h4 {
    font-size: 0.95rem;
    margin-bottom: 2px;
    color: var(--white);
}

.pwa-install-text p {
    font-size: 0.8rem;
    color: rgba(248, 250, 252, 0.7);
}

.pwa-install-btn {
    background: var(--gradient);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 25px;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    white-space: nowrap;
}

.pwa-install-close {
    background: none;
    border: none;
    color: rgba(248, 250, 252, 0.5);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 5px;
}

/* ========================================
   OFFLINE INDICATOR
   ======================================== */
.offline-indicator {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    text-align: center;
    padding: 10px;
    font-size: 0.85rem;
    font-weight: 500;
    z-index: 10000;
    transform: translateY(-100%);
    transition: transform 0.3s ease;
}

.offline-indicator.show {
    transform: translateY(0);
}

/* ========================================
   PULL TO REFRESH (opcional)
   ======================================== */
.pull-to-refresh {
    position: fixed;
    top: -50px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 40px;
    background: var(--dark-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    z-index: 9998;
    transition: top 0.3s ease;
    box-shadow: var(--shadow-soft);
}

.pull-to-refresh.pulling {
    top: 20px;
}

.pull-to-refresh i {
    animation: rotate 1s linear infinite;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ========================================
   SPLASHSCREEN STYLES
   ======================================== */
.splash-screen {
    position: fixed;
    inset: 0;
    background: var(--dark);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 99999;
}

.splash-logo {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 30px;
}

.splash-logo .logo-text {
    color: var(--white);
}

.splash-logo .logo-accent {
    color: var(--primary);
}

.splash-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(0, 212, 255, 0.2);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ========================================
   HAPTIC FEEDBACK VISUAL (quando clicado)
   ======================================== */
.btn:active,
.service-card:active,
.portfolio-item:active {
    transform: scale(0.98);
}

/* ========================================
   BOTTOM NAV BAR (Opcional - estilo app)
   ======================================== */
.bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(10, 10, 15, 0.98);
    backdrop-filter: blur(20px);
    padding: 10px 0;
    padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
    z-index: 1000;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.bottom-nav-items {
    display: flex;
    justify-content: space-around;
    list-style: none;
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: rgba(248, 250, 252, 0.6);
    text-decoration: none;
    font-size: 0.7rem;
    transition: color 0.2s ease;
}

.bottom-nav-item i {
    font-size: 1.3rem;
}

.bottom-nav-item.active,
.bottom-nav-item:hover {
    color: var(--primary);
}

/* Mostrar bottom nav apenas em mobile e quando instalado como PWA */
@media (max-width: 768px) and (display-mode: standalone) {
    .bottom-nav {
        display: block;
    }
    
    body {
        padding-bottom: calc(70px + env(safe-area-inset-bottom, 0px));
    }
    
    .whatsapp-float {
        bottom: calc(90px + env(safe-area-inset-bottom, 0px));
    }
    
    #backToTop {
        bottom: calc(160px + env(safe-area-inset-bottom, 0px));
    }
}

/* ========================================
   DARK/LIGHT MODE READY
   ======================================== */
@media (prefers-color-scheme: light) {
    /* O site é dark por padrão, mas podemos adicionar light mode */
    /* :root {
        --dark: #f8fafc;
        --dark-light: #e2e8f0;
        --light: #0a0a0f;
    } */
}

/* ========================================
   REDUCED MOTION
   ======================================== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .hero-particles {
        display: none;
    }
    
    .floating-card {
        animation: none;
    }
    
    .brands-track {
        animation: none;
    }
}

/* ========================================
   HIGH CONTRAST MODE
   ======================================== */
@media (prefers-contrast: high) {
    :root {
        --primary: #00ffff;
        --secondary: #a855f7;
    }
    
    .btn-primary {
        border: 2px solid white;
    }
    
    .service-card,
    .result-card,
    .testimonial-card {
        border: 2px solid rgba(255, 255, 255, 0.3);
    }
}
