/* ==========================================
   MIMIC DIGITAL SOLUTIONS - STYLES
   ========================================== */

/* CSS Variables */
:root {
    --wa-green: #25D366;
    --wa-dark: #075E54;
    --wa-light: #DCF8C6;
    --wa-bg: #0B141A;
    --wa-chat: #111B21;
    --wa-input: #1F2C34;
    --wa-border: #2A373F;
    --mimic-red: #FF3131;
    --wa-outgoing: #005C4B;
    --wa-incoming: #202C33;
    --wa-teal: #00A884;
}

/* Base Styles */
* {
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--wa-bg);
    min-height: 100vh;
}

/* WhatsApp Doodle Background Pattern */
.chat-pattern {
    background-color: #0B141A;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200' viewBox='0 0 200 200'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M20 20h10v10H20zM50 10h5v5h-5zM80 30h8v8h-8zM120 15h6v6h-6zM160 25h10v10h-10zM30 60h6v6h-6zM70 50h10v10H70zM110 70h5v5h-5zM150 55h8v8h-8zM180 65h6v6h-6zM15 100h8v8h-8zM55 90h6v6h-6zM95 110h10v10H95zM135 95h5v5h-5zM175 105h8v8h-8zM40 140h10v10H40zM80 130h6v6h-6zM120 150h8v8h-8zM160 135h5v5h-5zM25 180h6v6h-6zM65 170h10v10H65zM105 185h5v5h-5zM145 175h8v8h-8zM185 190h6v6h-6z'/%3E%3Ccircle cx='35' cy='35' r='3'/%3E%3Ccircle cx='85' cy='85' r='2'/%3E%3Ccircle cx='135' cy='45' r='2.5'/%3E%3Ccircle cx='45' cy='135' r='2'/%3E%3Ccircle cx='175' cy='145' r='3'/%3E%3Cpath d='M60 20l5 8-5 8-5-8zM140 80l4 6-4 6-4-6zM30 110l6 10-6 10-6-10zM170 30l5 8-5 8-5-8zM100 160l4 6-4 6-4-6z'/%3E%3C/g%3E%3C/svg%3E");
}

/* Message Bubbles - WhatsApp Style */
.message-in {
    background-color: var(--wa-incoming);
    border-radius: 0 8px 8px 8px;
    position: relative;
}

.message-in::before {
    content: '';
    position: absolute;
    left: -8px;
    top: 0;
    width: 0;
    height: 0;
    border-top: 0px solid transparent;
    border-bottom: 13px solid transparent;
    border-right: 8px solid var(--wa-incoming);
}

.message-out {
    background-color: var(--wa-outgoing);
    border-radius: 8px 0 8px 8px;
    position: relative;
}

.message-out::before {
    content: '';
    position: absolute;
    right: -8px;
    top: 0;
    width: 0;
    height: 0;
    border-top: 0px solid transparent;
    border-bottom: 13px solid transparent;
    border-left: 8px solid var(--wa-outgoing);
}

/* Message time styling */
.message-time {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.6);
    display: inline-flex;
    align-items: center;
    gap: 4px;
    float: right;
    margin-left: 10px;
    margin-top: 5px;
}

.message-time-dark {
    color: rgba(0, 0, 0, 0.45);
}

/* Double check marks */
.checkmarks {
    color: #53BDEB;
}

/* ==========================================
   ANIMATIONS
   ========================================== */

/* Typing Indicator */
.typing-indicator span {
    animation: typing 1.4s infinite ease-in-out;
    background-color: #8696A0;
}

.typing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
    }
    30% {
        transform: translateY(-4px);
    }
}

/* Fade In */
.fade-in {
    animation: fadeIn 0.3s ease-out forwards;
    opacity: 0;
    will-change: opacity;
    transform: translate3d(0, 0, 0);
}

@keyframes fadeIn {
    to {
        opacity: 1;
    }
}

/* Slide Up */
.slide-up {
    animation: slideUp 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
    opacity: 0;
    transform: translate3d(0, 20px, 0);
    will-change: transform, opacity;
}

