/* ============================================
   Unified Data Layer Section
   ============================================ */

.unified-data-layer-section {
    padding: 5rem 0;
    background: #f8f9fa;
    position: relative;
    overflow: hidden;
}

.unified-data-architecture {
    max-width: 1200px;
    margin: 3rem auto 0;
    position: relative;
}

/* Agentic Workflow Cards - Top Layer */
.workflow-layer {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin-bottom: 4rem;
    position: relative;
    z-index: 4;
}

.workflow-card {
    background: white;
    border: 2px solid rgba(2, 48, 71, 0.1);
    border-radius: 16px;
    padding: 1.75rem 1.5rem;
    text-align: center;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    position: relative;
    overflow: visible;
}


.workflow-card:hover {
    transform: translateY(-8px);
    border-color: #fc6004;
    box-shadow: 0 12px 32px rgba(252, 96, 4, 0.15);
}

/* Removed top accent line: hover now relies on border-color and box-shadow only */

.workflow-card.active {
    border-color: #fc6004;
    background: linear-gradient(135deg, rgba(252, 96, 4, 0.05), rgba(2, 48, 71, 0.02));
}

/* AI Agent Badge */
.ai-agent-badge {
    position: absolute;
    top: -12px;
    right: -12px;
    background: linear-gradient(135deg, #fc6004, #ff8a3d);
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 12px rgba(252, 96, 4, 0.3);
    display: flex;
    align-items: center;
    gap: 0.3rem;
    z-index: 10;
}

.ai-agent-badge i {
    font-size: 0.8rem;
}

.workflow-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 1rem;
    background: #023047;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
    transition: all 0.3s ease;
    position: relative;
}

.workflow-card:hover .workflow-icon {
    transform: scale(1.1) rotate(5deg);
}

.workflow-card h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: #023047;
    margin: 0 0 0.5rem 0;
    line-height: 1.3;
}

.workflow-description {
    font-size: 0.85rem;
    color: #64748b;
    margin: 0;
    line-height: 1.4;
}

/* Unified Data Layer - Center */
.data-layer-container {
    position: relative;
    margin: 3rem 0;
    z-index: 3;
}

.unified-data-layer-bar {
    background: white;
    border: 2px solid #fc6004;
    border-radius: 20px;
    padding: 2rem;
    text-align: center;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(252, 96, 4, 0.15);
}

.data-layer-title {
    font-size: 1.75rem;
    font-weight: 800;
    color: #fc6004;
    margin: 0;
    letter-spacing: -0.02em;
    text-transform: uppercase;
    position: relative;
    z-index: 1;
}

.data-layer-subtitle {
    font-size: 1rem;
    color: #fc6004;
    margin: 0.5rem 0 0;
    font-weight: 500;
    position: relative;
    z-index: 1;
}

/* Source Systems Layer - Bottom (Categorized) */
.source-systems-container {
    margin-top: 3rem;
    position: relative;
    z-index: 2;
}

.system-categories {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.system-category {
    background: linear-gradient(135deg, rgba(142, 202, 230, 0.03), rgba(2, 48, 71, 0.02));
    border: 1px solid rgba(142, 202, 230, 0.2);
    border-radius: 16px;
    padding: 1.5rem;
    transition: all 0.3s ease;
}

.system-category:hover {
    border-color: rgba(252, 96, 4, 0.3);
    background: linear-gradient(135deg, rgba(252, 96, 4, 0.03), rgba(142, 202, 230, 0.03));
}

.category-header {
    text-align: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid rgba(142, 202, 230, 0.2);
}

.category-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: #fc6004;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 0 0 0.5rem 0;
}

.category-title {
    font-size: 1rem;
    font-weight: 700;
    color: #023047;
    margin: 0;
}

.category-systems {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 1rem;
}

/* Keep for backward compatibility, but rename */
.integration-layer {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 2rem;
    margin: 3rem 0;
    position: relative;
    z-index: 2;
}

.integration-system {
    background: white;
    border: 2px solid rgba(2, 48, 71, 0.1);
    border-radius: 12px;
    padding: 1.5rem 1rem;
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
    cursor: pointer;
}

