/* ================================================================
   ROCKETZONE - RESPONSIVIDADE COMPLETA E DARK MODE
   
   Sistema de Design Responsivo e Tema Escuro/Claro
   Arquivo: assets/css/responsive.css
   
   ÍNDICE:
   1. Variáveis Dark Mode
   2. Sistema de Grid Responsivo
   3. Breakpoints e Media Queries
   4. Header e Navegação Responsiva
   5. Hero Section Responsiva
   6. Seções de Conteúdo Responsivas
   7. Formulários e Componentes
   8. Dark Mode Styles
   9. Utilitários Responsivos
   10. Ajustes Específicos por Dispositivo
   ================================================================ */

/* ================================================================
   1. VARIÁVEIS DARK MODE
   ================================================================ */
:root[data-theme="dark"] {
    /* === CORES PRINCIPAIS DARK === */
    --primary-50: #1e3a8a;
    --primary-100: #1e40af;
    --primary-200: #1d4ed8;
    --primary-300: #2563eb;
    --primary-400: #3b82f6;
    --primary-500: #60a5fa;
    --primary-600: #93c5fd;
    --primary-700: #bfdbfe;
    --primary-800: #dbeafe;
    --primary-900: #eff6ff;

    /* === CORES NEUTRAS DARK === */
    --gray-50: #111827;
    --gray-100: #1f2937;
    --gray-200: #374151;
    --gray-300: #4b5563;
    --gray-400: #6b7280;
    --gray-500: #9ca3af;
    --gray-600: #d1d5db;
    --gray-700: #e5e7eb;
    --gray-800: #f3f4f6;
    --gray-900: #f9fafb;

    /* === FUNDOS E SUPERFÍCIES === */
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    --surface-primary: #1e293b;
    --surface-secondary: #334155;
    
    /* === TEXTOS === */
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-tertiary: #94a3b8;
    
    /* === BORDAS === */
    --border-primary: #334155;
    --border-secondary: #475569;
    
    /* === SOMBRAS DARK === */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.3);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.4);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.5);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.6);
}

/* Transição suave entre temas */
* {
    transition: background-color 0.3s ease, 
                color 0.3s ease, 
                border-color 0.3s ease,
                box-shadow 0.3s ease;
}

/* ================================================================
   2. SISTEMA DE GRID RESPONSIVO
   ================================================================ */

/* Container responsivo */
.container {
    width: 100%;
    margin: 0 auto;
    padding: 0 1rem;
}

@media (min-width: 640px) {
    .container {
        max-width: 640px;
        padding: 0 1.5rem;
    }
}

@media (min-width: 768px) {
    .container {
        max-width: 768px;
        padding: 0 2rem;
    }
}

@media (min-width: 1024px) {
    .container {
        max-width: 1024px;
    }
}

@media (min-width: 1280px) {
    .container {
        max-width: 1280px;
    }
}

/* Grid System Responsivo */
.grid-responsive {
    display: grid;
    gap: 1.5rem;
    grid-template-columns: 1fr;
}

