/*
Theme Name: Codiche Digital Marketing
Description: Premium dark theme for Codiche Digital Marketing Services
Version: 3.6 - OPTIMIZED
Text Domain: codiche /leo
*/

/* ===== REMOVED DUPLICATE IMPORTS ===== */
/* ❌ REMOVED: Tailwind import - Already loaded via CDN in header.php */
/* ❌ REMOVED: Font Awesome import - Already loaded via functions.php */

/* ===== OPTIMIZED BASE STYLES ===== */
* {
    transition: color 0.3s ease, background-color 0.3s ease, transform 0.3s ease;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: linear-gradient(135deg, #0F172A 0%, #1E293B 50%, #0F172A 100%);
    background-attachment: fixed;
    overflow-x: hidden;
}

/* ===== OPTIMIZED ANIMATIONS ===== */
@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-15px); }
}

@keyframes float-slow {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-8px); }
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

/* ===== OPTIMIZED MOBILE MENU ===== */
#mobile-menu {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.98), rgba(30, 41, 59, 0.98));
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    z-index: 9999;
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

#mobile-menu.active {
    display: flex;
    opacity: 1;
    visibility: visible;
}

/* Hide on desktop - REMOVED !important */
@media (min-width: 769px) {
    #mobile-menu {
        display: none;
    }
    
    #mobileMenuToggle {
        display: none;
    }
}

/* Show on mobile - REMOVED !important */
@media (max-width: 768px) {
    #mobileMenuToggle {
        display: flex;
    }
}

/* Body scroll prevention */
body.menu-open {
    overflow: hidden;
}

/* ===== OPTIMIZED FLOATING BUTTONS ===== */
#backToTop {
    position: fixed;
    bottom: 100px;
    right: 30px;
    width: 60px;
    height: 60px;
    z-index: 999;
    display: none;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.9), rgba(124, 58, 237, 0.9));
    border: 2px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 20px 60px rgba(139, 92, 246, 0.4);
    color: white;
    font-size: 20px;
    animation: float-slow 4s ease-in-out infinite;
    transition: all 0.4s ease;
    cursor: pointer;
}

#backToTop:hover {
    transform: scale(1.1);
}

.whatsapp-btn {
    position: fixed;
    bottom: 30px;
    left: 30px;
    width: 60px;
    height: 60px;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    background: linear-gradient(135deg, #25D366, #128C7E);
    border: 2px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 20px 60px rgba(37, 211, 102, 0.4);
    color: white;
    font-size: 24px;
    text-decoration: none;
    animation: float 3s ease-in-out infinite;
    transition: all 0.4s ease;
}

.whatsapp-btn:hover {
    transform: scale(1.1);
}

/* ===== OPTIMIZED TYPEWRITER ===== */
.typewriter-container {
    min-height: 120px;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.typewriter-text {
    display: inline-block;
    position: relative;
    background: linear-gradient(135deg, #ffffff 0%, #e2e8f0 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.2;
}

#stable-typewriter {
    position: relative;
    display: inline-block;
    min-width: 300px;
    text-align: left;
}

#stable-typewriter::after {
    content: '|';
    position: absolute;
    right: -8px;
    top: 50%;
    transform: translateY(-50%);
    color: #3B82F6;
    font-weight: 300;
    animation: blink 1s infinite;
}

/* ===== OPTIMIZED CARD EFFECTS ===== */
.service-card, .portfolio-card {
    background: linear-gradient(145deg, #1E293B, #0F172A);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.service-card::before, .portfolio-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(59, 130, 246, 0.1), transparent);
    transition: left 0.6s ease;
}

.service-card:hover::before, .portfolio-card:hover::before {
    left: 100%;
}

.service-card:hover, .portfolio-card:hover {
    transform: translateY(-10px) scale(1.02);
    border-color: #3B82F6;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
}

/* ===== OPTIMIZED GLASS EFFECT ===== */
.glass-effect {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== OPTIMIZED RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
    #backToTop {
        bottom: 25px;
        right: 25px;
        width: 55px;
        height: 55px;
        font-size: 18px;
    }
    
    .whatsapp-btn {
        bottom: 25px;
        left: 25px;
        width: 55px;
        height: 55px;
        font-size: 22px;
    }
    
    .typewriter-container {
        min-height: 100px;
    }
    
    #stable-typewriter {
        min-width: 250px;
    }
}

@media (max-width: 480px) {
    #backToTop {
        bottom: 20px;
        right: 20px;
        width: 50px;
        height: 50px;
        font-size: 16px;
    }
    
    .whatsapp-btn {
        bottom: 20px;
        left: 20px;
        width: 50px;
        height: 50px;
        font-size: 20px;
    }
    
    .typewriter-container {
        min-height: 80px;
    }
    
    #stable-typewriter {
        min-width: 200px;
    }
}

/* ===== OPTIMIZED CUSTOM SCROLLBAR ===== */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #0F172A;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #3B82F6, #2563EB, #1E40AF);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #2563EB, #1E40AF);
}

/* ===== PERFORMANCE OPTIMIZATIONS ===== */
/* Reduce repaints and improve performance */
.service-card, .portfolio-card, .glass-effect {
    will-change: transform;
    transform: translateZ(0);
}

/* Optimize animations for mobile */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ===== ACCESSIBILITY IMPROVEMENTS ===== */
@media (max-width: 768px) {
    /* Ensure tap targets are large enough */
    .whatsapp-btn, #backToTop {
        min-width: 44px;
        min-height: 44px;
    }
}

/* Focus styles for keyboard navigation */
a:focus, button:focus {
    outline: 2px solid #3B82F6;
    outline-offset: 2px;
}

/* ===== PRINT STYLES ===== */
@media print {
    .whatsapp-btn, #backToTop, #mobile-menu {
        display: none !important;
    }
}
/* ===== CRITICAL FIXES ===== */
/* Fix white text on white background */
.hero-bg {
    background: linear-gradient(135deg, #1e3a8a 0%, #3730a3 100%) !important;
}

.hero-content h1,
.hero-content p {
    color: white !important;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

/* Ensure all hero text is visible */
.hero-bg * {
    color: white !important;
}

/* Fix navigation */
.main-nav {
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(10px);
}

.main-nav a {
    color: #1f2937 !important;
    font-weight: 600;
}