.integration-system::after {
    content: '';
    position: absolute;
    top: -2px;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: 0;
    background: linear-gradient(180deg, #fc6004, transparent);
    transition: height 0.6s ease;
    opacity: 0;
}

.integration-system.active::after {
    height: 50px;
    opacity: 1;
}

.integration-system:hover {
    transform: translateY(-4px);
    border-color: #fc6004;
    box-shadow: 0 8px 24px rgba(252, 96, 4, 0.15);
}

.integration-logo {
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.75rem;
}

.integration-logo img {
    max-height: 50px;
    max-width: 100%;
    object-fit: contain;
    filter: grayscale(30%);
    transition: all 0.3s ease;
}

.integration-system:hover .integration-logo img,
.integration-system.active .integration-logo img {
    filter: grayscale(0%);
    transform: scale(1.05);
}

.integration-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: #023047;
    margin: 0;
}

/* Agentic Layer Header */
.agentic-layer-header {
    text-align: center;
    margin-bottom: 2rem;
}

.agentic-layer-header h3 {
    font-size: 0.9rem;
    font-weight: 700;
    color: #fc6004;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin: 0 0 0.5rem 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.agentic-layer-header h3 i {
    font-size: 1rem;
}

.agentic-layer-header p {
    font-size: 1rem;
    color: #64748b;
    margin: 0;
}

