/* Dynamic AI Operations Stack Animation */
:root {
    --accent-color: #3b82f6;
    --bg-glass: rgba(255, 255, 255, 0.95);
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --border-subtle: rgba(0, 0, 0, 0.1);
    --shadow-soft: 0 8px 32px rgba(0, 0, 0, 0.12);
}

.dynamic-stack-container {
    position: relative;
    width: 380px !important;
    max-width: 380px;
    height: auto;
    min-height: 320px;
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 1rem;
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--border-subtle);
    overflow: visible;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.dynamic-stack-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--accent-color), transparent, var(--accent-color));
    animation: shimmer 3s infinite;
    display: none; /* Hidden to remove horizontal line */
}

@keyframes shimmer {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

/* Header Section */
.stack-header {
    text-align: center;
    margin-bottom: 0.75rem;
}

.stack-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 0.25rem 0;
    letter-spacing: -0.025em;
}

.combination-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}

.combination-name {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--accent-color);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: all 0.3s ease;
}

.combination-dots {
    display: flex;
    gap: 0.25rem;
}

.dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
    opacity: 0.4;
}

.dot.active {
    background: var(--accent-color);
    opacity: 1;
    transform: scale(1.2);
}

.dot:hover {
    opacity: 0.8;
    transform: scale(1.1);
}

/* Stack Layers */
.stack-layers {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 0;
}

.stack-layer {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 8px;
    border: 1px solid rgba(0, 0, 0, 0.05);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.stack-layer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, var(--accent-color)10, transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.stack-layer:hover {
    transform: translateX(4px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.stack-layer:hover::before {
    opacity: 1;
}

.layer-icon {
    font-size: 1rem;
    width: 1.5rem;
    height: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-color)20;
    border-radius: 6px;
    flex-shrink: 0;
}

.layer-content {
    flex: 1;
    min-width: 0;
}

.layer-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.125rem;
}

.layer-tech {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.125rem;
    transition: all 0.4s ease;
}

.layer-description {
    font-size: 0.625rem;
    color: var(--text-secondary);
    opacity: 0.8;
}

.layer-connections {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 4px;
    background: var(--accent-color);
    border-radius: 50%;
    opacity: 0.6;
}

/* Benefits Section */
.stack-benefits {
    display: block !important;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 8px;
    padding: 0.5rem;
    margin: 0.25rem 0 0 0 !important;
    grid-template-columns: none !important;
    gap: 0 !important;
}

.benefits-header {
    font-size: 0.65rem !important;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0 !important;
    padding: 0 !important;
    line-height: 1 !important;
    display: block !important;
}

.benefits-list {
    display: flex !important;
    flex-wrap: wrap;
    justify-content: center !important;
    gap: 0.25rem;
    margin: -0.125rem 0 -0.125rem 0 !important;
    padding: 0 !important;
    transition: opacity 0.3s ease;
}

.benefit {
    font-size: 0.625rem;
    font-weight: 600;
    color: var(--accent-color);
    background: var(--accent-color)15;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    border: 1px solid var(--accent-color)30;
}

.stack-description {
    font-size: 0.75rem;
    color: var(--text-secondary);
    line-height: 1.4;
    margin: -0.125rem 0 0 0 !important;
    padding: 0 !important;
    transition: opacity 0.3s ease;
}

/* Interaction hint removed to reduce whitespace */

/* Ripple Effect */
.ripple-effect {
    position: absolute;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--accent-color);
    opacity: 0.6;
    transform: translate(-50%, -50%);
    animation: ripple 1s ease-out forwards;
    pointer-events: none;
    z-index: 10;
}

@keyframes ripple {
    0% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 0.6;
    }
    100% {
        transform: translate(-50%, -50%) scale(4);
        opacity: 0;
    }
}

/* Layer-specific colors */
.build-layer .layer-icon { background: #3b82f620; }
.deploy-layer .layer-icon { background: #10b98120; }
.infra-layer .layer-icon { background: #f59e0b20; }
.observe-layer .layer-icon { background: #8b5cf620; }

/* Responsive adjustments */
@media (max-width: 900px) {
    .dynamic-stack-container {
        max-width: 320px;
        height: auto;
        min-height: 300px;
        padding: 1rem;
    }
    
    .stack-layers {
        gap: 0.5rem;
    }
    
    .stack-layer {
        padding: 0.625rem;
    }
    
    .layer-icon {
        font-size: 1rem;
        width: 1.75rem;
        height: 1.75rem;
    }
}

/* Canvas positioning */
canvas {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    pointer-events: none !important;
    z-index: 1 !important;
}

/* Ensure content is above canvas */
.stack-header,
.stack-layers,
.stack-benefits {
    position: relative;
    z-index: 2;
}

/* Smooth transitions for all interactive elements */
* {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.3s ease,
                background-color 0.3s ease,
                color 0.3s ease;
}
