/* ========================================
   DoublesBoss Landing Page - Custom Styles
   ======================================== */

/* CSS Variables */
:root {
    --navy-900: #0A1628;
    --navy-800: #111D35;
    --navy-700: #192A4A;
    --navy-600: #1E3A5F;
    --electric-blue: #3B82F6;
    --neon-cyan: #06B6D4;
    --neon-purple: #8B5CF6;
    --white: #FFFFFF;
    --gray-100: #F1F5F9;
    --gray-300: #CBD5E1;
    --gray-400: #94A3B8;
    --gray-500: #64748B;
}

/* Base Styles */
html {
    scroll-behavior: smooth;
    overflow-x: hidden;
    max-width: 100%;
}

body {
    overflow-x: hidden;
    max-width: 100%;
}

/* Layout publish (Razor): khối nội dung chính không tràn quá khung viewport */
#publish-main {
    overflow-x: hidden;
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

/* Timeline mobile: flex item min-width:auto khiến cột nội dung vượt màn hình */
#publish-main .timeline-item > .ml-16 {
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
}

#publish-main .timeline-item.flex {
    min-width: 0;
}

/* Selection */
::selection {
    background-color: var(--neon-cyan);
    color: var(--navy-900);
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--navy-800);
}

::-webkit-scrollbar-thumb {
    background: var(--navy-600);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--electric-blue);
}

/* ========================================
   Header Styles
   ======================================== */

#header {
    background: rgba(10, 22, 40, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

#header.scrolled {
    background: rgba(10, 22, 40, 0.98);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

.nav-link {
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--electric-blue), var(--neon-cyan));
    transition: width 0.3s ease;
}

.nav-link:hover::after {
    width: 60%;
}

/* Mobile Menu */
#mobile-menu {
    background: var(--navy-900);
    -webkit-overflow-scrolling: touch;
}

.mobile-accordion {
    overflow: visible;
}

.mobile-accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease;
}

.mobile-accordion.active .mobile-accordion-content {
    /* Đủ cho nhiều mục + mô tả; tránh cắt menu con trên điện thoại */
    max-height: min(70vh, 520px);
}

.mobile-accordion.active .mobile-accordion-btn svg {
    transform: rotate(180deg);
}

/* ========================================
   Hero Section
   ======================================== */

#hero {
    background: linear-gradient(180deg, var(--navy-900) 0%, var(--navy-800) 100%);
}

#particles-js {
    position: absolute;
    inset: 0;
    z-index: 0;
}

/* Hero Badge */
.hero-badge {
    animation: float 3s ease-in-out infinite;
}

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

/* Hero Title Glow */
.hero-title {
    text-shadow: 0 0 80px rgba(59, 130, 246, 0.3);
}

/* ========================================
   Marquee / Client Logos
   ======================================== */

.marquee-container {
    position: relative;
    overflow: hidden;
}

.marquee-container::before,
.marquee-container::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 100px;
    z-index: 2;
    pointer-events: none;
}

.marquee-container::before {
    left: 0;
    background: linear-gradient(90deg, var(--gray-100) 0%, transparent 100%);
}

.marquee-container::after {
    right: 0;
    background: linear-gradient(90deg, transparent 0%, var(--gray-100) 100%);
}

.marquee-track {
    animation: marquee 30s linear infinite;
}

@keyframes marquee {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%);
    }
}

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

/* ========================================
   Pain & Solution Cards
   ======================================== */

.pain-card.animated,
.solution-card.animated,
.solution-card-ai.animated {
    opacity: 1;
}

/* AI Card Glow */
.solution-card-ai {
    box-shadow: 0 0 40px rgba(6, 182, 212, 0.1);
}

.solution-card-ai:hover {
    box-shadow: 0 0 60px rgba(6, 182, 212, 0.2);
}

.ai-icon-glow {
    box-shadow: 0 0 30px rgba(6, 182, 212, 0.4);
    animation: pulse-glow 2s ease-in-out infinite;
}

@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(6, 182, 212, 0.4);
    }
    50% {
        box-shadow: 0 0 40px rgba(139, 92, 246, 0.6);
    }
}

/* ========================================
   Timeline
   ======================================== */

.timeline-item.animated {
    opacity: 1;
}

.timeline-dot.animated {
    transform: scale(1);
}

#timeline-progress,
.timeline-progress-mobile {
    transition: height 0.1s linear;
}

/* ========================================
   Case Study Cards
   ======================================== */

.case-card {
    transform: perspective(1000px) rotateX(0deg) rotateY(0deg);
    transition: transform 0.3s ease, border-color 0.3s ease;
}

.case-card:hover {
    transform: perspective(1000px) rotateX(2deg) rotateY(-2deg) translateY(-5px);
}

/* ========================================
   Team Cards
   ======================================== */

.team-card.animated {
    opacity: 1;
}

/* ========================================
   Contact Form
   ======================================== */

#contact-form input:focus,
#contact-form textarea:focus {
    border-color: var(--neon-cyan);
    box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.15);
}

#contact-form button[type="submit"] {
    position: relative;
    overflow: hidden;
}

#contact-form button[type="submit"]::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

#contact-form button[type="submit"]:hover::before {
    left: 100%;
}

/* Form Validation States */
#contact-form input.error,
#contact-form textarea.error {
    border-color: #EF4444;
}

#contact-form input.success,
#contact-form textarea.success {
    border-color: #22C55E;
}

/* ========================================
   Buttons
   ======================================== */

.btn-primary {
    position: relative;
    overflow: hidden;
}

.btn-primary::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

.btn-primary:hover::after {
    width: 300px;
    height: 300px;
}

/* ========================================
   Utility Classes
   ======================================== */

/* Gradient Text */
.gradient-text {
    background: linear-gradient(135deg, var(--electric-blue), var(--neon-cyan), var(--neon-purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Glow Border */
.glow-border {
    position: relative;
}

.glow-border::before {
    content: '';
    position: absolute;
    inset: -2px;
    background: linear-gradient(135deg, var(--electric-blue), var(--neon-cyan), var(--neon-purple));
    border-radius: inherit;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.glow-border:hover::before {
    opacity: 1;
}

/* ========================================
   Animations
   ======================================== */

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

/* Fade In Left */
@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Fade In Right */
@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Scale In */
@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ========================================
   Responsive Adjustments
   ======================================== */

@media (max-width: 1023px) {
    .hero-title {
        font-size: 2.5rem;
    }
    
    .marquee-container::before,
    .marquee-container::after {
        width: 50px;
    }
}

@media (max-width: 767px) {
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    /* Disable hover effects on mobile */
    .case-card:hover {
        transform: none;
    }
    
    .team-card:hover {
        transform: none;
    }
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .marquee-track {
        animation: none;
    }
    
    html {
        scroll-behavior: auto;
    }
}