/* Connection Lines Animation */
.connection-line {
    position: absolute;
    width: 2px;
    height: 0;
    background: linear-gradient(180deg, #fc6004, transparent);
    left: 50%;
    bottom: 100%;
    transform: translateX(-50%);
    opacity: 0;
    transition: all 0.6s ease;
    pointer-events: none;
}

.integration-system.active .connection-line {
    height: 60px;
    opacity: 1;
}

/* Data Flow Particles */
@keyframes dataFlow {
    0% {
        transform: translateY(0) scale(0);
        opacity: 0;
    }
    20% {
        opacity: 1;
    }
    100% {
        transform: translateY(-100px) scale(1);
        opacity: 0;
    }
}

.data-particle {
    position: absolute;
    width: 6px;
    height: 6px;
    background: #fc6004;
    border-radius: 50%;
    bottom: -3px;
    left: 50%;
    transform: translateX(-50%);
    animation: dataFlow 2s ease-in-out infinite;
    pointer-events: none;
}

.integration-system .data-particle:nth-child(2) {
    animation-delay: 0.5s;
}

.integration-system .data-particle:nth-child(3) {
    animation-delay: 1s;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .workflow-layer {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.25rem;
    }

    .integration-layer {
        grid-template-columns: repeat(3, 1fr);
        gap: 1.5rem;
    }

    .system-categories {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .unified-data-layer-section {
        padding: 3rem 0;
    }

    .workflow-layer {
        grid-template-columns: 1fr;
        gap: 1rem;
        margin-bottom: 3rem;
    }

    .data-layer-title {
        font-size: 1.4rem;
    }

    .data-layer-subtitle {
        font-size: 0.9rem;
    }

    .integration-layer {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    .integration-logo {
        height: 50px;
    }

    .integration-logo img {
        max-height: 40px;
    }

    .system-categories {
        grid-template-columns: 1fr;
    }

    .category-systems {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .integration-layer {
        grid-template-columns: 1fr;
    }

    .category-systems {
        grid-template-columns: 1fr;
    }

    .ai-agent-badge {
        font-size: 0.65rem;
        padding: 0.3rem 0.6rem;
    }
}

/* Section Introduction */
.unified-intro {
    max-width: 900px;
    margin: 0 auto 3rem;
    text-align: center;
}

.unified-intro h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #023047;
    margin-bottom: 1rem;
    line-height: 1.4;
}

.unified-intro p {
    font-size: 1.1rem;
    color: #64748b;
    line-height: 1.6;
    margin: 0;
}

/* Grouped Category Circles Layout */
.source-systems-grouped {
    margin-top: 3rem;
    position: relative;
    padding: 2rem 0;
}

/* Removed connection lines - keeping layout clean */

.category-groups-container {
    display: flex;
    justify-content: space-around;
    align-items: flex-start;
    gap: 3rem;
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
}

.category-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
}

.category-group-label {
    font-size: 0.9rem;
    font-weight: 700;
    color: #023047;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    margin-bottom: 1.5rem;
    text-align: center;
}

.category-outer-circle {
    width: 320px;
    height: 240px;
    border-radius: 16px;
    background: white;
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    position: relative;
    transition: all 0.3s ease;
    display: grid;
    gap: 1.25rem;
    padding: 2rem;
    align-items: center;
    justify-items: center;
}

/* ERP: If there are 3 logos, use 2 columns so the 3rd wraps to the next line (prevents overflow) */
.category-outer-circle:not(.large):has(.inner-logo-circle:nth-child(3)) {
    grid-template-columns: repeat(2, 1fr);
    align-items: center;
}

/* Distribution: 2 logos in 2 columns */
.category-outer-circle:not(.large):has(.inner-logo-circle:nth-child(2):last-child) {
    grid-template-columns: repeat(2, 1fr);
    width: 280px;
}

/* Retail: 6 logos in 3 columns */
.category-outer-circle.large {
    width: 400px;
    height: 240px;
    grid-template-columns: repeat(3, 1fr);
}

.category-outer-circle:hover {
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

.inner-logo-circle {
    width: auto;
    height: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.inner-logo-circle img {
    max-width: 90px;
    max-height: 70px;
    width: auto;
    height: auto;
    object-fit: contain;
    filter: grayscale(0%);
    transition: all 0.3s ease;
}

/* Fix Oracle NetSuite logo sizing - more specific targeting */
.inner-logo-circle img[src*="oracle-netsuite"],
.inner-logo-circle img[alt="Oracle"] {
    max-width: 80px !important;
    max-height: 55px !important;
    object-fit: contain !important;
}

/* Enlarge Distribution logos */
.category-outer-circle:not(.large) .inner-logo-circle img {
    max-width: 100px;
    max-height: 80px;
}

.inner-logo-circle:hover img {
    transform: scale(1.08);
    filter: brightness(1.1);
}

/* Old circular layout - keeping for backup */
.source-systems-circular {
    margin-top: 3rem;
    position: relative;
    padding: 2rem 0;
    display: none; /* Hide old layout */
}

.connection-lines {
    position: absolute;
    top: -50px;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 1200px;
    height: 500px;
    pointer-events: none;
    z-index: 1;
}

.connect-line {
    animation: flowUp 3s ease-in-out infinite;
}

.connect-line-main {
    animation: flowUpMain 2s ease-in-out infinite;
}

.backbone-line {
    animation: backboneFlow 4s ease-in-out infinite;
}

.convergence-point-main {
    animation: pulseMain 2s ease-in-out infinite;
    transform-origin: center;
}

.convergence-point-category {
    animation: pulseCategory 2.5s ease-in-out infinite;
    transform-origin: center;
}

@keyframes flowUp {
    0%, 100% {
        stroke-opacity: 0.4;
    }
    50% {
        stroke-opacity: 0.8;
    }
}

@keyframes flowUpMain {
    0%, 100% {
        stroke-opacity: 0.6;
    }
    50% {
        stroke-opacity: 1;
    }
}

@keyframes backboneFlow {
    0%, 100% {
        opacity: 0.3;
    }
    50% {
        opacity: 0.6;
    }
}

@keyframes pulseMain {
    0%, 100% {
        opacity: 0.8;
    }
    50% {
        opacity: 1;
    }
}

@keyframes pulseCategory {
    0%, 100% {
        opacity: 0.5;
    }
    50% {
        opacity: 0.9;
    }
}

.circle-row {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 2.5rem;
    position: relative;
    z-index: 2;
}

.circle-category-label {
    font-size: 0.85rem;
    font-weight: 700;
    color: #fc6004;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    margin-bottom: 1.5rem;
    text-align: center;
}

.circle-systems {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2.5rem;
    flex-wrap: wrap;
}

.integration-circle {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.integration-circle:hover {
    transform: translateY(-8px);
}

.circle-logo {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: white;
    border: 3px solid rgba(2, 48, 71, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.circle-logo::before {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: 50%;
    background: linear-gradient(135deg, #fc6004, #023047);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: -1;
}

.integration-circle:hover .circle-logo {
    border-color: #fc6004;
    box-shadow: 0 8px 24px rgba(252, 96, 4, 0.25);
}

.integration-circle:hover .circle-logo::before {
    opacity: 1;
}

.circle-logo img {
    max-width: 70%;
    max-height: 70%;
    object-fit: contain;
    filter: grayscale(20%);
    transition: all 0.3s ease;
    position: relative;
    z-index: 1;
}

.integration-circle:hover .circle-logo img {
    filter: grayscale(0%);
    transform: scale(1.1);
}

.circle-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: #023047;
    margin-top: 0.75rem;
    text-align: center;
}

/* Responsive adjustments for grouped layout */
@media (max-width: 1024px) {
    .category-groups-container {
        gap: 2rem;
    }

    .category-outer-circle {
        width: 280px;
        height: 240px;
        padding: 1.5rem;
        gap: 0.75rem;
    }

    .category-outer-circle.large {
        width: 350px;
        height: 240px;
    }

    .inner-logo-circle img {
        max-width: 75px;
        max-height: 60px;
    }

    /* Maintain distribution logo sizing on tablet */
    .category-outer-circle:not(.large) .inner-logo-circle img {
        max-width: 85px;
        max-height: 70px;
    }

    /* Oracle sizing on tablet */
    .inner-logo-circle img[src*="oracle-netsuite"],
    .inner-logo-circle img[alt="Oracle"] {
        max-width: 70px !important;
        max-height: 50px !important;
    }
}

@media (max-width: 768px) {
    .category-groups-container {
        flex-direction: column;
        align-items: center;
        gap: 2.5rem;
    }

    .category-outer-circle,
    .category-outer-circle.large {
        width: 100%;
        max-width: 400px;
        height: auto;
        padding: 2rem;
        grid-template-columns: repeat(3, 1fr);
    }

    .inner-logo-circle img {
        max-width: 80px;
        max-height: 65px;
    }

    /* Distribution logos on tablet/mobile */
    .category-outer-circle:not(.large) .inner-logo-circle img {
        max-width: 90px;
        max-height: 75px;
    }
}

@media (max-width: 480px) {
    .category-outer-circle,
    .category-outer-circle.large {
        width: 100%;
        padding: 1.5rem;
        gap: 0.75rem;
        grid-template-columns: repeat(2, 1fr);
    }

    .inner-logo-circle img {
        max-width: 70px;
        max-height: 55px;
    }

    /* Distribution logos on mobile */
    .category-outer-circle:not(.large) .inner-logo-circle img {
        max-width: 80px;
        max-height: 65px;
    }

    /* Oracle sizing on mobile */
    .inner-logo-circle img[src*="oracle-netsuite"],
    .inner-logo-circle img[alt="Oracle"] {
        max-width: 60px !important;
        max-height: 45px !important;
    }

    .category-group-label {
        font-size: 0.85rem;
    }
}

/* Old responsive styles for circular layout - keeping for backup */
@media (max-width: 1024px) {
    .circle-systems {
        gap: 2rem;
    }

    .circle-logo {
        width: 85px;
        height: 85px;
    }
}

@media (max-width: 768px) {
    .connection-lines {
        display: none;
    }

    .circle-row {
        margin-bottom: 2rem;
    }

    .circle-systems {
        gap: 1.5rem;
    }

    .circle-logo {
        width: 75px;
        height: 75px;
    }

    .circle-category-label {
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .circle-systems {
        gap: 1rem;
    }

    .circle-logo {
        width: 65px;
        height: 65px;
        padding: 0.75rem;
    }

    .circle-name {
        font-size: 0.8rem;
    }
}
