/* All Diagram Styles - Architecture and EAIS */

/* ============================================
   Architecture Diagram Styles
   ============================================ */
.architecture-diagram {
    margin: var(--spacing-xl) 0;
    background: var(--color-white);
    border-radius: var(--radius-xl);
    padding: var(--spacing-xl);
    box-shadow: var(--shadow-lg);
}

.diagram-container {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
    height: 500px;
}

.component {
    position: absolute;
    background: var(--gradient-primary);
    color: var(--color-white);
    padding: var(--spacing-md);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    min-width: 140px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    z-index: var(--z-base);
}

.component-icon {
    font-size: 2rem;
    margin-bottom: var(--spacing-xs);
}

.component-label {
    font-weight: bold;
    font-size: 1rem;
    margin-bottom: 0.25rem;
}

.component-description {
    font-size: 0.8rem;
    opacity: 0.9;
}

/* General hover/focus effect for all components */
.component:hover, .component:focus-visible {
    z-index: 20;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4);
    transform: scale(1.1);
}

/* Server needs to keep its translate for centering */
.component.server:hover, .component.server:focus-visible {
    transform: translate(-50%, -50%) scale(1.1);
}

.component.server {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    transform-origin: center center;
    background: linear-gradient(45deg, var(--color-error), var(--color-error-dark));
    z-index: 10;
}

.component.llm {
    top: 5%;
    left: 10%;
    background: linear-gradient(45deg, var(--color-purple-light), var(--color-purple-dark));
}

/* Vector DB Index */
.component.vector-index {
    top: 0%;
    left: 40%;
    background: linear-gradient(45deg, var(--color-teal-light), var(--color-teal-dark));
}

/* DAG Index */
.component.dag-index {
    top: 5%;
    left: 65%;
    background: linear-gradient(45deg, var(--color-teal-light), var(--color-teal-dark));
}

/* Keywords Index */
.component.keyword-index {
    top: 10%;
    left: 80%;
    background: linear-gradient(45deg, var(--color-teal-light), var(--color-teal-dark));
}

.component.desktop {
    bottom: 10%;
    left: 5%;
    background: linear-gradient(45deg, var(--color-blue-light), var(--color-blue-dark));
}

.component.mobile {
    top: 65%;
    left: 40%;
    background: linear-gradient(45deg, var(--color-green-light), var(--color-green-dark));
}

.component.agent {
    top: 43%;
    left: 65%;
    background: linear-gradient(45deg, var(--color-orange-light), var(--color-orange-dark));
}

.component.mcp {
    top: 32%;
    left: 0%;
    background: linear-gradient(45deg, var(--color-yellow-light), var(--color-yellow-dark));
}

.component.gitops {
    top: 70%;
    left: 68%;
    background: linear-gradient(45deg, var(--color-gray-dark), var(--color-gray-light));
}

.connection-lines {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: var(--z-base);
}

.line {
    position: absolute;
    background: var(--gradient-primary);
    opacity: 0.3;
}

.line-server-llm {
    top: 35%;
    left: 50%;
    width: 3px;
    height: 15%;
    transform: translateX(-50%);
}

.line-server-vector-index {
    top: 50%;
    left: 35%;
    width: 15%;
    height: 3px;
    transform: translateY(-50%);
}

.line-server-dag-index {
    top: 50%;
    left: 40%;
    width: 20%;
    height: 3px;
    transform: translateY(-50%);
}

.line-server-keyword-index {
    top: 50%;
    left: 45%;
    width: 25%;
    height: 3px;
    transform: translateY(-50%);
}

.line-server-desktop {
    top: 60%;
    left: 40%;
    width: 3px;
    height: 20%;
    transform: rotate(-30deg);
    transform-origin: top;
}

.line-server-mobile {
    top: 60%;
    right: 40%;
    width: 3px;
    height: 20%;
    transform: rotate(30deg);
    transform-origin: top;
}