@media (min-width: 640px) {
    .grid-2-sm { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 768px) {
    .grid-2-md { grid-template-columns: repeat(2, 1fr); }
    .grid-3-md { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 1024px) {
    .grid-2-lg { grid-template-columns: repeat(2, 1fr); }
    .grid-3-lg { grid-template-columns: repeat(3, 1fr); }
    .grid-4-lg { grid-template-columns: repeat(4, 1fr); }
}

/* ================================================================
   3. BREAKPOINTS E MEDIA QUERIES
   ================================================================ */

/* Tipografia Responsiva com clamp() */
h1 {
    font-size: clamp(2rem, 5vw + 1rem, 3.75rem);
}

h2 {
    font-size: clamp(1.5rem, 4vw + 0.5rem, 3rem);
}

h3 {
    font-size: clamp(1.25rem, 3vw + 0.25rem, 2.25rem);
}

h4 {
    font-size: clamp(1.125rem, 2vw + 0.25rem, 1.5rem);
}

p {
    font-size: clamp(0.875rem, 1vw + 0.5rem, 1rem);
}

/* ================================================================
   4. HEADER E NAVEGAÇÃO RESPONSIVA
   ================================================================ */

/* Toggle Dark Mode */
.theme-toggle {
    position: relative;
    width: 50px;
    height: 26px;
    background: var(--gray-300);
    border-radius: 50px;
    padding: 3px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    margin-left: 1rem;
}

.theme-toggle-slider {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    transition: transform 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

.theme-toggle[data-theme="dark"] {
    background: var(--primary-600);
}

.theme-toggle[data-theme="dark"] .theme-toggle-slider {
    transform: translateX(24px);
}

/* Mobile Menu */
@media (max-width: 767px) {
    .navbar {
        padding: 1rem 0;
    }
    
    .navbar-nav {
        position: fixed;
        top: 0;
        left: -100%;
        width: 280px;
        height: 100vh;
        background: var(--bg-primary, white);
        box-shadow: 2px 0 20px rgba(0, 0, 0, 0.1);
        padding: 5rem 2rem 2rem;
        flex-direction: column;
        gap: 1rem;
        transition: left 0.3s ease;
        z-index: 1000;
    }
    
    .navbar-nav.active {
        left: 0;
    }
    
    .navbar-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: 999;
    }
    
    .navbar-overlay.active {
        opacity: 1;
        visibility: visible;
    }
    
    .nav-link {
        font-size: 1.125rem;
        padding: 0.75rem 0;
        width: 100%;
        display: block;
    }
    
    .navbar-toggle {
        display: flex;
        z-index: 1001;
    }
    
    .navbar-cta {
        display: none;
    }
    
    /* Theme toggle in mobile menu */
    .mobile-theme-toggle {
        display: flex;
        align-items: center;
        gap: 1rem;
        margin-top: 2rem;
        padding-top: 2rem;
        border-top: 1px solid var(--border-primary, var(--gray-200));
    }
}

@media (min-width: 768px) {
    .navbar-toggle {
        display: none;
    }
    
    .mobile-theme-toggle {
        display: none;
    }
    
    .navbar-nav {
        position: static;
        width: auto;
        height: auto;
        background: transparent;
        box-shadow: none;
        padding: 0;
        flex-direction: row;
    }
}

/* ================================================================
   5. HERO SECTION RESPONSIVA
   ================================================================ */

@media (max-width: 767px) {
    .hero {
        padding: 6rem 0 3rem;
        min-height: auto;
    }
    
    .hero-content {
        grid-template-columns: 1fr;
        gap: 3rem;
    }
    
    .hero-visual {
        display: none;
    }
    
    .hero-title {
        margin-bottom: 1.5rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
        margin-bottom: 2rem;
    }
    
    .hero-features {
        margin-bottom: 2rem;
    }
    
    .hero-actions {
        flex-direction: column;
        width: 100%;
    }
    
    .hero-actions .btn {
        width: 100%;
    }
    
    /* Desabilitar animações pesadas em mobile */
    .floating-shapes,
    .grid-pattern {
        display: none;
    }
}

@media (min-width: 768px) and (max-width: 1023px) {
    .hero-content {
        gap: 3rem;
    }
    
    .hero-image {
        width: 300px;
        height: 300px;
    }
    
    .tech-item {
        width: 50px;
        height: 50px;
        font-size: 1rem;
    }
    
    .hero-rocket {
        font-size: 3rem;
    }
}

/* ================================================================
   6. SEÇÕES DE CONTEÚDO RESPONSIVAS
   ================================================================ */

/* About Section */
@media (max-width: 767px) {
    .about-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .about-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
        padding: 2rem 1rem;
    }
    
    .stat-number {
        font-size: 2rem;
    }
    
    .mvv-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .mvv-card {
        padding: 1.5rem;
    }
}

/* Services Section */
@media (max-width: 639px) {
    .services-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .service-card {
        padding: 1.5rem;
    }
    
    .service-badge {
        font-size: 0.625rem;
        padding: 0.25rem 0.5rem;
    }
}

@media (min-width: 640px) and (max-width: 1023px) {
    .services-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Differentials Section */
@media (max-width: 767px) {
    .differentials-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .differential-item {
        flex-direction: column;
        text-align: center;
        padding: 1.5rem;
    }
    
    .differential-icon {
        margin: 0 auto 1rem;
    }
}

/* Contact Section */
@media (max-width: 767px) {
    .contact-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .contact-form-wrapper {
        padding: 1.5rem;
    }
    
    .contact-method {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }
}

/* ================================================================
   7. FORMULÁRIOS E COMPONENTES
   ================================================================ */

@media (max-width: 639px) {
    .form-control {
        font-size: 16px; /* Previne zoom no iOS */
    }
    
    .btn {
        padding: 0.75rem 1.5rem;
        font-size: 0.875rem;
    }
    
    .btn-lg {
        padding: 1rem 2rem;
        font-size: 1rem;
    }
}

/* ================================================================
   8. DARK MODE STYLES
   ================================================================ */

[data-theme="dark"] {
    background-color: var(--bg-primary);
    color: var(--text-primary);
}

[data-theme="dark"] .header {
    background: rgba(15, 23, 42, 0.95);
    border-bottom-color: var(--border-primary);
}

[data-theme="dark"] .header.scrolled {
    background: rgba(15, 23, 42, 0.98);
}

[data-theme="dark"] .hero {
    background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
}

[data-theme="dark"] .hero-badge {
    background: var(--surface-primary);
    border-color: var(--border-primary);
    color: var(--primary-400);
}

[data-theme="dark"] .service-card,
[data-theme="dark"] .mvv-card,
[data-theme="dark"] .contact-form-wrapper {
    background: var(--surface-primary);
    border-color: var(--border-primary);
}

[data-theme="dark"] .service-card:hover,
[data-theme="dark"] .mvv-card:hover {
    background: var(--surface-secondary);
    border-color: var(--primary-400);
}

[data-theme="dark"] .differential-item {
    background: var(--surface-primary);
}

[data-theme="dark"] .differential-item:hover {
    background: var(--surface-secondary);
}

[data-theme="dark"] .form-control {
    background: var(--bg-secondary);
    border-color: var(--border-primary);
    color: var(--text-primary);
}

[data-theme="dark"] .form-control:focus {
    border-color: var(--primary-400);
    box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.2);
}

[data-theme="dark"] .footer {
    background: var(--bg-secondary);
}

[data-theme="dark"] .footer-divider {
    background: var(--border-primary);
}

[data-theme="dark"] .newsletter-input {
    background: var(--bg-primary);
    border-color: var(--border-primary);
}

[data-theme="dark"] .social-links a {
    background: var(--surface-primary);
    border-color: var(--primary-400);
    color: var(--primary-400);
}

[data-theme="dark"] .social-links a:hover {
    background: var(--primary-600);
    color: var(--bg-primary);
}

/* Dark mode para elementos específicos */
[data-theme="dark"] h1,
[data-theme="dark"] h2,
[data-theme="dark"] h3,
[data-theme="dark"] h4,
[data-theme="dark"] h5,
[data-theme="dark"] h6 {
    color: var(--text-primary);
}

[data-theme="dark"] p {
    color: var(--text-secondary);
}

[data-theme="dark"] .nav-link {
    color: var(--text-secondary);
}

[data-theme="dark"] .nav-link:hover,
[data-theme="dark"] .nav-link.active {
    color: var(--primary-400);
}

/* ================================================================
   9. UTILITÁRIOS RESPONSIVOS
   ================================================================ */

/* Visibilidade */
@media (max-width: 639px) {
    .sm\:hidden { display: none !important; }
    .sm\:block { display: block !important; }
}

@media (min-width: 640px) {
    .sm\:hidden { display: initial !important; }
    .sm\:block { display: none !important; }
}

@media (max-width: 767px) {
    .md\:hidden { display: none !important; }
    .md\:block { display: block !important; }
}

@media (min-width: 768px) {
    .md\:hidden { display: initial !important; }
    .md\:block { display: none !important; }
}

@media (max-width: 1023px) {
    .lg\:hidden { display: none !important; }
    .lg\:block { display: block !important; }
}

@media (min-width: 1024px) {
    .lg\:hidden { display: initial !important; }
    .lg\:block { display: none !important; }
}

/* Padding e Margin responsivos */
@media (max-width: 639px) {
    .p-mobile { padding: 1rem !important; }
    .py-mobile { padding-top: 1rem !important; padding-bottom: 1rem !important; }
    .px-mobile { padding-left: 1rem !important; padding-right: 1rem !important; }
}

/* ================================================================
   10. AJUSTES ESPECÍFICOS POR DISPOSITIVO
   ================================================================ */

/* Footer Responsivo */
@media (max-width: 767px) {
    .footer-content {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
    }
    
    .footer-brand {
        justify-content: center;
    }
    
    .footer-bottom-content {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .footer-social {
        order: -1;
    }
}

/* Elementos Flutuantes */
@media (max-width: 639px) {
    .whatsapp-float {
        width: 50px;
        height: 50px;
        bottom: 1rem;
        right: 1rem;
        font-size: 1.5rem;
    }
    
    .back-to-top {
        width: 40px;
        height: 40px;
        bottom: 1rem;
        right: 4.5rem;
        font-size: 1rem;
    }
}

/* Ajustes para Tablets em Landscape */
@media (min-width: 768px) and (max-width: 1023px) and (orientation: landscape) {
    .hero {
        min-height: 80vh;
    }
    
    .hero-content {
        gap: 2rem;
    }
    
    .services-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Ajustes para telas muito pequenas */
@media (max-width: 374px) {
    .container {
        padding: 0 0.75rem;
    }
    
    .hero-title {
        font-size: 1.5rem;
    }
    
    .btn {
        padding: 0.625rem 1rem;
        font-size: 0.813rem;
    }
}

/* Ajustes para impressão */
@media print {
    .header,
    .whatsapp-float,
    .back-to-top,
    .theme-toggle,
    .navbar-toggle,
    .hero-background {
        display: none !important;
    }
    
    .hero {
        min-height: auto;
        padding: 2rem 0;
    }
    
    * {
        color: black !important;
        background: white !important;
    }
}

/* Acessibilidade - Respeitar preferências do usuário */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

@media (prefers-contrast: high) {
    :root {
        --primary-600: #1d4ed8;
        --gray-900: #000000;
        --gray-50: #ffffff;
    }
}

/* Suporte para notch (iPhone X+) */
@supports (padding-top: env(safe-area-inset-top)) {
    .header {
        padding-top: env(safe-area-inset-top);
    }
    
    .navbar-nav {
        padding-top: calc(5rem + env(safe-area-inset-top));
    }
}