:root {
    --primary: #00f3ff;
    --secondary: #7b00ff;
    --dark: #0a0a1a;
    --darker: #050510;
    --light: #f0f8ff;
    --transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Exo 2', sans-serif;
    background-color: var(--darker);
    color: var(--light);
    overflow-x: hidden;
    min-height: 100vh;
}

#particles-js {
    position: fixed;
    width: 100%;
    height: 100%;
    z-index: -1;
}

.cognitive-gateway {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    position: relative;
}

/* Neural Network - Hidden by default, revealed on interaction */
.neural-network {
    position: fixed;
    inset: 0;
    width: min(1400px, 100vw);
    height: min(200px, 50vh);
    /*
    width: 100%;
    height: 100%;
    */
    position: fixed;
    top: 50%;
    left: 50%; /* Original value was 0 */

    transform: translateX(-50%); /* Added */

    pointer-events: none;
    z-index: 1;
    opacity: 0;
    visibility: hidden;
    transition: all 0.5s ease;
}

.neural-network.active {
    opacity: 1;
    visibility: visible;
}

/* Connection lines container */
.neural-connections {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

/* Base connection line style */
.connection {
    position: absolute;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    transform-origin: left center;
    opacity: 0;
    z-index: 1;
}

.connection.active {
    opacity: 0.7;
    animation: dataFlow 2s infinite;
}

@keyframes dataFlow {
    0% { 
        background-position: -100% 0; 
    }
    100% { 
        background-position: 200% 0; 
    }
}

/* Nodes positioned to align with where cards will appear */
.node-layer {
    position: absolute;
    display: flex;
    align-items: center;
    z-index: 10; /* Nodes above connections */
}

.input-layer {
    top: 50%;
    left: 20%;
    flex-direction: column;
    gap: 4rem;
    transform: translateY(-50%);
}

.hidden-layer {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    gap: 3rem;
}

.output-layer {
    top: 50%;
    right: 20%;
    transform: translateY(-50%);
}

.node {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(0, 243, 255, 0.1);
    border: 3px solid var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 20; /* Ensure nodes are above connections */
}

.node.visible {
    opacity: 1;
    transform: scale(1);
}

.node.active {
    background: rgba(0, 243, 255, 0.3);
    border-color: rgba(0, 243, 255, 0.8);
    box-shadow: 0 0 40px rgba(0, 243, 255, 0.6);
    animation: nodePulse 2s infinite;
}

.node-glow {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: inherit;
    filter: blur(15px);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: -1;
}

.node.active .node-glow {
    opacity: 0.4;
}

.node.processing {
    background: linear-gradient(45deg, var(--primary), var(--secondary));
    border: 2px solid transparent;
}

.node.processing .node-glow {
    background: linear-gradient(45deg, var(--primary), var(--secondary));
}

.node.output {
    background: rgba(123, 0, 255, 0.2);
    border: 2px solid var(--secondary);
}

.node.output .node-glow {
    background: var(--secondary);
}

.node.output.active {
    background: rgba(123, 0, 255, 0.4);
    border-color: rgba(123, 0, 255, 0.8);
    box-shadow: 0 0 40px rgba(123, 0, 255, 0.6);
    animation: outputPulse 2s infinite;
}

@keyframes nodePulse {
    0%, 100% { 
        transform: scale(1);
        box-shadow: 0 0 40px rgba(0, 243, 255, 0.6);
    }
    50% { 
        transform: scale(1.1);
        box-shadow: 0 0 60px rgba(0, 243, 255, 0.9);
    }
}

@keyframes outputPulse {
    0%, 100% { 
        transform: scale(1);
        box-shadow: 0 0 40px rgba(123, 0, 255, 0.6);
    }
    50% { 
        transform: scale(1.1);
        box-shadow: 0 0 60px rgba(123, 0, 255, 0.9);
    }
}

/* Contact Interface */
.contact-interface {
    background: rgba(10, 10, 26, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(0, 243, 255, 0.3);
    border-radius: 20px;
    padding: 3rem;
    max-width: 1000px;
    width: 100%;
    position: relative;
    z-index: 2;
    box-shadow: 0 20px 60px rgba(0, 243, 255, 0.1);
}

.interface-header {
    text-align: center;
    margin-bottom: 3rem;
}

.interface-header h1 {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    background: linear-gradient(to right, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.interface-header p {
    font-size: 1.2rem;
    opacity: 0.8;
}

/* Connection Vectors */
.connection-vectors {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    margin-bottom: 3rem;
}

.vector-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.vector-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 243, 255, 0.1), transparent);
    transition: var(--transition);
}

.vector-card:hover::before {
    left: 100%;
}

.vector-card:hover {
    border-color: var(--primary);
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 243, 255, 0.2);
}

