/* TerraForge Page Specific Styles */

/* Custom accent color for industrial/construction feel */
:root {
    --terra-accent: #ff9500;
    --terra-accent-glow: rgba(255, 149, 0, 0.3);
}

/* Override global card glow to use orange instead of green */
.autonomy-engine-section [data-card]::before,
.cicd-section [data-card]::before,
.sensor-section [data-card]::before,
.multiagent-section [data-card]::before {
    background: radial-gradient(calc(600px * var(--glow-intensity, 0.8)) circle at var(--mouse-x) var(--mouse-y),
            rgba(255, 149, 0, calc(1.2 * var(--glow-intensity, 0))) 0%,
            rgba(255, 204, 0, calc(0.8 * var(--glow-intensity, 0))) 20%,
            rgba(255, 255, 255, calc(0.3 * var(--glow-intensity, 0))) 35%,
            rgba(255, 149, 0, calc(0.2 * var(--glow-intensity, 0))) 50%,
            transparent 70%);
}

/* Hero Section */
.terraforge-hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    padding-top: 100px;
    padding-bottom: 100px;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.7) 0%, rgba(0, 0, 0, 0.9) 100%),
        url('../assets/terraforge/hero-bg.jpeg') center/cover no-repeat;
}

.terraforge-hero .hero-title {
    background: linear-gradient(135deg, #ff9500 0%, #ffcc00 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.terraforge-hero .hero-subtitle {
    font-size: clamp(1.2rem, 3vw, 2rem);
    color: var(--terra-accent);
    margin-bottom: 20px;
    font-family: var(--font-primary);
}

/* Autonomy Engine Section */
.autonomy-engine-section {
    padding: 100px 0;
}

.section-intro {
    text-align: center;
    max-width: 900px;
    margin: 0 auto 40px;
    color: var(--text-secondary);
    font-size: 1.15rem;
    line-height: 1.7;
}

.value-prop-box {
    background: linear-gradient(135deg, rgba(255, 149, 0, 0.08) 0%, rgba(255, 204, 0, 0.03) 100%);
    border: 1px solid rgba(255, 149, 0, 0.2);
    border-radius: 15px;
    padding: 40px;
    max-width: 900px;
    margin: 0 auto 60px;
}

.value-prop-box h3 {
    color: var(--terra-accent);
    font-family: var(--font-primary);
    font-size: 1.5rem;
    margin-bottom: 20px;
    text-align: center;
}

.value-prop-box p {
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 15px;
}

.value-prop-box p:last-child {
    margin-bottom: 0;
}

.value-prop-box strong {
    color: var(--terra-accent);
}

/* Flywheel Visualization */
.flywheel-container {
    position: relative;
    width: 100%;
    max-width: 700px;
    height: 500px;
    margin: 60px auto;
}

.flywheel-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
}

.flywheel-core {
    width: 120px;
    height: 120px;
    background: var(--bg-secondary);
    border: 2px solid var(--terra-accent);
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 40px var(--terra-accent-glow);
}

.flywheel-core svg {
    width: 40px;
    height: 40px;
    color: var(--terra-accent);
    margin-bottom: 5px;
}

.flywheel-core span {
    font-size: 0.7rem;
    color: var(--text-secondary);
    text-align: center;
}

.flywheel-quadrants {
    position: absolute;
    inset: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    grid-template-areas:
        "q1 q2"
        "q4 q3";
    gap: 80px;
    padding: 20px;
}

/* Position quadrants for clockwise flow: 1→2→3→4 */
.quadrant-1 {
    grid-area: q1;
}

.quadrant-2 {
    grid-area: q2;
}

.quadrant-3 {
    grid-area: q3;
}

.quadrant-4 {
    grid-area: q4;
}

.flywheel-quadrant {
    background: var(--bg-secondary);
    border: 1px solid rgba(255, 149, 0, 0.2);
    border-radius: 15px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    transition: all 0.3s ease;
}

.flywheel-quadrant:hover {
    border-color: var(--terra-accent);
    box-shadow: 0 10px 30px var(--terra-accent-glow);
}

