/* ===== Synapse AI Section - Isolated Styles ===== */

/* Base Variables for Synapse AI Block */
#synapse-ai-block {
    /* Critical: Reset some conflicting global styles */
    all: initial; /* Attempts to reset all inherited properties */
    display: block; /* Ensure it behaves like a div */
    box-sizing: border-box; /* Crucial for layout consistency */
    position: relative; /* For blobs, etc. */
    overflow: hidden; /* For blobs, etc. */

    /* Define variables specific to this block */
    --synapse-color-dark-bg: #1A1A2E;
    --synapse-color-secondary-bg: #0F3460;
    --synapse-color-light-bg: #F0F4F8; /* Light section background */
    --synapse-color-text-light: #E0E0E0; /* Text on dark backgrounds */
    --synapse-color-text-dark: #333333; /* Text on light backgrounds */
    --synapse-color-text-medium: #A0A0A0; /* Subtler text */
    --synapse-color-accent-blue: #00C9FF; /* Primary accent */
    --synapse-color-accent-green: #92FE9D; /* Secondary accent */
    --synapse-color-card-bg-dark: #2B2B4A; /* Card background on dark sections */
    --synapse-color-card-bg-light: #ffffff; /* Card background on light sections */
    --synapse-color-card-border-dark: rgba(255, 255, 255, 0.08);
    --synapse-color-card-border-light: rgba(0, 0, 0, 0.08);

    --synapse-font-primary: 'Outfit', sans-serif; /* Fallback to generic sans-serif */

    --synapse-padding-sm: 15px;
    --synapse-padding-md: 30px;
    --synapse-padding-lg: 60px;
    --synapse-section-padding-y: 100px; /* Vertical padding for sections */

    /* Ensure font is loaded for this block */
    font-family: var(--synapse-font-primary);
    line-height: 1.6;
    color: var(--synapse-color-text-light); /* Default text color for this block */
}

/* Reset basic HTML elements within this block */
#synapse-ai-block h1,
#synapse-ai-block h2,
#synapse-ai-block h3,
#synapse-ai-block h4,
#synapse-ai-block p,
#synapse-ai-block a,
#synapse-ai-block ul,
#synapse-ai-block li,
#synapse-ai-block button,
#synapse-ai-block input,
#synapse-ai-block textarea,
#synapse-ai-block label {
    margin: 0;
    padding: 0;
    border: 0;
    outline: 0;
    font-size: 100%;
    vertical-align: baseline;
    background: transparent;
    text-decoration: none;
    box-sizing: border-box; /* Re-apply border-box */
    line-height: inherit; /* Inherit global line-height if possible or define */
    font-family: var(--synapse-font-primary);
    color: inherit; /* Inherit color from parent */
}
#synapse-ai-block ul { list-style: none; }


/* General Layout & Sections within Synapse AI Block */
#synapse-ai-block .synapse-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px; /* Consistent horizontal padding */
}
#synapse-ai-block .synapse-container-narrow {
    max-width: 800px;
}

#synapse-ai-block .synapse-section {
    padding: var(--synapse-section-padding-y) 0;
    position: relative;
    overflow: hidden;
}

#synapse-ai-block .synapse-dark-theme-section {
    background: linear-gradient(130deg, var(--synapse-color-dark-bg) 0%, var(--synapse-color-secondary-bg) 100%);
    color: var(--synapse-color-text-light);
}

#synapse-ai-block .synapse-light-theme-section {
    background-color: var(--synapse-color-light-bg);
    color: var(--synapse-color-text-dark); /* Dark text for light backgrounds */
}

#synapse-ai-block .synapse-section-title {
    font-size: clamp(2.2rem, 4vw, 3.5rem);
    font-weight: 700;
    text-align: center;
    margin-bottom: 40px;
    letter-spacing: -0.03em;
    color: var(--synapse-color-text-light); /* Default for titles on dark bg */
    position: relative;
}
#synapse-ai-block .synapse-light-theme-section .synapse-section-title {
    color: var(--synapse-color-text-dark);
}