@keyframes slideUp {
    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

/* Pulse Glow */
.pulse-glow {
    animation: pulseGlow 2s infinite;
}

@keyframes pulseGlow {
    0%, 100% {
        box-shadow: 0 0 5px rgba(37, 211, 102, 0.5);
    }
    50% {
        box-shadow: 0 0 20px rgba(37, 211, 102, 0.8);
    }
}

/* Float */
.float {
    animation: float 3s ease-in-out infinite;
}

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

/* ==========================================
   SCROLLBAR - WhatsApp Style
   ========================================== */

.scroll-hidden {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.scroll-hidden::-webkit-scrollbar {
    display: none;
}

/* Thin scrollbar for chat */
.chat-scroll::-webkit-scrollbar {
    width: 6px;
}

.chat-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.chat-scroll::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

/* ==========================================
   SERVICE CARDS
   ========================================== */

.service-icon {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
}

.service-card:hover .service-icon {
    transform: scale(1.1) rotate(5deg) translate3d(0, 0, 0);
}

/* ==========================================
   GLITCH EFFECT
   ========================================== */

.glitch {
    position: relative;
}

.glitch::before,
.glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.glitch::before {
    animation: glitch-1 0.3s infinite linear alternate-reverse;
    color: var(--mimic-red);
    z-index: -1;
}

.glitch::after {
    animation: glitch-2 0.3s infinite linear alternate-reverse;
    color: var(--wa-green);
    z-index: -2;
}

@keyframes glitch-1 {
    0% {
        clip-path: inset(20% 0 60% 0);
        transform: translate(-2px, 2px);
    }
    100% {
        clip-path: inset(50% 0 30% 0);
        transform: translate(2px, -2px);
    }
}

@keyframes glitch-2 {
    0% {
        clip-path: inset(60% 0 20% 0);
        transform: translate(2px, -2px);
    }
    100% {
        clip-path: inset(30% 0 50% 0);
        transform: translate(-2px, 2px);
    }
}

/* ==========================================
   NEON BORDER
   ========================================== */

.neon-border {
    box-shadow: 0 0 5px var(--wa-green), 
                0 0 10px var(--wa-green), 
                inset 0 0 5px rgba(37, 211, 102, 0.1);
}

/* ==========================================
   WHATSAPP INPUT BAR
   ========================================== */

.wa-input-bar {
    background-color: var(--wa-chat);
}

.wa-input-field {
    background-color: var(--wa-input);
    border-radius: 8px;
}

.wa-icon-btn {
    color: #8696A0;
    transition: color 0.2s;
}

.wa-icon-btn:hover {
    color: #AEBAC1;
}

/* ==========================================
   RESPONSIVE ADJUSTMENTS
   ========================================== */

@media (max-width: 1024px) {
    .message-in,
    .message-out {
        max-width: 85%;
    }
}

@media (max-width: 640px) {
    .message-in,
    .message-out {
        max-width: 90%;
    }
    
    /* Smaller padding on mobile */
    .px-4 {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }
    
    /* Smaller text sizes for stats */
    .text-3xl {
        font-size: 1.5rem;
    }
}

/* Prevent body scroll when menu is open */
body.menu-open {
    overflow: hidden;
}

/* Mobile menu animations */
#mobile-menu {
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.5);
    will-change: transform;
    -webkit-overflow-scrolling: touch;
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Hardware acceleration for mobile menu overlay */
#mobile-menu-overlay {
    will-change: opacity;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    transition: opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Safe area padding for notched phones */
@supports (padding-top: env(safe-area-inset-top)) {
    .lg\\:hidden.fixed.top-0 {
        padding-top: env(safe-area-inset-top);
    }
    
    .sticky.bottom-0 {
        padding-bottom: env(safe-area-inset-bottom);
    }
}

/* Touch-friendly targets */
@media (hover: none) and (pointer: coarse) {
    a, button {
        min-height: 44px;
        min-width: 44px;
    }

    /* Faster transitions on mobile */
    * {
        -webkit-tap-highlight-color: transparent;
        -webkit-touch-callout: none;
    }

    /* Optimize mobile menu for touch */
    #mobile-menu {
        transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
    }

    #mobile-menu-overlay {
        transition: opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
    }

    /* Faster, smoother animations on mobile */
    .slide-up {
        animation-duration: 0.35s !important;
    }

    .fade-in {
        animation-duration: 0.25s !important;
    }

    /* Optimize button interactions */
    button, a {
        transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    }

    /* Touch feedback for service cards */
    .service-card:active .service-icon {
        transform: scale(1.05) rotate(3deg) translate3d(0, 0, 0);
        transition: transform 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    }

    /* Smooth scrolling on mobile */
    html {
        scroll-behavior: smooth;
        -webkit-overflow-scrolling: touch;
    }
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ==========================================
   ANIMATIONS
   ========================================== */

/* Typing Indicator */
.typing-indicator span {
    animation: typing 1.4s infinite ease-in-out;
}

.typing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
    }
    30% {
        transform: translateY(-4px);
    }
}

/* Fade In */
.fade-in {
    animation: fadeIn 0.3s ease-out forwards;
    opacity: 0;
    will-change: opacity;
    transform: translate3d(0, 0, 0);
}

@keyframes fadeIn {
    to {
        opacity: 1;
    }
}

/* Slide Up */
.slide-up {
    animation: slideUp 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
    opacity: 0;
    transform: translate3d(0, 20px, 0);
    will-change: transform, opacity;
}