.quadrant-number {
    width: 30px;
    height: 30px;
    background: linear-gradient(135deg, #ff9500 0%, #ffcc00 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-primary);
    font-weight: 700;
    color: var(--bg-primary);
    font-size: 0.9rem;
    margin-bottom: 10px;
}

.flywheel-quadrant h4 {
    color: var(--terra-accent);
    font-size: 1rem;
    margin-bottom: 5px;
}

.quadrant-subtitle {
    color: var(--text-secondary);
    font-size: 0.8rem;
    margin: 0;
}

/* Flywheel Arrows */
.flywheel-arrows {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.flywheel-arrows .arrow {
    position: absolute;
    font-size: 2rem;
    color: var(--terra-accent);
    opacity: 0.6;
}

.arrow-1 {
    top: 30%;
    left: 50%;
    transform: translateX(-50%) rotate(0deg);
}

.arrow-2 {
    top: 50%;
    right: 15%;
    transform: translateY(-50%) rotate(90deg);
}

.arrow-3 {
    bottom: 30%;
    left: 50%;
    transform: translateX(-50%) rotate(180deg);
}

.arrow-4 {
    top: 50%;
    left: 15%;
    transform: translateY(-50%) rotate(270deg);
}

/* Stage Details Grid */
.stage-details-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
    margin-top: 60px;
}

.stage-detail {
    background: var(--bg-secondary);
    border: 1px solid rgba(255, 149, 0, 0.1);
    border-radius: 15px;
    padding: 30px;
    transition: all 0.3s ease;
}

.stage-detail:hover {
    border-color: var(--terra-accent);
    transform: translateY(-5px);
}

.stage-icon {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, rgba(255, 149, 0, 0.2) 0%, rgba(255, 204, 0, 0.1) 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}

.stage-icon svg {
    width: 28px;
    height: 28px;
    color: var(--terra-accent);
}

.stage-detail h4 {
    color: var(--text-primary);
    font-size: 1.1rem;
    margin-bottom: 8px;
}

.stage-label {
    color: var(--terra-accent);
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 15px !important;
}

.stage-detail p {
    color: var(--text-secondary);
    line-height: 1.7;
    font-size: 0.95rem;
}

/* Responsive for Flywheel */
@media (max-width: 768px) {
    .flywheel-container {
        height: auto;
        padding: 20px 0;
    }

    .flywheel-quadrants {
        position: relative;
        gap: 20px;
        padding: 0;
    }

    .flywheel-center {
        display: none;
    }

    .flywheel-arrows {
        display: none;
    }

    .stage-details-grid {
        grid-template-columns: 1fr;
    }
}

/* Pipeline Section (legacy, keep for compatibility) */
.pipeline-section {
    padding: 100px 0;
}

.pipeline-visual {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
    margin: 60px 0;
}

.pipeline-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    background: var(--bg-secondary);
    border: 1px solid rgba(255, 149, 0, 0.2);
    border-radius: 15px;
    padding: 25px 20px;
    width: 200px;
    min-height: 160px;
    transition: all 0.3s ease;
}

.pipeline-step:hover {
    border-color: var(--terra-accent);
    transform: translateY(-5px);
    box-shadow: 0 10px 30px var(--terra-accent-glow);
}

.pipeline-step .step-number {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #ff9500 0%, #ffcc00 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-primary);
    font-weight: 700;
    color: var(--bg-primary);
    margin-bottom: 15px;
}

.pipeline-step h4 {
    color: var(--terra-accent);
    margin-bottom: 10px;
    font-size: 1rem;
}

.pipeline-step p {
    color: var(--text-secondary);
    font-size: 0.85rem;
    line-height: 1.5;
}

.pipeline-arrow {
    color: var(--terra-accent);
    font-size: 2rem;
    opacity: 0.6;
}

.pipeline-image {
    width: 100%;
    max-width: 1000px;
    margin: 40px auto;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

.pipeline-image img {
    width: 100%;
    height: auto;
    display: block;
}

.feature-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 60px;
}

.terra-feature-card {
    background: var(--bg-secondary);
    border: 1px solid rgba(255, 149, 0, 0.1);
    border-radius: 15px;
    padding: 30px;
    transition: all 0.3s ease;
}

.terra-feature-card:hover {
    border-color: var(--terra-accent);
    transform: translateY(-5px);
}

.terra-feature-card h4 {
    color: var(--terra-accent);
    margin-bottom: 15px;
    font-size: 1.2rem;
}

.terra-feature-card p {
    color: var(--text-secondary);
    line-height: 1.7;
}

/* CI/CD Section */
.cicd-section {
    padding: 100px 0;
}