.vector-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.vector-card h3 {
    font-size: 1.3rem;
    margin-bottom: 1rem;
    color: var(--primary);
}

.vector-card p {
    margin-bottom: 1.5rem;
    opacity: 0.8;
    line-height: 1.5;
}

.vector-details {
    text-align: left;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.detail-item .label {
    opacity: 0.7;
}

.detail-item .value {
    color: var(--primary);
    font-weight: 600;
}

/* Cognitive Form */
.cognitive-form {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 15px;
    padding: 2rem;
    border: 1px solid rgba(0, 243, 255, 0.2);
    opacity: 0;
    transform: translateY(30px) scale(0.95);
    transition: all 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.cognitive-form.visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.cognitive-form.animating-to-node {
    transform: scale(0.1) !important;
    opacity: 0 !important;
}

.form-header {
    text-align: center;
    margin-bottom: 2rem;
}

.form-header h3 {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
    color: var(--primary);
}

.form-header p {
    opacity: 0.8;
}

.input-group {
    margin-bottom: 2rem;
}

.input-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--primary);
}

.input-group input,
.input-group textarea,
.input-group select {
    width: 100%;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: var(--light);
    font-family: 'Exo 2', sans-serif;
    font-size: 1rem;
    transition: var(--transition);
}

.input-group input:focus,
.input-group textarea:focus,
.input-group select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 20px rgba(0, 243, 255, 0.2);
}

.input-group select option {
    background: #0a0a1a;
    color: var(--light);
}

.input-group textarea {
    resize: vertical;
    min-height: 100px;
}

/* Timeline Selector */
.timeline-selector {
    display: flex;
    gap: 1rem;
}

.timeline-selector button {
    flex: 1;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: var(--light);
    cursor: pointer;
    transition: var(--transition);
    font-family: 'Exo 2', sans-serif;
}

.timeline-selector button:hover {
    border-color: var(--primary);
}

.timeline-selector button.active {
    background: rgba(0, 243, 255, 0.1);
    border-color: var(--primary);
    color: var(--primary);
}

/* Contact Info Row */
.contact-info .input-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

/* Extra Fields */
.extra-fields {
    margin-bottom: 2rem;
    animation: slideDown 0.5s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 1rem 2rem;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
    font-size: 1.1rem;
    border: 2px solid transparent;
    cursor: pointer;
    font-family: 'Exo 2', sans-serif;
    width: 100%;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: linear-gradient(45deg, var(--primary), var(--secondary));
    color: var(--darker);
    box-shadow: 0 4px 20px rgba(0, 243, 255, 0.3);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(0, 243, 255, 0.4);
}

.btn-secondary {
    border-color: var(--primary);
    color: var(--primary);
    background: transparent;
}

.btn-secondary:hover {
    background: rgba(0, 243, 255, 0.1);
    transform: translateY(-3px);
}

.btn-loading {
    display: none;
    align-items: center;
    gap: 0.5rem;
}

.btn-loading.visible {
    display: inline-flex;
}

.loading-dots {
    display: flex;
    gap: 4px;
}

.loading-dots span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    animation: loadingBounce 1.4s infinite ease-in-out;
}

