/* How it Works Section */
.how-it-works-section {
    background: #123340;
    padding: 100px 0;
    position: relative;
    overflow: visible;
}

.how-it-works-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.section-wrapper {
    background: rgba(8, 32, 42, 0.5);
    border-radius: 20px;
    padding: 60px;
    margin-top: 0; /* Removed to ensure equal top/bottom section padding */
}

.section-content {
    display: flex;
    gap: 80px;
    align-items: center;
}

/* Left Column - Explanations */
.explanations-column {
    flex: 0 0 45%;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.section-header {
    text-align: center;
    margin-bottom: 60px;
}

.section-label {
    color: white;
    font-size: 38px;
    font-family: 'Adieu', sans-serif;
    font-weight: 400;
    margin-top: 16px; /* Match bottom margin */
    margin-bottom: 16px;
}

.section-subtitle {
    color: rgba(255, 255, 255, 0.8);
    font-size: 16px;
    font-family: 'Formular', sans-serif;
    line-height: 1.6;
    max-width: 600px;
    margin: 0 auto;
}

/* Explanation Cards */
.explanation-card {
    padding: 20px;
    border-radius: 20px;
    border: 1px solid transparent;
    transition: all 0.3s ease;
}

.explanation-card h3 {
    color: white;
    font-size: 17px;
    font-family: 'Adieu', sans-serif;
    font-weight: 400;
    margin: 0 0 10px 0;
}

.explanation-card p {
    color: white;
    font-size: 11px;
    font-family: 'Formular', sans-serif;
    line-height: 1.5;
    margin: 0;
}

/* Card variants */
.chat-interface-card,
.data-engine-card {
    background: rgba(242, 139, 80, 0.1);
    border-color: #F28B50;
}

.ai-models-card,
.source-systems-card {
    background: rgba(122, 191, 152, 0.1);
    border-color: #7ABF98;
}

.explanation-card:hover {
    transform: translateX(5px);
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.1);
}

/* Right Column - Stack Animation */
.stack-animation {
    flex: 0 0 55%;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: auto;
    align-self: center;
}

/* Stack Canvas Container */
#stack-canvas {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.stack-svg {
    width: 100%;
    height: auto;
    max-width: 410px;
    display: block;
}

/* Isometric Stack Container */
.isometric-stack {
    position: relative;
    width: 100%;
    max-width: 600px;
    height: 500px;
    filter: drop-shadow(0px 4px 4px rgba(0, 0, 0, 0.25));
}

/* Stack Layer */
.stack-layer {
    position: absolute;
    width: 100%;
    height: 100%;
    transition: all 0.3s ease;
}

/* Data Systems Container */
.data-systems-container {
    position: relative;
    width: 100%;
    height: 100%;
}

/* Individual Data System */
.data-system {
    position: absolute;
    width: 240px;
    height: 80px;
}

/* System Positions */
.data-system.ppm {
    left: 180px;
    top: 80px;
}

.data-system.pms {
    left: 60px;
    top: 160px;
}

.data-system.ems {
    left: 300px;
    top: 160px;
}

.data-system.erp {
    left: 180px;
    top: 240px;
}

/* System Shape - Rotated Rectangle */
.system-shape {
    position: absolute;
    width: 100%;
    height: 100%;
    background: linear-gradient(to right, #F28B50 0%, #92400e 50%, #92400e 100%);
    border-radius: 20px;
    transform: rotate(-45deg);
    transform-origin: center;
    transition: all 0.3s ease;
}

/* System Shadow - Dark line underneath */
.system-shadow {
    position: absolute;
    width: 320px;
    height: 2px;
    background: #0f172a;
    border-radius: 20px;
    left: -40px;
    top: 68px;
    transform: translateZ(-10px);
}

/* System Label */
.system-label {
    position: absolute;
    color: #F28B50;
    font-size: 36px;
    font-family: 'Adieu', sans-serif;
    font-weight: 400;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
    pointer-events: none;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.3);
}

/* Hover Effects */
.data-system:hover .system-shape {
    transform: rotate(-45deg) scale(1.05);
    background: linear-gradient(to right, #ff9b5a 0%, #a64a0f 50%, #a64a0f 100%);
    box-shadow: 0 10px 30px rgba(242, 139, 80, 0.3);
}

/* Highlighted State */
.stack-layer.highlighted .data-system .system-shape {
    transform: rotate(-45deg) scale(1.05);
    background: linear-gradient(to right, #ff9b5a 0%, #a64a0f 50%, #a64a0f 100%);
    box-shadow: 0 10px 30px rgba(242, 139, 80, 0.4);
}

.stack-layer.dimmed .data-system {
    opacity: 0.3;
}

.stack-layer.dimmed .data-system .system-shape {
    filter: grayscale(0.5);
}

/* Responsive Design */
@media (max-width: 1024px) {
    .section-wrapper {
        padding: 40px;
    }
    
    .section-content {
        flex-direction: column;
        gap: 40px;
    }
    
    .explanations-column,
    .stack-animation {
        flex: 1;
        width: 100%;
    }
    
    .explanations-column {
        order: 2;
    }
    
    .stack-animation {
        order: 1;
    }
}

@media (max-width: 768px) {
    .how-it-works-section {
        padding: 60px 0;
    }
    
    .section-wrapper {
        padding: 30px 20px;
        margin-top: 0; /* Removed to ensure equal top/bottom section padding */
    }
    
    .explanation-card {
        padding: 16px;
    }
    
    .explanation-card h3 {
        font-size: 14px;
    }
    
    .explanation-card p {
        font-size: 10px;
    }
    
    .stack-svg {
        max-width: 320px;
    }
}