.cicd-image {
    width: 100%;
    max-width: 1100px;
    margin: 40px auto;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

.cicd-image img {
    width: 100%;
    height: auto;
    display: block;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 30px;
    margin: 60px 0;
}

.stat-card {
    text-align: center;
    padding: 30px 20px;
    background: var(--bg-secondary);
    border-radius: 15px;
    border: 1px solid rgba(255, 149, 0, 0.1);
}

.stat-card .stat-value {
    font-family: var(--font-primary);
    font-size: 3rem;
    font-weight: 900;
    background: linear-gradient(135deg, #ff9500 0%, #ffcc00 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: block;
    margin-bottom: 10px;
}

.stat-card .stat-label {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.benefits-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 25px;
    margin-top: 40px;
}

.benefit-item {
    display: flex;
    gap: 15px;
    align-items: flex-start;
    padding: 20px;
    background: rgba(255, 149, 0, 0.05);
    border-radius: 10px;
    border-left: 3px solid var(--terra-accent);
}

.benefit-item .benefit-icon {
    width: 40px;
    height: 40px;
    color: var(--terra-accent);
    flex-shrink: 0;
}

.benefit-item h4 {
    color: var(--text-primary);
    margin-bottom: 8px;
}

.benefit-item p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.6;
}

/* Sensor Section */
.sensor-section {
    padding: 100px 0;
}

.sensor-comparison {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin: 60px 0;
}

.sensor-panel {
    border-radius: 15px;
    overflow: hidden;
    position: relative;
}

.sensor-panel img {
    width: 100%;
    height: auto;
    display: block;
}

.sensor-panel .panel-label {
    position: absolute;
    bottom: 20px;
    left: 20px;
    background: rgba(0, 0, 0, 0.8);
    padding: 10px 20px;
    border-radius: 5px;
    font-family: var(--font-primary);
    font-size: 0.9rem;
}

.sensor-panel.clean .panel-label {
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
}

.sensor-panel.degraded .panel-label {
    color: var(--terra-accent);
    border: 1px solid var(--terra-accent);
}

.sensor-full-image {
    width: 100%;
    max-width: 900px;
    margin: 40px auto;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

.sensor-full-image img {
    width: 100%;
    height: auto;
    display: block;
}

.sensor-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    margin-top: 60px;
}

.sensor-feature {
    background: var(--bg-secondary);
    padding: 25px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.sensor-feature h4 {
    color: var(--terra-accent);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.sensor-feature h4 svg {
    width: 24px;
    height: 24px;
}

.sensor-feature p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
}

.sensor-feature-image {
    width: 100%;
    height: 180px;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 15px;
}

.sensor-feature-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.sensor-feature:hover .sensor-feature-image img {
    transform: scale(1.05);
}

/* Multi-Agent Section */
.multiagent-section {
    padding: 100px 0;
}

.fleet-hero-image {
    width: 100%;
    max-width: 1100px;
    margin: 40px auto;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5);
}

.fleet-hero-image img {
    width: 100%;
    height: auto;
    display: block;
}

.fleet-capabilities {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    margin-top: 60px;
}

.capability-column {
    background: var(--bg-secondary);
    border-radius: 15px;
    padding: 30px;
    border: 1px solid rgba(255, 149, 0, 0.1);
}

.capability-column h3 {
    color: var(--terra-accent);
    margin-bottom: 20px;
    font-size: 1.3rem;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.capability-column ul {
    list-style: none;
    padding: 0;
}

.capability-column li {
    color: var(--text-secondary);
    padding: 10px 0;
    padding-left: 25px;
    position: relative;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.capability-column li:last-child {
    border-bottom: none;
}

.capability-column li::before {
    content: '→';
    position: absolute;
    left: 0;
    color: var(--terra-accent);
}

/* CTA Section */
.terraforge-cta {
    padding: 80px 0;
    text-align: center;
    background: linear-gradient(180deg, transparent 0%, rgba(255, 149, 0, 0.05) 100%);
}

.terraforge-cta h2 {
    font-family: var(--font-primary);
    font-size: 2.5rem;
    margin-bottom: 20px;
    background: linear-gradient(135deg, #ff9500 0%, #ffcc00 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.terraforge-cta p {
    color: var(--text-secondary);
    font-size: 1.2rem;
    max-width: 600px;
    margin: 0 auto 40px;
}

.terraforge-cta .cta-button {
    border-color: var(--terra-accent);
    color: var(--terra-accent);
}

.terraforge-cta .cta-button::before {
    background: var(--terra-accent);
}

.terraforge-cta .cta-button:hover {
    color: var(--bg-primary);
    box-shadow: 0 10px 30px var(--terra-accent-glow);
}

/* Responsive */
@media (max-width: 900px) {
    .sensor-comparison {
        grid-template-columns: 1fr;
    }

    .fleet-capabilities {
        grid-template-columns: 1fr;
    }

    .pipeline-visual {
        flex-direction: column;
    }

    .pipeline-arrow {
        transform: rotate(90deg);
    }

    .pipeline-step {
        max-width: 100%;
        width: 100%;
    }
}

@media (max-width: 600px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .stat-card .stat-value {
        font-size: 2rem;
    }

    .benefits-list {
        grid-template-columns: 1fr;
    }
}