.line-server-agent {
    top: 50%;
    right: 35%;
    width: 15%;
    height: 3px;
    transform: translateY(-50%);
}

.component-info {
    background: var(--gradient-primary);
    border: 2px solid #e2e8f0;
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    margin-top: var(--spacing-lg);
    transition: all 0.3s ease;
}

.component-info h3 {
    color: var(--color-white);
    margin-bottom: 0.8rem;
}

.component-info.active {
    color: var(--color-white);
    border-color: var(--color-primary);
}

/* Background color classes for the info panel */
.component-info.info-bg-server { background: linear-gradient(45deg, var(--color-error), var(--color-error-dark)); }
.component-info.info-bg-llm { background: linear-gradient(45deg, var(--color-purple-light), var(--color-purple-dark)); }
.component-info.info-bg-vector-index { background: linear-gradient(45deg, var(--color-teal-light), var(--color-teal-dark)); }
.component-info.info-bg-dag-index { background: linear-gradient(45deg, var(--color-teal-light), var(--color-teal-dark)); }
.component-info.info-bg-keyword-index { background: linear-gradient(45deg, var(--color-teal-light), var(--color-teal-dark)); }
.component-info.info-bg-desktop { background: linear-gradient(45deg, var(--color-blue-light), var(--color-blue-dark)); }
.component-info.info-bg-mobile { background: linear-gradient(45deg, var(--color-green-light), var(--color-green-dark)); }
.component-info.info-bg-agent { background: linear-gradient(45deg, var(--color-orange-light), var(--color-orange-dark)); }
.component-info.info-bg-mcp { background: linear-gradient(45deg, var(--color-yellow-light), var(--color-yellow-dark)); }
.component-info.info-bg-gitops { background: linear-gradient(45deg, var(--color-gray-dark), var(--color-gray-light)); }

/* ============================================
   EAIS Diagram Styles
   ============================================ */