#synapse-ai-block .synapse-section-title::after {
    content: '';
    display: block;
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, var(--synapse-color-accent-blue), var(--synapse-color-accent-green));
    margin: 20px auto 0;
    border-radius: 2px;
}

#synapse-ai-block .synapse-section-description {
    font-size: clamp(1.05rem, 2vw, 1.25rem);
    color: var(--synapse-color-text-medium); /* Default for dark sections */
    text-align: center;
    margin-bottom: 60px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}
#synapse-ai-block .synapse-light-theme-section .synapse-section-description {
    color: var(--synapse-color-text-dark);
}


/* Hero Section */
#synapse-ai-block .hero-section {
    height: 100vh;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #ffffff;
    background: linear-gradient(130deg, var(--synapse-color-dark-bg) 0%, var(--synapse-color-secondary-bg) 100%);
}

#synapse-ai-block .synapse-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(200px);
    opacity: 0.1;
}
#synapse-ai-block .synapse-blob-1 {
    width: 600px; height: 600px; background: rgba(85, 200, 255, 0.15); top: -180px; left: -180px; transform: rotate(25deg); animation: synapse-glow1 10s infinite alternate;
}
#synapse-ai-block .synapse-blob-2 {
    width: 500px; height: 500px; background: rgba(255, 120, 200, 0.12); bottom: -160px; right: -140px; transform: rotate(-15deg); animation: synapse-glow2 12s infinite alternate;
}
@keyframes synapse-glow1 { 0% { transform: translate(0, 0) rotate(25deg); opacity: 0.1; } 50% { transform: translate(25px, 25px) rotate(30deg); opacity: 0.18; } 100% { transform: translate(0, 0) rotate(25deg); opacity: 0.1; } }
@keyframes synapse-glow2 { 0% { transform: translate(0, 0) rotate(-15deg); opacity: 0.08; } 50% { transform: translate(-20px, -20px) rotate(-20deg); opacity: 0.15; } 100% { transform: translate(0, 0) rotate(-15deg); opacity: 0.08; } }

#synapse-ai-block .synapse-hero-content {
    max-width: 900px; z-index: 2;
}
#synapse-ai-block .synapse-hero-title {
    font-size: clamp(3rem, 7.5vw, 5.5rem); font-weight: 800; letter-spacing: -0.04em; margin: 0 0 1.2rem; line-height: 1.1;
    background: linear-gradient(90deg, var(--synapse-color-accent-blue), var(--synapse-color-accent-green));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent; display: inline-block;
}
#synapse-ai-block .synapse-hero-subtitle {
    font-size: clamp(1.15rem, 2.8vw, 1.65rem); font-weight: 400; line-height: 1.6; margin: 0 0 3.5rem; opacity: 0.85; max-width: 700px; margin-left: auto; margin-right: auto;
}
#synapse-ai-block .synapse-hero-buttons {
    display: flex; gap: 20px; justify-content: center; flex-wrap: wrap;
}
#synapse-ai-block .synapse-mobile-break { display: none; }


/* Buttons */
#synapse-ai-block .synapse-btn {
    display: inline-block; padding: 1.1rem 3.2rem; font-weight: 600; font-size: 1.1rem; border-radius: 12px; text-decoration: none;
    box-shadow: 0 6px 20px rgba(0,0,0,0.3); transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.3s ease; border: none; cursor: pointer; color: #ffffff;
}
#synapse-ai-block .synapse-btn:hover {
    transform: translateY(-6px); box-shadow: 0 12px 28px rgba(0,0,0,0.4);
}

