/*
Theme Name: Mackdata Web
Theme URI: https://mackdata.ai
Author: Insung Lee, Eliyana Van Doren
Description: Custom theme for MackData website
Version: 1.1
*/

/* ======================================
   MACKDATA WEBSITE STYLES
   ====================================== */

/* ===== MOBILE OPTIMIZATION ===== */
/* Prevent horizontal scrolling on mobile */
html, body {
    overflow-x: hidden;
    max-width: 100vw;
}

* {
    box-sizing: border-box;
}

/* Ensure containers don't exceed viewport width */
.container, .max-w-7xl, .max-w-6xl, .max-w-5xl, .max-w-4xl {
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
    padding-left: 1rem;
    padding-right: 1rem;
}

/* Mobile-first responsive grid fixes */
@media (max-width: 640px) {
    /* Force single column on mobile for better readability */
    .grid-cols-2, .grid-cols-3, .grid-cols-4 {
        grid-template-columns: 1fr !important;
    }
    
    /* Revenue forecaster mobile fixes */
    .revenue-forecaster .grid {
        grid-template-columns: 1fr !important;
        gap: 0.75rem;
    }
    
    /* Text size adjustments for mobile */
    .text-7xl {
        font-size: 3rem !important;
        line-height: 1.1;
    }
    
    .text-6xl {
        font-size: 2.5rem !important;
        line-height: 1.1;
    }
    
    .text-5xl {
        font-size: 2rem !important;
        line-height: 1.2;
    }
    
    .text-4xl {
        font-size: 1.75rem !important;
        line-height: 1.2;
    }
    
    .text-3xl {
        font-size: 1.5rem !important;
        line-height: 1.3;
    }
    
    .text-2xl {
        font-size: 1.25rem !important;
        line-height: 1.3;
    }
    
    /* Padding adjustments for mobile */
    .py-24 {
        padding-top: 3rem !important;
        padding-bottom: 3rem !important;
    }
    
    .py-32 {
        padding-top: 4rem !important;
        padding-bottom: 4rem !important;
    }
    
    .py-16 {
        padding-top: 2rem !important;
        padding-bottom: 2rem !important;
    }
    
    .px-8 {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }
    
    .p-8 {
        padding: 1rem !important;
    }
    
    .p-6 {
        padding: 0.75rem !important;
    }
    
    /* Button adjustments */
    .py-4 {
        padding-top: 0.75rem !important;
        padding-bottom: 0.75rem !important;
    }
    
    /* Ensure images don't overflow */
    img {
        max-width: 100%;
        height: auto;
    }
    
    /* Container width fixes */
    .max-w-7xl, .max-w-6xl, .max-w-5xl, .max-w-4xl, .max-w-3xl {
        max-width: calc(100vw - 2rem) !important;
    }
    
    /* Hero gradient responsive */
    .hero-gradient {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }
    
    /* Flexbox adjustments */
    .flex-col.sm\:flex-row {
        flex-direction: column !important;
    }
    
    /* Gap adjustments */
    .gap-8 {
        gap: 1rem !important;
    }
    
    .gap-12 {
        gap: 1.5rem !important;
    }
}

/* Additional mobile fixes for specific components */
@media (max-width: 480px) {
    /* Extra small screens */
    .text-4xl {
        font-size: 1.5rem !important;
    }
    
    .text-3xl {
        font-size: 1.25rem !important;
    }
    
    /* Reduce spacing on very small screens */
    .py-16 {
        padding-top: 1.5rem !important;
        padding-bottom: 1.5rem !important;
    }
    
    .mb-8 {
        margin-bottom: 1rem !important;
    }
    
    .mb-6 {
        margin-bottom: 0.75rem !important;
    }
}

/* ===== LAYOUT & SECTIONS ===== */
/* Alternating section backgrounds */
.section-grey {
    background-color: #f3f4f6;
}