.eais-diagram {
    margin: 0rem 0;
    background: var(--color-white);
    border-radius: var(--radius-xl);
    padding: var(--spacing-md);
    box-shadow: var(--shadow-lg);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.eais-container {
    max-width: 900px;
    margin: 0 auto;
    position: relative;
}

.eais-group {
    margin-bottom: var(--spacing-md);
    position: relative;
    padding: var(--spacing-sm);
    border-radius: var(--radius-lg);
    background: rgba(12, 85, 194, 0.05);
    border: 2px solid rgba(12, 85, 194, 0.1);
}

.eais-group-title {
    text-align: center;
    margin: 0;
    font-weight: bold;
    font-size: 1.1rem;
    color: var(--color-primary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Override blog-post h3 margin for layer group titles */
.blog-post .eais-diagram .eais-group-title {
    margin: 0;
}

.eais-layer {
    background: var(--gradient-primary);
    color: var(--color-white);
    padding: var(--spacing-sm) var(--spacing-md);
    margin: var(--spacing-xs) 0;
    border-radius: var(--radius-md);
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(12, 85, 194, 0.2);
    transition: all 0.3s ease;
    cursor: pointer;
    animation: slideInLeft 0.6s ease-out;
}

.eais-layer:hover {
    transform: translateX(5px);
    box-shadow: 0 6px 20px rgba(12, 85, 194, 0.3);
}

.eais-layer.missing-layer {
    background: var(--color-error);
    box-shadow: 0 4px 12px rgba(229, 62, 62, 0.2);
    opacity: 0.8;
    position: relative;
    border: 4px solid var(--color-error);
}

.eais-layer.missing-layer::after {
    content: "⚠️";
    position: absolute;
    right: var(--spacing-sm);
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.2rem;
}

.eais-layer.missing-layer:hover {
    box-shadow: 0 6px 20px rgba(229, 62, 62, 0.3);
}

.eais-layer.layer-4-orchestration {
    background: var(--color-secondary);
    box-shadow: 0 4px 12px rgba(11, 162, 101, 0.2);
    border: 4px solid var(--color-secondary);
    position: relative;
}

.eais-layer.layer-4-orchestration::after {
    content: "⭐";
    position: absolute;
    right: var(--spacing-sm);
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.2rem;
}

.eais-layer.layer-4-orchestration:hover {
    box-shadow: 0 6px 20px rgba(11, 162, 101, 0.3);
}

/* Individual layer colors to match original EAIS blog */
.eais-layer.layer-8 {
    background: linear-gradient(45deg, var(--color-purple-light), var(--color-purple-dark));
    box-shadow: 0 4px 12px rgba(158, 122, 234, 0.2);
}

.eais-layer.layer-8:hover {
    box-shadow: 0 6px 20px rgba(158, 122, 234, 0.3);
}

.eais-layer.layer-7 {
    background: linear-gradient(45deg, var(--color-purple-light), var(--color-purple-dark));
    box-shadow: 0 4px 12px rgba(158, 122, 234, 0.2);
}

.eais-layer.layer-7:hover {
    box-shadow: 0 6px 20px rgba(158, 122, 234, 0.3);
}

.eais-layer.layer-6 {
    background: linear-gradient(45deg, var(--color-purple-light), var(--color-purple-dark));
    box-shadow: 0 4px 12px rgba(158, 122, 234, 0.2);
}

.eais-layer.layer-6:hover {
    box-shadow: 0 6px 20px rgba(158, 122, 234, 0.3);
}

.eais-layer.layer-5 {
    background: linear-gradient(45deg, var(--color-teal-light), var(--color-teal-dark));
    box-shadow: 0 4px 12px rgba(56, 178, 172, 0.2);
}

.eais-layer.layer-5:hover {
    box-shadow: 0 6px 20px rgba(56, 178, 172, 0.3);
}

.eais-layer.layer-3 {
    background: linear-gradient(45deg, var(--color-orange-light), var(--color-orange-dark));
    box-shadow: 0 4px 12px rgba(237, 137, 54, 0.2);
}

.eais-layer.layer-3:hover {
    box-shadow: 0 6px 20px rgba(237, 137, 54, 0.3);
}

.eais-layer.layer-2 {
    background: linear-gradient(45deg, var(--color-orange-light), var(--color-orange-dark));
    box-shadow: 0 4px 12px rgba(237, 137, 54, 0.2);
}

.eais-layer.layer-2:hover {
    box-shadow: 0 6px 20px rgba(237, 137, 54, 0.3);
}

.eais-layer.layer-1 {
    background: linear-gradient(45deg, var(--color-orange-light), var(--color-orange-dark));
    box-shadow: 0 4px 12px rgba(237, 137, 54, 0.2);
}

.eais-layer.layer-1:hover {
    box-shadow: 0 6px 20px rgba(237, 137, 54, 0.3);
}

.eais-layer-number {
    font-weight: bold;
    margin-right: var(--spacing-xs);
    opacity: 0.9;
}

.eais-layer-title {
    font-weight: 600;
}

.layer-details {
    margin-top: 0.75rem;
    display: flex;
    flex-direction: row;
    justify-content: flex-start;
    gap: var(--spacing-xs);
    flex-wrap: wrap;
}

.detail-block {
    background: rgba(255, 255, 255, 0.2);
    color: var(--color-white);
    padding: 0.25rem var(--spacing-xs);
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
    border: 1px solid rgba(255, 255, 255, 0.3);
    text-align: center;
    white-space: nowrap;
}

/* Architecture component styling for use in code blocks - following how-it-works design */
.blog-component {
    color: var(--color-white);
    padding: var(--spacing-xs) 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 500;
    text-align: center;
    white-space: nowrap;
    display: inline-block;
    vertical-align: middle;
    font-family: inherit;
    margin-right: 0.25rem;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
}

/* Layer-specific blog component colors */
.blog-component.layer-5 {
    background: linear-gradient(45deg, var(--color-teal-light), var(--color-teal-dark));
    box-shadow: 0 4px 12px rgba(56, 178, 172, 0.2);
}

.blog-component.layer-5:hover {
    box-shadow: 0 6px 20px rgba(56, 178, 172, 0.3);
    transform: translateY(-1px);
}

.blog-component.layer-4 {
    background: linear-gradient(45deg, var(--color-secondary), #059669);
    box-shadow: 0 4px 12px rgba(11, 162, 101, 0.2);
}

.blog-component.layer-4:hover {
    box-shadow: 0 6px 20px rgba(11, 162, 101, 0.3);
    transform: translateY(-1px);
}

.blog-component.layer-2 {
    background: linear-gradient(45deg, var(--color-orange-light), var(--color-orange-dark));
    box-shadow: 0 4px 12px rgba(237, 137, 54, 0.2);
}

.blog-component.layer-2:hover {
    box-shadow: 0 6px 20px rgba(237, 137, 54, 0.3);
    transform: translateY(-1px);
}

/* Group-specific colors */
.eais-group.governance {
    background: rgba(158, 122, 234, 0.05);
    border-color: rgba(158, 122, 234, 0.2);
}

.eais-group.governance .eais-group-title {
    color: var(--color-purple-light);
}

.eais-group.governance .eais-layer {
    background: linear-gradient(45deg, var(--color-purple-light), var(--color-purple-dark));
    box-shadow: 0 4px 12px rgba(158, 122, 234, 0.2);
}

.eais-group.governance .eais-layer:hover {
    box-shadow: 0 6px 20px rgba(158, 122, 234, 0.3);
}

.eais-group.orchestration {
    background: rgba(56, 178, 172, 0.05);
    border-color: rgba(56, 178, 172, 0.2);
}

.eais-group.orchestration .eais-group-title {
    color: var(--color-teal-light);
}

.eais-group.orchestration .eais-layer {
    background: linear-gradient(45deg, var(--color-teal-light), var(--color-teal-dark));
    box-shadow: 0 4px 12px rgba(56, 178, 172, 0.2);
}

.eais-group.orchestration .eais-layer:hover {
    box-shadow: 0 6px 20px rgba(56, 178, 172, 0.3);
}

.eais-group.model-core {
    background: rgba(237, 137, 54, 0.05);
    border-color: rgba(237, 137, 54, 0.2);
}

.eais-group.model-core .eais-group-title {
    color: var(--color-orange-light);
}

.eais-group.model-core .eais-layer {
    background: linear-gradient(45deg, var(--color-orange-light), var(--color-orange-dark));
    box-shadow: 0 4px 12px rgba(237, 137, 54, 0.2);
}

.eais-group.model-core .eais-layer:hover {
    box-shadow: 0 6px 20px rgba(237, 137, 54, 0.3);
}

/* EAIS Layer Info Panel */
.eais-layer-info {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--color-white);
    padding: var(--spacing-lg);
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    z-index: var(--z-nav);
    width: 90vw;
    max-width: 500px;
    display: none; /* Hidden by default */
    border: 3px solid; /* color will be set by JS */
}

.eais-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    display: none; /* Hidden by default */
}

/* Stagger animation for layers */
.eais-layer:nth-child(1) { animation-delay: 0.1s; }
.eais-layer:nth-child(2) { animation-delay: 0.2s; }
.eais-layer:nth-child(3) { animation-delay: 0.3s; }
.eais-layer:nth-child(4) { animation-delay: 0.4s; }
.eais-layer:nth-child(5) { animation-delay: 0.5s; }
.eais-layer:nth-child(6) { animation-delay: 0.6s; }
.eais-layer:nth-child(7) { animation-delay: 0.7s; }
.eais-layer:nth-child(8) { animation-delay: 0.8s; }

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

