/* ============================================
   MODERN HERO SECTION - CSS ARCHITECTURE
   ============================================ */

/* ============================================
   1. CSS VARIABLES & ROOT STYLES
   ============================================ */
:root {
    --hero-bg-primary: #0a0a0a;
    --hero-bg-secondary: #1a1a2e;
    --hero-bg-tertiary: #16213e;
    --accent-cyan: #40e0ff;
    --accent-purple: #8b5cf6;
    --accent-orange: #f59e0b;
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.8);
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --hero-padding-desktop: 120px 0 80px;
    --hero-padding-mobile: 100px 0 60px;
}

/* ============================================
   2. MAIN HERO CONTAINER
   ============================================ */
.modern-hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    background: var(--hero-bg-primary);
    color: var(--text-primary);
    overflow: hidden;
    padding: var(--hero-padding-desktop);
}

/* ============================================
   3. BACKGROUND ELEMENTS & EFFECTS
   ============================================ */

/* Background Container */
.hero-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

/* Particles.js Container */
#particles-js {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
}

#particles-js canvas {
    filter: drop-shadow(0 0 10px rgba(64, 224, 255, 0.3));
}

/* Gradient Overlay */
.gradient-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--hero-bg-primary) 0%, var(--hero-bg-secondary) 50%, var(--hero-bg-tertiary) 100%);
    opacity: 0.6;
    z-index: 3;
}