@keyframes slideUp {
    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

/* Pulse Glow */
.pulse-glow {
    animation: pulseGlow 2s infinite;
}

@keyframes pulseGlow {
    0%, 100% {
        box-shadow: 0 0 5px rgba(37, 211, 102, 0.5);
    }
    50% {
        box-shadow: 0 0 20px rgba(37, 211, 102, 0.8);
    }
}

/* Float */
.float {
    animation: float 3s ease-in-out infinite;
}

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

/* ==========================================
   SCROLLBAR
   ========================================== */

.scroll-hidden {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.scroll-hidden::-webkit-scrollbar {
    display: none;
}

/* ==========================================
   SERVICE CARDS
   ========================================== */

.service-icon {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
}

.service-card:hover .service-icon {
    transform: scale(1.1) rotate(5deg) translate3d(0, 0, 0);
}

/* ==========================================
   GLITCH EFFECT
   ========================================== */

.glitch {
    position: relative;
}

.glitch::before,
.glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.glitch::before {
    animation: glitch-1 0.3s infinite linear alternate-reverse;
    color: var(--mimic-red);
    z-index: -1;
}

.glitch::after {
    animation: glitch-2 0.3s infinite linear alternate-reverse;
    color: var(--wa-green);
    z-index: -2;
}

@keyframes glitch-1 {
    0% {
        clip-path: inset(20% 0 60% 0);
        transform: translate(-2px, 2px);
    }
    100% {
        clip-path: inset(50% 0 30% 0);
        transform: translate(2px, -2px);
    }
}

@keyframes glitch-2 {
    0% {
        clip-path: inset(60% 0 20% 0);
        transform: translate(2px, -2px);
    }
    100% {
        clip-path: inset(30% 0 50% 0);
        transform: translate(-2px, 2px);
    }
}

/* ==========================================
   NEON BORDER
   ========================================== */

.neon-border {
    box-shadow: 0 0 5px var(--wa-green), 
                0 0 10px var(--wa-green), 
                inset 0 0 5px rgba(37, 211, 102, 0.1);
}

/* ==========================================
   CUSTOM UTILITIES
   ========================================== */

/* Background Colors */
.bg-wa-bg { background-color: var(--wa-bg); }
.bg-wa-chat { background-color: var(--wa-chat); }
.bg-wa-input { background-color: var(--wa-input); }
.bg-wa-green { background-color: var(--wa-green); }
.bg-wa-dark { background-color: var(--wa-dark); }
.bg-wa-light { background-color: var(--wa-light); }
.bg-mimic-red { background-color: var(--mimic-red); }

/* Text Colors */
.text-wa-green { color: var(--wa-green); }
.text-wa-dark { color: var(--wa-dark); }
.text-mimic-red { color: var(--mimic-red); }

/* Border Colors */
.border-wa-border { border-color: var(--wa-border); }
.border-wa-green { border-color: var(--wa-green); }
.border-mimic-red { border-color: var(--mimic-red); }

/* Hover States */
.hover\:bg-wa-dark:hover { background-color: var(--wa-dark); }
.hover\:bg-wa-input:hover { background-color: var(--wa-input); }
.hover\:text-wa-green:hover { color: var(--wa-green); }

/* Gradient Backgrounds */
.bg-gradient-wa {
    background: linear-gradient(to right, var(--wa-dark), var(--wa-green));
}

/* ==========================================
   RESPONSIVE ADJUSTMENTS
   ========================================== */

@media (max-width: 1024px) {
    .message-in,
    .message-out {
        max-width: 85%;
    }
}

@media (max-width: 640px) {
    .message-in,
    .message-out {
        max-width: 95%;
    }
    
    /* Smaller padding on mobile */
    .px-4 {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }
    
    /* Smaller text sizes for stats */
    .text-3xl {
        font-size: 1.5rem;
    }
}

/* Prevent body scroll when menu is open */
body.menu-open {
    overflow: hidden;
}

/* Mobile menu animations */
#mobile-menu {
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.5);
    will-change: transform;
    -webkit-overflow-scrolling: touch;
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Hardware acceleration for mobile menu overlay */
#mobile-menu-overlay {
    will-change: opacity;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    transition: opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Safe area padding for notched phones */
@supports (padding-top: env(safe-area-inset-top)) {
    .lg\\:hidden.fixed.top-0 {
        padding-top: env(safe-area-inset-top);
    }
    
    .sticky.bottom-0 {
        padding-bottom: env(safe-area-inset-bottom);
    }
}

/* Touch-friendly targets */
@media (hover: none) and (pointer: coarse) {
    a, button {
        min-height: 44px;
        min-width: 44px;
    }

    /* Faster transitions on mobile */
    * {
        -webkit-tap-highlight-color: transparent;
        -webkit-touch-callout: none;
    }

    /* Optimize mobile menu for touch */
    #mobile-menu {
        transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
    }

    #mobile-menu-overlay {
        transition: opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
    }

    /* Faster, smoother animations on mobile */
    .slide-up {
        animation-duration: 0.35s !important;
    }

    .fade-in {
        animation-duration: 0.25s !important;
    }

    /* Optimize button interactions */
    button, a {
        transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    }

    /* Touch feedback for service cards */
    .service-card:active .service-icon {
        transform: scale(1.05) rotate(3deg) translate3d(0, 0, 0);
        transition: transform 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    }

    /* Smooth scrolling on mobile */
    html {
        scroll-behavior: smooth;
        -webkit-overflow-scrolling: touch;
    }
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