/* ===== HERO & GRADIENTS ===== */
.hero-gradient {
    background: linear-gradient(135deg, #1e3a8a 0%, #4c6ef5 50%, #5c7cfa 100%);
}

.promise-strip {
    background: repeating-linear-gradient(
        45deg,
        #1e40af,
        #1e40af 10px,
        #1e3a8a 10px,
        #1e3a8a 20px
    );
}

/* ===== CARD HOVER EFFECTS ===== */
/* Pop-up hover effect for KPI cards */
.fade-in-card, .kpi-shuffle-card, .bg-white.rounded-lg.shadow.p-8.flex.flex-col.items-center.text-center.hover\:scale-105.transition-transform.border.border-gray-200 {
  transition: transform 0.25s cubic-bezier(0.4,0,0.2,1), box-shadow 0.25s cubic-bezier(0.4,0,0.2,1);
}

.fade-in-card:hover, .kpi-shuffle-card:hover, .bg-white.rounded-lg.shadow.p-8.flex.flex-col.items-center.text-center.hover\:scale-105.transition-transform.border.border-gray-200:hover {
  transform: scale(1.07) translateY(-8px);
  box-shadow: 0 16px 32px 0 rgba(30, 58, 138, 0.12), 0 4px 8px 0 rgba(30, 58, 138, 0.08);
  z-index: 2;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.industry-card:hover .industry-icon {
    transform: scale(1.1);
}

/* ===== ANIMATIONS ===== */
.chatbot-bubble {
    animation: float 3s ease-in-out infinite;
}

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

/* Typing Animation Styles */
.typing-container {
    position: relative;
    min-height: 1.2em; /* Prevent layout shift */
}

.typing-text {
    display: inline-block;
    opacity: 0; /* Initially hidden until animation starts */
}

.typing-text.typing-active {
    opacity: 1; /* Show when typing starts */
}

/* Cursor that follows the text */
.typing-cursor {
    display: inline-block;
    width: 3px;
    height: 1em;
    background-color: #ffffff;
    margin-left: 2px;
    animation: blink-cursor 0.8s infinite;
    vertical-align: baseline;
}

/* Desktop typing - allow wrapping */
@media (min-width: 768px) {
    .typing-text {
        white-space: normal;
        overflow: visible;
        max-width: 100%;
        word-wrap: break-word;
    }
    
    .typing-cursor {
        width: 3px;
    }
}

/* Mobile typing - allow wrapping */
@media (max-width: 767px) {
    .typing-text {
        white-space: normal;
        overflow: visible;
        word-wrap: break-word;
        hyphens: auto;
    }
    
    .typing-cursor {
        width: 2px;
    }
    
    .typing-container {
        min-height: 3em; /* Provide space for wrapped text */
    }
    
    /* Adjust hero section padding on mobile */
    .hero-gradient {
        padding-top: 2rem;
        padding-bottom: 2rem;
    }
    
    .hero-gradient .max-w-7xl {
        padding-top: 1rem;
        padding-bottom: 1rem;
    }
}

/* Additional mobile hero section adjustments */
@media (max-width: 640px) {
    .hero-gradient {
        padding-top: 1.5rem;
        padding-bottom: 1.5rem;
    }
    
    .hero-gradient .max-w-7xl {
        padding-top: 1rem;
        padding-bottom: 1rem;
    }
    
    .typing-container {
        min-height: 4em; /* More space for longer text wrapping */
        margin-bottom: 1rem;
    }
    
    /* Ensure subtitle has proper spacing */
    .subtitle-fade {
        margin-top: 1rem;
        font-size: 1.125rem; /* Slightly smaller on mobile */
        line-height: 1.5;
    }
    
    /* Adjust button spacing */
    .button-fade {
        margin-top: 1.5rem;
    }
}

@media (max-width: 480px) {
    .typing-container {
        min-height: 5em; /* Even more space for very narrow screens */
    }
    
    .subtitle-fade {
        font-size: 1rem;
        line-height: 1.4;
    }
}

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

/* Hide cursor after animation completes */
.typing-complete .typing-cursor {
    display: none;
}

/* Subtitle and button initial state */
.subtitle-fade,
.button-fade {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

/* Loading Animation Styles */
#loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 50%, #3b82f6 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 1;
    transition: opacity 0.8s ease-out;
}

#loading-overlay.fade-out {
    opacity: 0;
}

.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: white;
    position: relative;
    padding: 2rem;
}

.loading-logo-animation {
    margin-bottom: 1.5rem;
}

/* Logo fade-in animation */
.loading-logo {
    width: auto;
    height: 80px;
    opacity: 0;
    animation: logoFadeIn 1.2s ease-out 0.3s forwards;
    filter: brightness(1) contrast(1);
}

@keyframes logoFadeIn {
    0% { 
        opacity: 0; 
        transform: translateY(10px) scale(0.95); 
    }
    100% { 
        opacity: 1; 
        transform: translateY(0) scale(1); 
    }
}

/* Loading subtitle */
.loading-subtitle {
    font-size: 1.3rem;
    font-weight: 400;
    opacity: 0;
    color: rgba(255, 255, 255, 0.9);
    animation: subtitleFadeIn 0.8s ease-out 0.8s forwards;
    margin-bottom: 0;
    text-align: center;
}