#synapse-ai-block .synapse-primary-btn {
    background: linear-gradient(90deg, var(--synapse-color-accent-blue) 0%, var(--synapse-color-accent-green) 100%);
}
#synapse-ai-block .synapse-primary-btn:hover {
    background: linear-gradient(90deg, var(--synapse-color-accent-green) 0%, var(--synapse-color-accent-blue) 100%);
}

#synapse-ai-block .synapse-secondary-btn {
    background: rgba(255, 255, 255, 0.1); border: 1px solid rgba(255, 255, 255, 0.2);
}
#synapse-ai-block .synapse-secondary-btn:hover {
    background: rgba(255, 255, 255, 0.2); border-color: rgba(255, 255, 255, 0.4);
}

#synapse-ai-block .synapse-accent-btn { /* Re-used for CTA/Submit */
    background: linear-gradient(90deg, var(--synapse-color-accent-blue) 0%, var(--synapse-color-accent-green) 100%);
}
#synapse-ai-block .synapse-accent-btn:hover {
    background: linear-gradient(90deg, var(--synapse-color-accent-green) 0%, var(--synapse-color-accent-blue) 100%);
}


/* Grid for Cards */
#synapse-ai-block .synapse-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); /* Responsive grid columns */
    gap: 30px;
    justify-items: center; /* Center cards in their grid cells */
}

/* Card Styles */
#synapse-ai-block .synapse-card {
    background-color: var(--synapse-color-card-bg-dark);
    border: 1px solid var(--synapse-color-card-border-dark);
    border-radius: 18px;
    padding: 40px;
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    position: relative;
    overflow: hidden;
    box-shadow: 0 8px 20px rgba(0,0,0,0.4);
}
/* Card styles for light background sections */
#synapse-ai-block .synapse-light-theme-section .synapse-card {
    background-color: var(--synapse-color-card-bg-light);
    border-color: var(--synapse-color-card-border-light);
    color: var(--synapse-color-text-dark);
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
}

#synapse-ai-block .synapse-card::before {
    content: ''; position: absolute; top: -50%; left: -50%; width: 200%; height: 200%;
    background: radial-gradient(circle at center, rgba(0,201,255,0.05) 0%, transparent 70%);
    transform: rotate(45deg); opacity: 0; transition: opacity 0.4s ease; z-index: 0;
}
#synapse-ai-block .synapse-card:hover::before { opacity: 1; }
#synapse-ai-block .synapse-card:hover {
    transform: translateY(-8px); box-shadow: 0 15px 30px rgba(0,0,0,0.4); border-color: rgba(255, 255, 255, 0.2);
}
#synapse-ai-block .synapse-light-theme-section .synapse-card:hover {
    box-shadow: 0 15px 30px rgba(0,0,0,0.2); border-color: rgba(0,0,0,0.15);
}

#synapse-ai-block .synapse-icon {
    background: linear-gradient(135deg, rgba(0,201,255,0.1), rgba(146,254,157,0.1));
    width: 70px; height: 70px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
    margin: 0 auto 25px; font-size: 2.2rem;
    box-shadow: inset 0 0 10px rgba(0,201,255,0.2), 0 0 15px rgba(0,201,255,0.2);
    transition: background 0.3s ease;
}
#synapse-ai-block .synapse-card:hover .synapse-icon { background: linear-gradient(135deg, rgba(0,201,255,0.2), rgba(146,254,157,0.2)); }
#synapse-ai-block .synapse-light-theme-section .synapse-icon {
    background: linear-gradient(135deg, rgba(0,201,255,0.05), rgba(146,254,157,0.05));
    box-shadow: inset 0 0 10px rgba(0,0,0,0.05), 0 0 15px rgba(0,0,0,0.05);
    color: var(--synapse-color-accent-blue);
}
#synapse-ai-block .synapse-light-theme-section .synapse-card:hover .synapse-icon { background: linear-gradient(135deg, rgba(0,201,255,0.1), rgba(146,254,157,0.1)); }


