/* AI Automation Services Section */
.ai-services-section {
    padding: 20px 20px 50px 20px;
    opacity: 1;
    transition: opacity 0.5s ease-in-out;
}

.ai-services-section.fade-out {
    opacity: 0;
}

.ai-services-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 30px;
}

/* Top Row */
.ai-services-top {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    align-items: stretch;
}

/* Left Column */
.ai-services-left {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.ai-services-title {
    font-family: "Satoshi-Bold", sans-serif;
    font-size: clamp(32px, 4vw, 44px);
    font-weight: 700;
    color: #1a1a1a;
    margin: 0;
    line-height: 1.2;
}

.ai-services-features-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 12px;
}

.feature-item i {
    font-size: 14px;
    color: #6B46C1;
}

.feature-item p {
    font-family: "Satoshi-Regular", sans-serif;
    font-size: 15px;
    color: #444;
    margin: 0;
}

.feature-item strong {
    font-family: "Satoshi-Medium", sans-serif;
    color: #6B46C1;
}

/* Feature Cards Row */
.feature-cards-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.feature-card {
    background: rgba(255, 255, 255, 0.7);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 4px 20px rgba(107, 70, 193, 0.06);
    position: relative;
    overflow: hidden;
}

.feature-card::before {
    content: '';
    position: absolute;
    width: 500px;
    height: 350px;
    background: radial-gradient(50% 50%, rgba(66, 34, 142, 0.15) 0%, rgba(255, 255, 240, 0) 100%);
    top: calc(60% - 175px);
    left: calc(50% - 250px);
    pointer-events: none;
    z-index: 0;
}

.feature-card > * {
    position: relative;
    z-index: 1;
}

.feature-card-icon {
    width: 48px;
    height: 48px;
    background: rgba(107, 70, 193, 0.08);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}

.feature-card-icon i {
    font-size: 24px;
    color: #6B46C1;
}

.feature-card-title {
    font-family: "Satoshi-Bold", sans-serif;
    font-size: 18px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 10px 0;
}

.feature-card-desc {
    font-family: "Satoshi-Regular", sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: #666;
    margin: 0;
}

/* Right Column - Workflow Card */
.ai-services-right {
    display: flex;
}

.workflow-card {
    flex: 1;
    background: rgba(255, 255, 255, 0.7);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 4px 20px rgba(107, 70, 193, 0.06);
    position: relative;
    overflow: hidden;
}

.workflow-card::before {
    content: '';
    position: absolute;
    width: 600px;
    height: 400px;
    background: radial-gradient(50% 50%, rgba(139, 92, 246, 0.12) 0%, rgba(255, 255, 240, 0) 100%);
    top: calc(55% - 200px);
    right: calc(45% - 300px);
    pointer-events: none;
    z-index: 0;
}

.workflow-card > * {
    position: relative;
    z-index: 1;
}

.workflow-title {
    font-family: "Satoshi-Bold", sans-serif;
    font-size: 22px;
    font-weight: 700;
    margin: 0 0 8px 0;
    color: #1a1a1a;
}

.workflow-subtitle {
    font-family: "Satoshi-Regular", sans-serif;
    font-size: 14px;
    color: #666;
    margin: 0 0 30px 0;
}