.loading-dots span:nth-child(1) { animation-delay: -0.32s; }
.loading-dots span:nth-child(2) { animation-delay: -0.16s; }

@keyframes loadingBounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

/* Connection Modal */
.connection-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(5, 5, 16, 0.95);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s ease;
}

.connection-modal.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: rgba(10, 10, 26, 0.9);
    border: 1px solid rgba(0, 243, 255, 0.3);
    border-radius: 20px;
    padding: 3rem;
    max-width: 500px;
    width: 90%;
    text-align: center;
    position: relative;
    transform: translateY(30px);
    transition: transform 0.4s ease;
}

.connection-modal.active .modal-content {
    transform: translateY(0);
}

.modal-icon {
    font-size: 4rem;
    margin-bottom: 1.5rem;
}

.modal-content h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    background: linear-gradient(to right, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.modal-content p {
    margin-bottom: 2rem;
    opacity: 0.8;
    line-height: 1.6;
}

.next-steps {
    text-align: left;
    margin-bottom: 2rem;
}

.step {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    padding: 1rem;
    background: rgba(0, 243, 255, 0.05);
    border-radius: 10px;
    border-left: 3px solid var(--primary);
    opacity: 0;
    transform: translateX(-20px);
    transition: all 0.5s ease;
}

.step-number {
    background: var(--primary);
    color: var(--darker);
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    flex-shrink: 0;
}

/* Form Error Styles */
.form-error {
    background: rgba(255, 68, 68, 0.1);
    border: 1px solid rgba(255, 68, 68, 0.3);
    color: #ff4444;
    padding: 1rem;
    border-radius: 10px;
    margin-bottom: 1.5rem;
    text-align: center;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

.form-error.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Utility Classes */
.hidden {
    display: none !important;
}

.gradient-text {
    background: linear-gradient(to right, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
}

.gradient-bg {
    background: linear-gradient(45deg, var(--primary), var(--secondary));
    color: var(--darker);
}

/* Responsive */
@media (max-width: 768px) {
    .cognitive-gateway {
        padding: 1rem;
    }
    
    .contact-interface {
        padding: 2rem 1.5rem;
    }
    
    .connection-vectors {
        grid-template-columns: 1fr;
    }
    
    .interface-header h1 {
        font-size: 2.5rem;
    }
    
    .contact-info .input-row {
        grid-template-columns: 1fr;
    }
    
    .timeline-selector {
        flex-direction: column;
    }
    
    .neural-network {
        display: none;
    }
    
    .node {
        width: 50px;
        height: 50px;
    }
    
    .input-layer {
        gap: 2rem;
    }
    
    .hidden-layer {
        gap: 1.5rem;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .neural-network {
        display: block !important;
    }
    
    .node {
        width: 60px;
        height: 60px;
    }
    
    .input-layer {
        gap: 3rem;
    }
    
    .hidden-layer {
        gap: 2rem;
    }
}

@media (min-width: 1200px) {
    .input-layer {
        gap: 5rem !important;
    }
    
    .hidden-layer {
        gap: 4rem !important;
    }
}

/* Ensure neural network is properly visible when active */
@media (min-width: 769px) {
    .neural-network.active {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
}

@media (max-height: 800px) {
    .node {
        width: 60px;
        height: 60px;
    }

    .input-layer {
        gap: 2rem;
    }

    .hidden-layer {
        gap: 1.5rem;
    }
}

@media (max-width: 768px) {
    .neural-network {
        top: 35%;
    }
    .hidden-layer {
        gap: 0.5rem;
    }

    .node {
        width: 45px;
        height: 45px;
    }
}

.form-error {
    background: rgba(255, 68, 68, 0.1);
    border: 1px solid rgba(255, 68, 68, 0.3);
    color: #ff4444;
    padding: 1rem;
    border-radius: 10px;
    margin-bottom: 1.5rem;
    text-align: center;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

.form-error.visible {
    opacity: 1;
    transform: translateY(0);
}