#synapse-ai-block .synapse-card h3 {
    font-size: 1.8rem; font-weight: 600; margin-bottom: 15px; color: var(--synapse-color-text-light); letter-spacing: -0.02em;
}
#synapse-ai-block .synapse-light-theme-section .synapse-card h3 { color: var(--synapse-color-text-dark); }

#synapse-ai-block .synapse-card p {
    font-size: 1.05rem; color: var(--synapse-color-text-medium); margin-bottom: 25px; opacity: 0.9;
}
#synapse-ai-block .synapse-light-theme-section .synapse-card p { color: var(--synapse-color-text-dark); }


/* Status Tags */
#synapse-ai-block .synapse-status-tag {
    display: inline-block; padding: 8px 18px; border-radius: 20px; font-size: 0.85rem; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.05em; color: #fff; opacity: 0.9; background-color: rgba(255,255,255,0.1);
}
#synapse-ai-block .synapse-status-live { background: linear-gradient(90deg, #28a745, #218838); box-shadow: 0 2px 10px rgba(40, 167, 69, 0.3); }
#synapse-ai-block .synapse-status-deploying { background: linear-gradient(90deg, #ffc107, #e0a800); box-shadow: 0 2px 10px rgba(255, 193, 7, 0.3); }
#synapse-ai-block .synapse-status-beta { background: linear-gradient(90deg, #007bff, #0056b3); box-shadow: 0 2px 10px rgba(0, 123, 255, 0.3); }
#synapse-ai-block .synapse-status-evolving { background: linear-gradient(90deg, #6f42c1, #5a2890); box-shadow: 0 2px 10px rgba(111, 66, 193, 0.3); }
#synapse-ai-block .synapse-status-exploring { background: linear-gradient(90deg, #dc3545, #bd2130); box-shadow: 0 2px 10px rgba(220, 53, 69, 0.3); }
#synapse-ai-block .synapse-status-frontier { background: linear-gradient(90deg, #17a2b8, #138496); box-shadow: 0 2px 10px rgba(23, 162, 184, 0.3); }


/* Call to Action (CTA) */
#synapse-ai-block .synapse-cta-section {
    background: linear-gradient(135deg, var(--synapse-color-dark-bg), var(--synapse-color-secondary-bg));
    text-align: center;
    padding: var(--synapse-section-padding-y) 0;
    border-top: 1px solid rgba(255,255,255,0.05);
}

#synapse-ai-block .synapse-cta-title {
    font-size: clamp(2rem, 4vw, 3.2rem); font-weight: 700; color: #fff; margin-bottom: 20px; letter-spacing: -0.03em;
}
#synapse-ai-block .synapse-cta-subtitle {
    font-size: clamp(1.1rem, 2.2vw, 1.4rem); color: var(--synapse-color-text-medium); margin-bottom: 40px; max-width: 600px; margin-left: auto; margin-right: auto;
}


/* MODAL STYLES (Adjusted for Synapse Isolation) */
#synapse-ai-block .synapse-modal {
    display: none; /* Hidden by default */
    position: fixed; /* Stay in place */
    z-index: 10000; /* Super high z-index to be above everything */
    left: 0;
    top: 0;
    width: 100%; height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.7);
    display: flex; /* Use flexbox to center content */
    align-items: center; justify-content: center;
}

#synapse-ai-block .synapse-modal-content {
    background-color: var(--synapse-color-card-bg-dark);
    margin: auto; padding: 40px; border-radius: 18px;
    border: 1px solid var(--synapse-color-card-border-dark);
    width: 90%; max-width: 500px; position: relative;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    animation: synapse-fadeIn 0.3s ease-out; /* Use unique keyframe name */
    color: var(--synapse-color-text-light); /* Ensure modal content has light text */
}