/* Orbit Animation Container */
.orbit-container {
    position: relative;
    width: 100%;
    height: 300px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.orbit-rings {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
}

.orbit-center-glow {
    position: absolute;
    width: 140px;
    height: 140px;
    background: radial-gradient(circle, rgba(107, 70, 193, 0.08) 0%, transparent 70%);
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.orbit-track {
    position: absolute;
    width: 240px;
    height: 240px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: orbitSpin 20s linear infinite;
}

.orbit-track.orbit-paused {
    animation-play-state: paused;
}

@keyframes orbitSpin {
    from {
        transform: translate(-50%, -50%) rotate(0deg);
    }
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

.orbit-item {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
}

.orbit-item-1 {
    transform: rotate(0deg);
}

.orbit-item-2 {
    transform: rotate(60deg);
}

.orbit-item-3 {
    transform: rotate(120deg);
}

.orbit-item-4 {
    transform: rotate(180deg);
}

.orbit-item-5 {
    transform: rotate(240deg);
}

.orbit-item-6 {
    transform: rotate(300deg);
}

.orbit-icon {
    position: absolute;
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid rgba(107, 70, 193, 0.3);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    top: -22px;
    left: 50%;
    transform: translateX(-50%);
    animation: counterSpin 20s linear infinite;
    box-shadow: 0 4px 12px rgba(107, 70, 193, 0.15);
}

.orbit-icon.orbit-icon-paused {
    animation-play-state: paused;
}

@keyframes counterSpin {
    from {
        transform: translateX(-50%) rotate(0deg);
    }
    to {
        transform: translateX(-50%) rotate(-360deg);
    }
}

.orbit-icon i {
    font-size: 20px;
    color: #6B46C1;
}

.orbit-center-btn {
    --border-radius: 30px;
    --padding: 4px;
    --transition: 0.4s;
    --button-gradient-start: #381a7d;
    --button-gradient-mid1: #6342b0;
    --button-gradient-mid2: #7B51D8;
    --button-gradient-end: #8B5CF6;

    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    -webkit-user-select: none;
    user-select: none;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    padding: 10px 22px;
    font-family: "Satoshi-Regular", sans-serif;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    color: rgba(255, 255, 255, 0.9);
    
    background: linear-gradient(150deg, var(--button-gradient-start) 0%, var(--button-gradient-mid1) 30%, var(--button-gradient-mid2) 60%, var(--button-gradient-end) 100%);
    
    box-shadow:
        inset 0px 1px 1px rgba(255, 255, 255, 0.2),
        inset 0px 2px 2px rgba(255, 255, 255, 0.15),
        inset 0px 4px 4px rgba(255, 255, 255, 0.1),
        0 4px 15px rgba(107, 70, 193, 0.3);
    
    border: solid 1px rgba(255, 255, 255, 0.2);
    border-radius: var(--border-radius);
    cursor: pointer;
    white-space: nowrap;
    z-index: 10;
    
    transition:
        box-shadow var(--transition),
        border var(--transition),
        background var(--transition);
}

.orbit-center-btn::before {
    content: "";
    position: absolute;
    top: calc(0px - var(--padding));
    left: calc(0px - var(--padding));
    width: calc(100% + var(--padding) * 2);
    height: calc(100% + var(--padding) * 2);
    border-radius: calc(var(--border-radius) + var(--padding));
    pointer-events: none;
    background-image: linear-gradient(0deg, rgba(107, 70, 193, 0.3), rgba(107, 70, 193, 0.6));
    z-index: -1;
    transition:
        box-shadow var(--transition),
        filter var(--transition);
    box-shadow:
        0 -8px 8px -6px #0000 inset,
        0 -16px 16px -8px #00000000 inset,
        1px 1px 1px rgba(255, 255, 255, 0.2),
        2px 2px 2px rgba(255, 255, 255, 0.1),
        -1px -1px 1px rgba(0, 0, 0, 0.2),
        -2px -2px 2px rgba(0, 0, 0, 0.1);
}

.orbit-center-btn i {
    font-size: 18px;
}

.orbit-center-btn:hover {
    box-shadow:
        inset 0px 1px 1px rgba(255, 255, 255, 0.2),
        inset 0px 2px 2px rgba(255, 255, 255, 0.15),
        inset 0px 4px 4px rgba(255, 255, 255, 0.1),
        0 6px 20px rgba(107, 70, 193, 0.45);
}

/* Remove old workflow styles */
.workflow-diagram {
    display: none;
}

.workflow-lines,
.workflow-icons,
.workflow-center,
.workflow-center-bg,
.workflow-btn {
    display: none;
}

/* Bottom Row */
.ai-services-bottom {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

/* Code Editor Card */
.code-editor-card {
    background: rgba(255, 255, 255, 0.7);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 4px 20px rgba(107, 70, 193, 0.06);
    position: relative;
    overflow: hidden;
}

.code-editor-card::before {
    content: '';
    position: absolute;
    width: 770px;
    height: 487px;
    background: radial-gradient(50% 50%, rgba(66, 34, 142, 0.39) 0%, rgba(255, 255, 240, 0) 100%);
    top: calc(53% - 243.5px);
    left: calc(30% - 385px);
    pointer-events: none;
    z-index: 0;
}

.code-editor-card > * {
    position: relative;
    z-index: 1;
}

.code-card-title {
    font-family: "Satoshi-Bold", sans-serif;
    font-size: 22px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 8px 0;
}

.code-card-subtitle {
    font-family: "Satoshi-Regular", sans-serif;
    font-size: 14px;
    color: #666;
    margin: 0 0 24px 0;
}

/* Terminal Styling */
.code-terminal {
    background: #fafafa;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.06);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.04);
}

.terminal-header {
    display: flex;
    align-items: center;
    padding: 10px 16px;
    background: linear-gradient(180deg, #f5f5f5 0%, #ececec 100%);
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    gap: 12px;
}

.terminal-dots {
    display: flex;
    gap: 6px;
}

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

.terminal-dots .dot.red {
    background: #ff5f57;
}

.terminal-dots .dot.yellow {
    background: #ffbd2e;
}

.terminal-dots .dot.green {
    background: #28ca42;
}

.terminal-filename {
    font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
    font-size: 12px;
    color: #555;
    font-weight: 500;
}

.terminal-spacer {
    flex: 1;
}

.terminal-body {
    height: 330px;
    overflow: hidden;
    position: relative;
    background: #fafafa;
}

.terminal-body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 30px;
    background: linear-gradient(to bottom, #fafafa 0%, transparent 100%);
    z-index: 2;
    pointer-events: none;
}

.terminal-body::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 30px;
    background: linear-gradient(to top, #fafafa 0%, transparent 100%);
    z-index: 2;
    pointer-events: none;
}

.terminal-content {
    padding: 16px;
    font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
    font-size: 12px;
    line-height: 1.8;
    transition: opacity 0.8s ease;
}

.code-line {
    white-space: pre;
    display: block;
}

.line-num {
    display: inline-block;
    width: 32px;
    color: #aaa;
    -webkit-user-select: none;
    user-select: none;
    margin-right: 16px;
    text-align: right;
}

/* Syntax Highlighting */
.keyword {
    color: #7c3aed;
    font-weight: 600;
}

.string {
    color: #059669;
}

.function {
    color: #2563eb;
    font-weight: 500;
}

.class-name {
    color: #dc2626;
    font-weight: 600;
}

.param {
    color: #d97706;
}

.comment {
    color: #6b7280;
    font-style: italic;
}

.number {
    color: #7c3aed;
}

/* Old editor styles - keeping for compatibility */
.code-editor {
    background: #fafafa;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.06);
}

.code-editor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: #f5f5f5;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.code-filename {
    font-family: "Satoshi-Medium", sans-serif;
    font-size: 13px;
    color: #444;
}

.code-editor-actions {
    display: flex;
    gap: 12px;
}

.code-editor-actions i {
    font-size: 16px;
    color: #888;
    cursor: pointer;
    transition: color 0.2s ease;
}

.code-editor-actions i:hover {
    color: #6B46C1;
}

.code-editor-body {
    padding: 16px;
    overflow-x: auto;
}

.code-editor-body pre {
    margin: 0;
    font-family: 'Fira Code', 'Consolas', monospace;
    font-size: 12px;
    line-height: 1.7;
}

.code-editor-body code {
    display: block;
    white-space: pre;
}

.line-number {
    display: inline-block;
    width: 24px;
    color: #bbb;
    -webkit-user-select: none;
    user-select: none;
    margin-right: 16px;
}

/* Chatbot Card */
.chatbot-card {
    background: rgba(255, 255, 255, 0.7);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 4px 20px rgba(107, 70, 193, 0.06);
    position: relative;
    overflow: hidden;
}

.chatbot-card::before {
    content: '';
    position: absolute;
    width: 770px;
    height: 487px;
    background: radial-gradient(50% 50%, rgba(66, 34, 142, 0.39) 0%, rgba(255, 255, 240, 0) 100%);
    top: calc(48% - 243.5px);
    right: calc(25% - 385px);
    pointer-events: none;
    z-index: 0;
}

.chatbot-card > * {
    position: relative;
    z-index: 1;
}

.chatbot-title {
    font-family: "Satoshi-Bold", sans-serif;
    font-size: 22px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 8px 0;
}

.chatbot-subtitle {
    font-family: "Satoshi-Regular", sans-serif;
    font-size: 14px;
    color: #666;
    margin: 0 0 24px 0;
}

.chatbot-ui {
    background: #fafafa;
    border-radius: 12px;
    border: 1px solid rgba(0, 0, 0, 0.06);
    height: 400px;
    overflow: hidden;
}

.chatbot-ui iframe {
    display: block;
    width: 100%;
    height: 100%;
    border: none;
}

.chatbot-message {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.chatbot-message-icon {
    width: 36px;
    height: 36px;
    background: rgba(107, 70, 193, 0.1);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chatbot-message-icon i {
    font-size: 18px;
    color: #6B46C1;
}

.chatbot-message-text {
    font-family: "Satoshi-Medium", sans-serif;
    font-size: 14px;
    color: #1a1a1a;
    flex: 1;
}

.chatbot-message-dots {
    display: flex;
    gap: 4px;
}

.chatbot-message-dots .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ddd;
}

.chatbot-message-dots .dot.active {
    background: #6B46C1;
}

.chatbot-placeholder-lines {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}

.placeholder-line {
    height: 10px;
    background: linear-gradient(90deg, #eee 0%, #f5f5f5 50%, #eee 100%);
    border-radius: 5px;
}

.placeholder-line.short {
    width: 60%;
}

.chatbot-images {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 16px;
}

.chatbot-image-placeholder {
    aspect-ratio: 16 / 10;
    background: rgba(107, 70, 193, 0.05);
    border: 1px dashed rgba(107, 70, 193, 0.2);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chatbot-image-placeholder i {
    font-size: 28px;
    color: #a78bfa;
}

.chatbot-action-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: #fff;
    border-radius: 10px;
    border: 1px solid rgba(0, 0, 0, 0.06);
}

.chatbot-action-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.chatbot-action-left i {
    font-size: 18px;
    color: #888;
}

.chatbot-action-left span {
    font-family: "Satoshi-Regular", sans-serif;
    font-size: 14px;
    color: #666;
}

.chatbot-create-btn {
    background: linear-gradient(135deg, #6B46C1 0%, #8B5CF6 100%);
    border: none;
    border-radius: 8px;
    padding: 10px 20px;
    color: #fff;
    font-family: "Satoshi-Medium", sans-serif;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.chatbot-create-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(107, 70, 193, 0.3);
}

/* Responsive */
@media (max-width: 968px) {
    .ai-services-section {
        padding: 80px 20px;
    }
    
    .ai-services-top {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .ai-services-bottom {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .orbit-container {
        height: 260px;
    }
    
    .orbit-track {
        width: 200px;
        height: 200px;
    }
}

@media (max-width: 640px) {
    .ai-services-title {
        font-size: 28px;
    }
    
    .feature-cards-row {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .workflow-card {
        padding: 24px;
    }
    
    .orbit-container {
        max-width: 220px;
        height: 220px;
    }
    
    .orbit-track {
        width: 180px;
        height: 180px;
    }
    
    .orbit-icon {
        width: 32px;
        height: 32px;
    }
    
    .orbit-icon i {
        font-size: 14px;
    }
    
    .orbit-center-btn {
        padding: 10px 20px;
        font-size: 13px;
    }
    
    .code-editor-card,
    .chatbot-card {
        padding: 20px;
    }
    
    .terminal-content {
        font-size: 11px;
    }
    
    .chatbot-images {
        grid-template-columns: 1fr;
    }
}

/* Simulated chat (plays once) */
.chat-sim{display:flex;flex-direction:column-reverse;padding:20px;height:400px;box-sizing:border-box;overflow-y:auto;scrollbar-width:thin;background:#fafafa;border-radius:12px;border:1px solid rgba(0,0,0,.06)}
.chat-sim .cs-msg{flex:none;max-width:78%;padding:0 14px;border-radius:16px;font-size:14px;line-height:1.45;opacity:0;max-height:0;margin-top:0;overflow:hidden}
.chat-sim .cs-user{align-self:flex-end;background:#6b46c1;color:#fff;border-bottom-right-radius:4px}
.chat-sim .cs-bot{align-self:flex-start;background:#fff;color:#2d2d3a;border:1px solid rgba(0,0,0,.07);border-bottom-left-radius:4px;box-shadow:0 2px 8px rgba(107,70,193,.06)}
.chat-sim .cs-typing{display:flex;gap:4px;align-items:center}
.chat-sim .cs-typing i{width:6px;height:6px;border-radius:50%;background:#9b8bc9;animation:csDot 1s infinite}
.chat-sim .cs-typing i:nth-child(2){animation-delay:.15s}.chat-sim .cs-typing i:nth-child(3){animation-delay:.3s}
@keyframes csDot{0%,60%,100%{transform:translateY(0);opacity:.4}30%{transform:translateY(-4px);opacity:1}}
@keyframes csIn{from{opacity:0;max-height:0;margin-top:0;padding-top:0;padding-bottom:0;transform:translateY(8px)}to{opacity:1;max-height:200px;margin-top:10px;padding-top:10px;padding-bottom:10px;transform:none}}
@keyframes csOut{0%{opacity:0;max-height:0;margin-top:0;padding-top:0;padding-bottom:0}15%,85%{opacity:1;max-height:40px;margin-top:10px;padding-top:10px;padding-bottom:10px}100%{opacity:0;max-height:0;margin-top:0;padding-top:0;padding-bottom:0}}
/* plays once when the card enters the viewport (class added by JS) */
.chat-sim.play .cs-text{animation:csIn .5s ease var(--d) forwards}
.chat-sim.play .cs-typing{animation:csOut 1.6s ease var(--d) forwards}
@media (prefers-reduced-motion:reduce){.chat-sim .cs-text{opacity:1;max-height:none;margin-top:10px;padding:10px 14px;animation:none!important}.chat-sim .cs-typing{display:none}}