/* Neural Grid Pattern */
.neural-grid {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        linear-gradient(rgba(64, 224, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(64, 224, 255, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
    animation: gridPulse 4s ease-in-out infinite;
    z-index: 4;
}

/* Floating Nodes */
.floating-nodes {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 5;
}

.node {
    position: absolute;
    width: 4px;
    height: 4px;
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
    border-radius: 50%;
    box-shadow: 0 0 20px rgba(64, 224, 255, 0.6);
    animation: float 6s ease-in-out infinite;
}

.node-1 { top: 20%; left: 10%; animation-delay: 0s; }
.node-2 { top: 60%; left: 80%; animation-delay: -2s; }
.node-3 { top: 30%; left: 70%; animation-delay: -4s; }
.node-4 { top: 80%; left: 20%; animation-delay: -1s; }
.node-5 { top: 40%; left: 50%; animation-delay: -3s; }

/* Circuit Lines */
.circuit-lines {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.1;
    z-index: 6;
}

.circuit-svg {
    width: 100%;
    height: 100%;
}

.circuit-path {
    fill: none;
    stroke: var(--accent-cyan);
    stroke-width: 1;
    stroke-dasharray: 10, 5;
    animation: circuitFlow 8s linear infinite;
}

/* ============================================
   4. HERO CONTENT LAYOUT
   ============================================ */
.hero-content-wrapper {
    position: relative;
    z-index: 10;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 80px;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.hero-text-content {
    animation: fadeInUp 1s ease-out;
}

/* ============================================
   5. TYPOGRAPHY & TEXT CONTENT
   ============================================ */
.hero-main-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(3rem, 6vw, 4.5rem);
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 24px;
}

.title-line {
    display: block;
}

.gradient-text {
    background: linear-gradient(135deg, var(--accent-cyan) 0%, var(--accent-purple) 50%, var(--accent-orange) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gradientShift 3s ease-in-out infinite;
}

.hero-description {
    font-size: 1.25rem;
    line-height: 1.6;
    color: var(--text-secondary);
    margin-bottom: 32px;
    max-width: 500px;
}

/* ============================================
   6. CTA BUTTONS
   ============================================ */
.hero-cta-section {
    display: flex;
    gap: 16px;
    margin-bottom: 40px;
    flex-wrap: wrap;
}

.primary-cta-btn {
    position: relative;
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
    border: none;
    padding: 16px 32px;
    border-radius: 12px;
    color: white;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.3s ease;
    overflow: hidden;
}

.primary-cta-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 20px 40px rgba(64, 224, 255, 0.3);
}

.btn-glow {
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: left 0.6s;
}

.primary-cta-btn:hover .btn-glow {
    left: 100%;
}

.secondary-cta-btn {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    padding: 16px 24px;
    border-radius: 12px;
    color: white;
    font-size: 1.1rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.secondary-cta-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(64, 224, 255, 0.5);
    transform: translateY(-2px);
}

/* ============================================
   7. HERO BADGES
   ============================================ */
.hero-badges {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.badge {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    backdrop-filter: blur(10px);
}

.badge i {
    color: var(--accent-cyan);
}

/* ============================================
   8. VISUAL CONTENT (AI INTERFACE)
   ============================================ */
.hero-visual-content {
    animation: fadeInRight 1s ease-out 0.3s both;
    position: relative;
}

.hero-visual-content::before {
    content: '';
    position: absolute;
    top: -20px;
    left: -20px;
    right: -20px;
    bottom: -20px;
    background: linear-gradient(45deg, transparent, rgba(64, 224, 255, 0.1), transparent);
    border-radius: 20px;
    animation: glowPulse 3s ease-in-out infinite;
    z-index: -1;
}

/* AI Interface Container */
.ai-interface {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    overflow: hidden;
    backdrop-filter: blur(20px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    animation: floatInterface 6s ease-in-out infinite;
    position: relative;
}

/* Interface Header */
.interface-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: var(--glass-bg);
    border-bottom: 1px solid var(--glass-border);
}

.interface-dots {
    display: flex;
    gap: 8px;
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.dot.red { background: #ff5f57; }
.dot.yellow { background: #ffbd2e; }
.dot.green { background: #28ca42; }

.interface-title {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* ============================================
   9. CHAT INTERFACE
   ============================================ */
.interface-body {
    padding: 24px;
}

.chat-messages {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 300px;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 8px;
}

.chat-messages::-webkit-scrollbar {
    width: 3px;
}

.chat-messages::-webkit-scrollbar-track {
    background: var(--glass-border);
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: rgba(64, 224, 255, 0.3);
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-horizontal {
    display: none;
}

/* Chat Messages */
.message {
    display: flex;
    gap: 8px;
    align-items: flex-end;
    animation: slideInMessage 0.6s ease-out;
    opacity: 0;
    animation-fill-mode: forwards;
    margin-bottom: 8px;
}

.user-message {
    flex-direction: row-reverse;
    align-self: flex-end;
    animation: slideInRight 0.6s ease-out;
    opacity: 0;
    animation-fill-mode: forwards;
}

.ai-message {
    align-self: flex-start;
    animation: slideInLeft 0.6s ease-out;
    opacity: 0;
    animation-fill-mode: forwards;
}

/* Message Timing */
.message:nth-child(1) { animation-delay: 1s; }
.message:nth-child(2) { animation-delay: 1.8s; }
.message:nth-child(3) { animation-delay: 2.6s; }
.message:nth-child(4) { animation-delay: 3.4s; }
.message:nth-child(5) { animation-delay: 4.2s; }
.typing-indicator { animation-delay: 5s; }

/* Message Avatars */
.message-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    flex-shrink: 0;
}

.user-message .message-avatar {
    background: linear-gradient(135deg, var(--accent-cyan), #0ea5e9);
    color: var(--hero-bg-primary);
}

.ai-avatar {
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-cyan));
    color: white;
    animation: aiPulse 2s ease-in-out infinite;
    position: relative;
}

.ai-avatar::after {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-cyan));
    border-radius: 50%;
    opacity: 0;
    animation: aiGlow 2s ease-in-out infinite;
    z-index: -1;
}

/* Message Content */
.message-content {
    padding: 10px 14px;
    border-radius: 18px;
    font-size: 0.85rem;
    line-height: 1.4;
    max-width: 200px;
    word-wrap: break-word;
}

.user-message .message-content {
    background: linear-gradient(135deg, var(--accent-cyan), #0ea5e9);
    color: var(--hero-bg-primary);
    border-radius: 18px 18px 4px 18px;
    font-weight: 500;
}

.ai-message .message-content {
    background: rgba(139, 92, 246, 0.15);
    border: 1px solid rgba(139, 92, 246, 0.3);
    color: rgba(255, 255, 255, 0.9);
    border-radius: 18px 18px 18px 4px;
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    margin-top: 4px;
    animation: slideInLeft 0.6s ease-out;
    opacity: 0;
    animation-fill-mode: forwards;
}

.typing-dots {
    display: flex;
    gap: 4px;
    padding: 10px 14px;
    background: rgba(139, 92, 246, 0.15);
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 18px 18px 18px 4px;
}

.typing-dots span {
    width: 6px;
    height: 6px;
    background: var(--accent-cyan);
    border-radius: 50%;
    animation: typingBounce 1.4s infinite ease-in-out;
}

.typing-dots span:nth-child(1) { animation-delay: -0.32s; }
.typing-dots span:nth-child(2) { animation-delay: -0.16s; }

/* ============================================
   10. ANIMATIONS & KEYFRAMES
   ============================================ */

/* Grid Animation */
@keyframes gridPulse {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.6; }
}

/* Node Float Animation */
@keyframes float {
    0%, 100% {
        transform: translateY(0px) scale(1);
        opacity: 0.8;
    }
    50% {
        transform: translateY(-20px) scale(1.1);
        opacity: 1;
    }
}

/* Circuit Flow Animation */
@keyframes circuitFlow {
    0% {
        stroke-dashoffset: 0;
        opacity: 0.1;
    }
    50% {
        opacity: 0.3;
    }
    100% {
        stroke-dashoffset: -100;
        opacity: 0.1;
    }
}

/* Gradient Text Animation */
@keyframes gradientShift {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

/* Glow Pulse Animation */
@keyframes glowPulse {
    0%, 100% {
        opacity: 0.3;
        transform: scale(1);
    }
    50% {
        opacity: 0.6;
        transform: scale(1.02);
    }
}

/* Interface Float Animation */
@keyframes floatInterface {
    0%, 100% {
        transform: translateY(0px) rotateX(0deg);
    }
    33% {
        transform: translateY(-8px) rotateX(1deg);
    }
    66% {
        transform: translateY(4px) rotateX(-0.5deg);
    }
}

/* Message Slide Animations */
@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* AI Avatar Animations */
@keyframes aiPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

@keyframes aiGlow {
    0%, 100% {
        opacity: 0;
        transform: scale(1);
    }
    50% {
        opacity: 0.3;
        transform: scale(1.2);
    }
}

/* Typing Animation */
@keyframes typingBounce {
    0%, 80%, 100% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

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

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(40px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ============================================
   11. LOGO STYLING
   ============================================ */
.logo-icon {
    width: 80px;
    height: 80px;
    margin-right: 12px;
    filter: brightness(1.1);
    transition: transform 0.3s ease;
}

.nav-logo:hover .logo-icon,
.footer-logo:hover .logo-icon {
    transform: scale(1.05);
}

/* ============================================
   12. RESPONSIVE DESIGN
   ============================================ */

/* Tablet Breakpoint */
@media (max-width: 1024px) {
    .hero-content-wrapper {
        grid-template-columns: 1fr;
        gap: 60px;
        text-align: center;
    }

    .hero-main-title {
        font-size: clamp(2.5rem, 8vw, 3.5rem);
    }

    .hero-description {
        max-width: 600px;
        margin-left: auto;
        margin-right: auto;
    }
}

/* Mobile Breakpoint */
@media (max-width: 768px) {
    .modern-hero {
        padding: var(--hero-padding-mobile);
    }

    .hero-content-wrapper {
        gap: 40px;
        padding: 0 16px;
    }

    .hero-cta-section {
        flex-direction: column;
        align-items: center;
    }

    .primary-cta-btn,
    .secondary-cta-btn {
        width: 100%;
        max-width: 280px;
        justify-content: center;
    }

    .hero-badges {
        justify-content: center;
    }

    .ai-interface {
        max-width: 400px;
        margin: 0 auto;
    }

    .message-content {
        max-width: 220px;
    }

    .logo-icon {
        width: 60px;
        height: 60px;
        margin-right: 10px;
    }
}

/* Small Mobile Breakpoint */
@media (max-width: 480px) {
    .hero-main-title {
        font-size: 2.2rem;
    }

    .hero-description {
        font-size: 1.1rem;
    }

    .badge {
        font-size: 0.8rem;
        padding: 6px 12px;
    }

    .interface-body {
        padding: 16px;
    }
}