@keyframes subtitleFadeIn {
    0% {
        opacity: 0;
        transform: translateY(10px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Smooth scrolling for entire page */
html {
    scroll-behavior: smooth;
}

/* Mobile loading adjustments */
@media (max-width: 768px) {
    .loading-logo {
        height: 60px;
    }
    
    .loading-subtitle {
        font-size: 1.1rem;
        padding: 0 1rem;
    }
    
    .loading-container {
        padding: 1rem;
    }
}

@media (max-width: 480px) {
    .loading-logo {
        height: 50px;
    }
    
    .loading-subtitle {
        font-size: 1rem;
        padding: 0 1rem;
    }
}

@media (max-width: 360px) {
    .loading-logo {
        height: 40px;
    }
    
    .loading-subtitle {
        font-size: 0.9rem;
        padding: 0 0.5rem;
    }
}

/* Floating hover effect for Why Mackdata cards */
.mack-card {
    transition: all 0.3s ease;
    transform: translateY(0);
}

.mack-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.mack-card:hover .mack-card-icon {
    transform: scale(1.1);
}

.mack-card-icon {
    transition: transform 0.3s ease;
}

/* Hide page content initially until loading completes */
.page-content {
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.1s ease, visibility 0.1s ease;
}

.page-content.show {
    opacity: 1;
    visibility: visible;
}

/* Infinite Logo Stream Styles - Optimized for smooth performance */
.logo-stream {
    width: 100%;
    overflow: hidden;
    white-space: nowrap;
    position: relative;
    mask-image: linear-gradient(90deg, 
        transparent 0%, 
        black 10%, 
        black 90%, 
        transparent 100%);
    -webkit-mask-image: linear-gradient(90deg, 
        transparent 0%, 
        black 10%, 
        black 90%, 
        transparent 100%);
}

.logo-track {
    display: inline-flex;
    align-items: center;
    animation: scroll-logos 40s linear infinite;
    will-change: transform;
    transform: translateZ(0); /* Force hardware acceleration */
    backface-visibility: hidden; /* Prevent flicker */
}

.logo-item {
    flex-shrink: 0;
    margin: 0 4rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
    transform: translateZ(0); /* Force hardware acceleration */
}

.logo-item img {
    transition: all 0.3s ease;
    transform: translateZ(0); /* Force hardware acceleration */
}

/* Logo-specific sizing for consistent text readability */
.logo-item img[src*="ServiceTitan"] {
    height: 10rem; /* 64px - even larger for better text readability */
}

.logo-item img[src*="salesforce transparent"] {
    height: 3.5rem; /* 56px - much larger for better text readability */
    background: transparent !important; /* Remove any background */
    background-color: transparent !important; /* Force transparent background */
}

.logo-item img[src*="Successware"] {
    height: 2.5rem; /* 40px - larger for better text readability */
}

.logo-item img[src*="storis"] {
    height: 2rem; /* 32px - keep original size */
}

.logo-item img[src*="callrail"] {
    height: 2rem; /* 32px - keep original size */
}

.logo-item img[src*="callsource"] {
    height: 2.5rem; /* 40px - larger for better text readability */
}

.logo-item img[src*="CallTrackingMetrics"] {
    height: 2.5rem; /* 40px - larger for better text readability */
}

.logo-stream:hover .logo-item img {
    filter: grayscale(100%);
    opacity: 0.5;
}

.logo-stream:hover .logo-item:hover img {
    filter: grayscale(0%);
    opacity: 1;
    transform: scale(1.1) translateZ(0);
}

.logo-item:hover {
    transform: scale(1.05) translateZ(0);
}

.logo-track:hover {
    animation-play-state: paused;
}

@keyframes scroll-logos {
    0% {
        transform: translateX(0) translateZ(0);
    }
    100% {
        transform: translateX(-50%) translateZ(0);
    }
}

/* Responsive logo sizes */
@media (max-width: 768px) {
    .logo-item {
        margin: 0 2rem;
    }
    
    .logo-item img {
        height: 1.75rem; /* h-7 equivalent */
    }
}

@media (max-width: 480px) {
    .logo-item {
        margin: 0 1.5rem;
    }
    
    .logo-item img {
        height: 1.5rem; /* h-6 equivalent */
    }
}

/* Features Page Styles */
html {
    scroll-behavior: smooth;
}

.feature-nav-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid transparent;
}

.feature-nav-card:hover {
    border-color: #3b82f6;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.feature-nav-card:focus {
    outline: none;
    box-shadow: 0 0 0 2px #3b82f6, 0 0 0 4px rgba(59, 130, 246, 0.1);
}

/* Section padding for proper anchor positioning */
#ai-chatbot,
#revenue-forecasting,
#roas-analysis,
#reach-frequency,
#competitor-insights,
#data-integration {
    scroll-margin-top: 100px; /* Account for sticky nav */
}

/* Progress bars animation */
.bg-green-500,
.bg-blue-500,
.bg-purple-500 {
    transition: width 1s ease-in-out;
}

/* Dashboard card animations */
.bg-white.p-4.rounded-lg.shadow-sm {
    transition: transform 0.2s ease-in-out;
}

.bg-white.p-4.rounded-lg.shadow-sm:hover {
    transform: translateY(-2px);
}

/* Enhanced scroll animations */
.scroll-slide-left {
    opacity: 0;
    transform: translateX(-50px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.scroll-slide-right {
    opacity: 0;
    transform: translateX(50px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.scroll-fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.scroll-scale-up {
    opacity: 0;
    transform: scale(0.9);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

/* Animation delays for staggered effects */
.delay-1 { transition-delay: 0.1s; }
.delay-2 { transition-delay: 0.2s; }
.delay-3 { transition-delay: 0.3s; }
.delay-4 { transition-delay: 0.4s; }
.delay-5 { transition-delay: 0.5s; }
.delay-6 { transition-delay: 0.6s; }

/* When elements are in view - unified for both .visible and .in-view */
.scroll-slide-left.visible,
.scroll-slide-left.in-view,
.scroll-slide-right.visible,
.scroll-slide-right.in-view,
.scroll-fade-in.visible,
.scroll-fade-in.in-view,
.scroll-scale-up.visible,
.scroll-scale-up.in-view {
    opacity: 1;
    transform: translateX(0) translateY(0) scale(1);
}

/* Responsive adjustments for features page */
@media (max-width: 768px) {
    .feature-nav-card {
        transform: none !important;
    }
    
    .feature-nav-card:hover {
        transform: translateY(-2px) !important;
    }
    
    #ai-chatbot,
    #revenue-forecasting,
    #roas-analysis,
    #reach-frequency,
    #competitor-insights,
    #data-integration {
        scroll-margin-top: 80px;
    }
}


/* ===== PRICING PAGE EFFECTS ===== */
/* Subtle fade-in animation for pricing table */
.pricing-table {
    animation: fadeInUp 0.8s ease-out;
}

.pricing-mobile-cards {
    animation: fadeInUp 0.8s ease-out 0.2s both;
}

/* Elegant hover effects for table rows */
.pricing-table tbody tr {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.pricing-table tbody tr:hover {
    background-color: rgba(59, 130, 246, 0.03);
    transform: translateX(4px);
    box-shadow: 4px 0 0 rgba(59, 130, 246, 0.3);
}

/* Subtle shimmer effect on pricing amounts */
.pricing-amount {
    position: relative;
    overflow: hidden;
}

.pricing-amount::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 2s ease-in-out;
}

.pricing-amount:hover::before {
    left: 100%;
}

/* Mobile card hover effects */
.pricing-mobile-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.pricing-mobile-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Subtle pulse effect for contact button */
.contact-button {
    animation: subtle-pulse 4s ease-in-out infinite;
}

/* Title typing effect */
.pricing-title {
    animation: fadeInScale 1s ease-out;
}

/* Keyframe animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes subtle-pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.4);
    }
    50% {
        box-shadow: 0 0 0 6px rgba(59, 130, 246, 0);
    }
}

/* Gradient text effect for pricing header */
.pricing-gradient-text {
    background: linear-gradient(135deg, #1f2937, #3b82f6, #1f2937);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gradient-shift 6s ease-in-out infinite;
}

@keyframes gradient-shift {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

/* Smooth scroll behavior */
html {
    scroll-behavior: smooth;
}

/* Loading state animation for table cells */
.table-cell-fade {
    animation: cellFadeIn 0.6s ease-out both;
}

.table-cell-fade:nth-child(1) { animation-delay: 0.1s; }
.table-cell-fade:nth-child(2) { animation-delay: 0.2s; }
.table-cell-fade:nth-child(3) { animation-delay: 0.3s; }
.table-cell-fade:nth-child(4) { animation-delay: 0.4s; }
.table-cell-fade:nth-child(5) { animation-delay: 0.5s; }
.table-cell-fade:nth-child(6) { animation-delay: 0.6s; }

@keyframes cellFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}