/**
 * AI Automation Solutions - Homepage Styles
 * Contains: Hero, Neural Network, Services, Benefits, Process, FAQ, Testimonials, Contact
 */

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

.hero {
    padding: 160px 0 100px;
    background:
        radial-gradient(ellipse at 20% 80%, var(--hero-glow-1) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, var(--hero-glow-2) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, var(--hero-glow-3) 0%, transparent 70%),
        var(--hero-gradient);
    position: relative;
    overflow-x: clip;
    overflow-y: visible;
    transition: background 0.3s ease;
}

.hero::before {
    content: '';
    position: absolute;
    top: -30%;
    right: -10%;
    width: 700px;
    height: 700px;
    background: radial-gradient(circle, rgba(25, 118, 210, 0.08) 0%, transparent 60%);
    border-radius: 50%;
    animation: heroFloat 15s ease-in-out infinite;
}

.hero::after {
    content: '';
    position: absolute;
    bottom: -20%;
    left: -10%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(66, 165, 245, 0.1) 0%, transparent 60%);
    border-radius: 50%;
    animation: heroFloat 12s ease-in-out infinite reverse;
}

@keyframes heroFloat {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(30px, -30px) scale(1.05); }
}

.hero-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}

.hero-text h1 {
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 24px;
    color: var(--dark);
}