@keyframes synapse-fadeIn {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

#synapse-ai-block .synapse-close-button {
    color: var(--synapse-color-text-medium); font-size: 32px; font-weight: bold;
    position: absolute; top: 15px; right: 25px; cursor: pointer;
    transition: color 0.2s ease;
}
#synapse-ai-block .synapse-close-button:hover,
#synapse-ai-block .synapse-close-button:focus { color: var(--synapse-color-accent-blue); }

#synapse-ai-block .synapse-modal-content h3 {
    font-size: 2.2rem; color: var(--synapse-color-text-light); margin-bottom: 15px; text-align: center;
}
#synapse-ai-block .synapse-modal-content p {
    font-size: 1rem; color: var(--synapse-color-text-medium); margin-bottom: 30px; text-align: center; line-height: 1.5;
}

#synapse-ai-block .synapse-contact-form .synapse-form-group { margin-bottom: 20px; }
#synapse-ai-block .synapse-contact-form label {
    display: block; margin-bottom: 8px; font-size: 0.95rem; color: var(--synapse-color-text-light); font-weight: 600;
}
#synapse-ai-block .synapse-contact-form input[type="text"],
#synapse-ai-block .synapse-contact-form input[type="email"],
#synapse-ai-block .synapse-contact-form input[type="password"], /* Added for password modal */
#synapse-ai-block .synapse-contact-form textarea {
    width: 100%; padding: 12px 15px; background-color: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.15); border-radius: 8px; color: var(--synapse-color-text-light);
    font-family: var(--synapse-font-primary); font-size: 1rem;
    transition: border-color 0.2s ease, background-color 0.2s ease;
}
#synapse-ai-block .synapse-contact-form input[type="text"]:focus,
#synapse-ai-block .synapse-contact-form input[type="email"]:focus,
#synapse-ai-block .synapse-contact-form input[type="password"]:focus,
#synapse-ai-block .synapse-contact-form textarea:focus {
    outline: none; border-color: var(--synapse-color-accent-blue); background-color: rgba(255,255,255,0.12);
}
#synapse-ai-block .synapse-contact-form textarea { resize: vertical; min-height: 120px; }

#synapse-ai-block .synapse-submit-btn {
    width: 100%; padding: 15px 0; font-size: 1.1rem; margin-top: 10px;
}
#synapse-ai-block .synapse-modal-email-tip {
    margin-top: 25px; font-size: 0.9rem; color: var(--synapse-color-text-medium);
}
#synapse-ai-block .synapse-modal-email-tip a {
    color: var(--synapse-color-accent-blue); font-weight: 600;
}
#synapse-ai-block .synapse-modal-email-tip a:hover { text-decoration: underline; }


/* Responsive Adjustments for Synapse AI Block */
@media (max-width: 991px) {
    #synapse-ai-block .synapse-section-title { margin-bottom: 40px; }
    #synapse-ai-block .synapse-section-description { margin-bottom: 50px; }
    #synapse-ai-block .synapse-card { padding: 30px; }
    #synapse-ai-block .synapse-card h3 { font-size: 1.6rem; }
    #synapse-ai-block .synapse-card p { font-size: 1rem; }
    #synapse-ai-block .synapse-hero-buttons { flex-direction: column; gap: 15px; }
}

@media (max-width: 550px) {
    #synapse-ai-block .synapse-mobile-break { display: block; }
    #synapse-ai-block .synapse-hero-title { font-size: 2.8rem; }
    #synapse-ai-block .synapse-hero-subtitle { font-size: 1rem; }
    #synapse-ai-block .synapse-section-title { font-size: 2rem; }
    #synapse-ai-block .synapse-grid { grid-template-columns: 1fr; }
    #synapse-ai-block .synapse-modal-content { padding: 30px; }
    #synapse-ai-block .synapse-modal-content h3 { font-size: 1.8rem; }
    #synapse-ai-block .synapse-hero-btn,
    #synapse-ai-block .synapse-btn.synapse-accent-btn { width: 100%; padding: 1rem 2rem; font-size: 1.05rem; }
}