.hero-text h1 span {
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-text p {
    font-size: 1.25rem;
    color: var(--gray);
    margin-bottom: 32px;
    line-height: 1.7;
}

.hero-buttons {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.hero-visual {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: visible;
}

/* Hero Stats */
.stats {
    display: flex;
    gap: 48px;
    margin-top: 48px;
}

/* ==========================================================================
   Neural Network Animation
   ========================================================================== */

.neural-container {
    width: 100%;
    height: 450px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    overflow: visible;
}

.neural-network {
    position: relative;
    width: 520px;
    height: 420px;
    transform: scale(1.5) translateX(100px);
    transform-origin: center center;
}

/* Input nodes with labels */
.input-node {
    position: absolute;
    left: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 5;
}

.input-node .node-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, #64b5f6, #1976d2);
    box-shadow: 0 0 20px rgba(25, 118, 210, 0.5);
    flex-shrink: 0;
    position: relative;
}

.input-node .node-circle::after {
    content: '';
    position: absolute;
    inset: 20%;
    background: radial-gradient(circle, rgba(255,255,255,0.8) 0%, transparent 70%);
    border-radius: 50%;
}

.input-node .node-label {
    font-size: 9px;
    font-weight: 600;
    color: var(--primary);
    white-space: nowrap;
    text-align: center;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    top: -18px;
    width: max-content;
}

.input-1 { top: 20px; }
.input-2 { top: 90px; }
.input-3 { top: 160px; }
.input-4 { top: 230px; }
.input-5 { top: 300px; }
.input-6 { top: 370px; }

.input-1 .node-circle { animation: nodePulse 3s ease-in-out infinite 0s; }
.input-2 .node-circle { animation: nodePulse 3s ease-in-out infinite 0.4s; }
.input-3 .node-circle { animation: nodePulse 3s ease-in-out infinite 0.8s; }
.input-4 .node-circle { animation: nodePulse 3s ease-in-out infinite 1.2s; }
.input-5 .node-circle { animation: nodePulse 3s ease-in-out infinite 1.6s; }
.input-6 .node-circle { animation: nodePulse 3s ease-in-out infinite 2s; }

/* Hidden Layer Nodes */
.nn-node {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, #64b5f6, #1976d2);
    box-shadow: 0 0 20px rgba(25, 118, 210, 0.5);
    z-index: 5;
}

.nn-node::after {
    content: '';
    position: absolute;
    inset: 20%;
    background: radial-gradient(circle, rgba(255,255,255,0.8) 0%, transparent 70%);
    border-radius: 50%;
}

/* Hidden Layer 1 */
.node-h1a { width: 24px; height: 24px; left: 180px; top: 55px; animation: nodePulse 3s ease-in-out infinite 0.3s; }
.node-h1b { width: 26px; height: 26px; left: 180px; top: 125px; animation: nodePulse 3s ease-in-out infinite 0.7s; }
.node-h1c { width: 24px; height: 24px; left: 180px; top: 195px; animation: nodePulse 3s ease-in-out infinite 1.1s; }
.node-h1d { width: 26px; height: 26px; left: 180px; top: 265px; animation: nodePulse 3s ease-in-out infinite 1.5s; }
.node-h1e { width: 24px; height: 24px; left: 180px; top: 335px; animation: nodePulse 3s ease-in-out infinite 1.9s; }

/* Hidden Layer 2 */
.node-h2a { width: 28px; height: 28px; left: 280px; top: 90px; animation: nodePulse 3s ease-in-out infinite 0.5s; }
.node-h2b { width: 32px; height: 32px; left: 280px; top: 185px; animation: nodePulse 3s ease-in-out infinite 1s; background: radial-gradient(circle at 30% 30%, #42a5f5, #0d47a1); box-shadow: 0 0 30px rgba(25, 118, 210, 0.7); }
.node-h2c { width: 28px; height: 28px; left: 280px; top: 280px; animation: nodePulse 3s ease-in-out infinite 1.5s; }

/* Hidden Layer 3 */
.node-h3a { width: 22px; height: 22px; left: 370px; top: 130px; animation: nodePulse 3s ease-in-out infinite 0.8s; }
.node-h3b { width: 26px; height: 26px; left: 370px; top: 195px; animation: nodePulse 3s ease-in-out infinite 1.3s; }
.node-h3c { width: 22px; height: 22px; left: 370px; top: 260px; animation: nodePulse 3s ease-in-out infinite 1.8s; }

/* Output Node with Label */
.output-node {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 5;
}

.output-node .node-circle {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, #4caf50, #2e7d32);
    box-shadow: 0 0 40px rgba(76, 175, 80, 0.6), 0 0 60px rgba(76, 175, 80, 0.3);
    position: relative;
    animation: outputPulse 2.5s ease-in-out infinite;
}

.output-node .node-circle::after {
    content: '';
    position: absolute;
    inset: 15%;
    background: radial-gradient(circle, rgba(255,255,255,0.9) 0%, rgba(129, 199, 132, 0.4) 50%, transparent 70%);
    border-radius: 50%;
}

.output-node .node-label {
    font-size: 13px;
    font-weight: 700;
    color: #2e7d32;
    white-space: nowrap;
    position: absolute;
    left: 68px;
    width: 90px;
    line-height: 1.3;
}

@keyframes nodePulse {
    0%, 100% { transform: scale(1); box-shadow: 0 0 20px rgba(25, 118, 210, 0.5); }
    50% { transform: scale(1.1); box-shadow: 0 0 30px rgba(66, 165, 245, 0.7); }
}

@keyframes outputPulse {
    0%, 100% { transform: scale(1); box-shadow: 0 0 40px rgba(76, 175, 80, 0.6), 0 0 60px rgba(76, 175, 80, 0.3); }
    50% { transform: scale(1.08); box-shadow: 0 0 50px rgba(76, 175, 80, 0.8), 0 0 80px rgba(76, 175, 80, 0.4); }
}

/* Synaptic Connections - SVG */
.synapse-layer {
    position: absolute;
    inset: 0;
    z-index: 1;
}

.synapse {
    stroke: rgba(66, 165, 245, 0.3);
    stroke-width: 1.5;
    fill: none;
}

.synapse-active {
    stroke: url(#synapseGradient);
    stroke-width: 2;
    filter: drop-shadow(0 0 3px rgba(66, 165, 245, 0.5));
}

/* Signal pulses traveling along connections */
.signal {
    fill: #64b5f6;
    filter: drop-shadow(0 0 6px #42a5f5);
}

.signal-1 { animation: signal-path-1 2.5s linear infinite; }
.signal-2 { animation: signal-path-2 2.8s linear infinite 0.3s; }
.signal-3 { animation: signal-path-3 2.2s linear infinite 0.6s; }
.signal-4 { animation: signal-path-4 2.6s linear infinite 0.9s; }
.signal-5 { animation: signal-path-5 2.4s linear infinite 1.2s; }
.signal-6 { animation: signal-path-6 2.7s linear infinite 0.4s; }
.signal-7 { animation: signal-path-7 2.3s linear infinite 0.7s; }
.signal-8 { animation: signal-path-8 2.9s linear infinite 1s; }

@keyframes signal-path-1 {
    0% { offset-distance: 0%; opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { offset-distance: 100%; opacity: 0; }
}

@keyframes signal-path-2 {
    0% { offset-distance: 0%; opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { offset-distance: 100%; opacity: 0; }
}

@keyframes signal-path-3 {
    0% { offset-distance: 0%; opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { offset-distance: 100%; opacity: 0; }
}

@keyframes signal-path-4 {
    0% { offset-distance: 0%; opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { offset-distance: 100%; opacity: 0; }
}

@keyframes signal-path-5 {
    0% { offset-distance: 0%; opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { offset-distance: 100%; opacity: 0; }
}

@keyframes signal-path-6 {
    0% { offset-distance: 0%; opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { offset-distance: 100%; opacity: 0; }
}

@keyframes signal-path-7 {
    0% { offset-distance: 0%; opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { offset-distance: 100%; opacity: 0; }
}

@keyframes signal-path-8 {
    0% { offset-distance: 0%; opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { offset-distance: 100%; opacity: 0; }
}

/* Floating data bits */
.data-bits {
    position: absolute;
    inset: 0;
    overflow: hidden;
    z-index: 0;
}

.data-bit {
    position: absolute;
    font-family: monospace;
    font-size: 10px;
    color: var(--data-bit-color);
    animation: floatBit 8s linear infinite;
}

.bit-1 { left: 5%; animation-delay: 0s; }
.bit-2 { left: 15%; animation-delay: 1s; }
.bit-3 { left: 25%; animation-delay: 2s; }
.bit-4 { left: 35%; animation-delay: 0.5s; }
.bit-5 { left: 45%; animation-delay: 1.5s; }
.bit-6 { left: 55%; animation-delay: 2.5s; }
.bit-7 { left: 65%; animation-delay: 0.8s; }
.bit-8 { left: 75%; animation-delay: 1.8s; }
.bit-9 { left: 85%; animation-delay: 2.8s; }
.bit-10 { left: 95%; animation-delay: 3s; }

@keyframes floatBit {
    0% { top: 110%; opacity: 0; }
    10% { opacity: 0.4; }
    90% { opacity: 0.4; }
    100% { top: -10%; opacity: 0; }
}

/* Background glow */
.nn-glow {
    position: absolute;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(66, 165, 245, 0.15) 0%, transparent 70%);
    border-radius: 50%;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    animation: glowPulse 4s ease-in-out infinite;
    z-index: 0;
}

@keyframes glowPulse {
    0%, 100% { opacity: 0.5; transform: translate(-50%, -50%) scale(1); }
    50% { opacity: 1; transform: translate(-50%, -50%) scale(1.2); }
}

/* ==========================================================================
   Services Section
   ========================================================================== */

.services {
    padding: 100px 0;
    background: linear-gradient(180deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
    transition: background 0.3s ease;
}

/* ==========================================================================
   Benefits Section
   ========================================================================== */

.benefits {
    padding: 100px 0;
    background: #0d47a1;
    color: #ffffff;
}

[data-theme="dark"] .benefits {
    background: #0a0e14;
}

.benefits .section-tag {
    background: rgba(255, 255, 255, 0.1);
    color: var(--accent);
}

.benefits .section-header h2 {
    color: #ffffff;
}

.benefits .section-header p {
    color: #90a4ae;
}

.benefit-card {
    padding: 40px;
    background: #1565c0;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .benefit-card {
    background: #161b22;
}

.benefit-number {
    font-size: 3rem;
    font-weight: 800;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 16px;
}

.benefit-card h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 12px;
}

.benefit-card p {
    color: #90a4ae;
    line-height: 1.7;
}

/* ==========================================================================
   Process Section
   ========================================================================== */

.process {
    padding: 100px 0;
    background: var(--gradient-subtle);
}

.process-steps {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 32px;
    position: relative;
}

.process-steps::before {
    content: '';
    position: absolute;
    top: 40px;
    left: 10%;
    right: 10%;
    height: 2px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    z-index: 0;
}

.process-step {
    text-align: center;
    position: relative;
    z-index: 1;
}

.step-number {
    width: 80px;
    height: 80px;
    background: var(--gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
    font-size: 1.5rem;
    font-weight: 800;
    color: #fff;
    box-shadow: 0 10px 30px rgba(37, 99, 235, 0.3);
}

.process-step h3 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--dark);
}

.process-step p {
    color: var(--gray);
    font-size: 0.95rem;
}

/* ==========================================================================
   FAQ Section
   ========================================================================== */

.faq {
    padding: 100px 0;
    background: linear-gradient(180deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
    transition: background 0.3s ease;
}

.faq-grid {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.faq-item {
    background: var(--bg-card);
    border-radius: 16px;
    border: 1px solid var(--border-color);
    overflow: hidden;
    transition: all 0.3s ease;
}

.faq-item:hover {
    border-color: var(--primary-light);
}

.faq-item.active {
    box-shadow: 0 10px 30px var(--card-shadow);
}

.faq-question {
    width: 100%;
    padding: 24px 28px;
    background: transparent;
    border: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    text-align: left;
    font-family: inherit;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--dark);
    transition: color 0.3s ease;
}

.faq-question:hover {
    color: var(--primary);
}

.faq-icon {
    width: 24px;
    height: 24px;
    stroke: var(--gray);
    flex-shrink: 0;
    transition: transform 0.3s ease, stroke 0.3s ease;
}

.faq-item.active .faq-icon {
    transform: rotate(180deg);
    stroke: var(--primary);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
}

.faq-item.active .faq-answer {
    max-height: 300px;
}

.faq-answer p {
    padding: 0 28px 24px;
    color: var(--gray);
    line-height: 1.8;
    font-size: 1rem;
}

/* ==========================================================================
   Testimonials Section
   ========================================================================== */

.testimonials {
    padding: 100px 0;
    background: linear-gradient(180deg, var(--bg-tertiary) 0%, var(--bg-secondary) 100%);
    transition: background 0.3s ease;
}

.testimonials-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
}

.testimonial-card {
    padding: 40px;
    background: var(--light);
    border-radius: 20px;
}

.testimonial-text {
    font-size: 1.1rem;
    color: var(--dark);
    line-height: 1.8;
    margin-bottom: 24px;
    font-style: italic;
}

.testimonial-author {
    display: flex;
    align-items: center;
    gap: 16px;
}

.author-avatar {
    width: 56px;
    height: 56px;
    background: var(--gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: 1.25rem;
}

.author-info h4 {
    font-weight: 700;
    color: var(--dark);
}

.author-info p {
    font-size: 0.875rem;
    color: var(--gray);
}

/* ==========================================================================
   Contact Section
   ========================================================================== */

.contact {
    padding: 100px 0;
    background: var(--gradient-subtle);
}

.contact-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}

.contact-info h2 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 24px;
    color: var(--dark);
}

.contact-info p {
    color: var(--gray);
    font-size: 1.1rem;
    margin-bottom: 32px;
    line-height: 1.7;
}

.contact-features {
    list-style: none;
}

.contact-features li {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    color: var(--dark);
    font-weight: 500;
}

.contact-features svg {
    width: 24px;
    height: 24px;
    stroke: var(--primary);
}

.contact-form {
    background: var(--bg-card);
    padding: 48px;
    border-radius: 24px;
    box-shadow: 0 20px 40px var(--card-shadow);
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.contact-form .btn-primary {
    width: 100%;
    justify-content: center;
}

/* ==========================================================================
   Responsive Styles
   ========================================================================== */

@media (max-width: 1024px) {
    .hero-content {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .hero-text h1 {
        font-size: 2.75rem;
    }

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

    .stats {
        justify-content: center;
    }

    .hero-visual {
        display: none;
    }

    .process-steps {
        grid-template-columns: repeat(2, 1fr);
    }

    .process-steps::before {
        display: none;
    }

    .testimonials-grid {
        grid-template-columns: 1fr;
    }

    .contact-wrapper {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .hero {
        padding: 120px 0 60px;
    }

    .hero-text h1 {
        font-size: 2.25rem;
    }

    .process-steps {
        grid-template-columns: 1fr;
        gap: 48px;
    }

    .stats {
        flex-direction: column;
        gap: 24px;
    }

    .contact-form {
        padding: 32px 24px;
    }

    .faq-question {
        padding: 20px 20px;
        font-size: 1rem;
    }

    .faq-answer p {
        padding: 0 20px 20px;
    }
}
