/* ==========================================================================
   PROVE ID - ENHANCED TOPOLOGY ARCHITECTURE (SLIDE 11)
   Matches the comprehensive enterprise architecture of original source PDF (source-11)
   ========================================================================== */

.topology-slide h1 {
    margin-bottom: 14px;
}

.topology-slide .body {
    width: 100%;
    height: auto;
    max-height: calc(100vh - 210px);
    display: flex;
    flex-direction: column;
}

.topology-stage {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 12px;
    position: relative;
    user-select: none;
}

/* --------------------------------------------------------------------------
   MAIN ARCHITECTURE FLOW GRID
   -------------------------------------------------------------------------- */
.top-architecture {
    width: 100%;
    display: grid;
    grid-template-columns: 180px 70px 145px 70px 195px 60px 1fr;
    align-items: stretch;
    gap: 0;
    min-height: 380px;
}

/* Common Block Container */
.top-block {
    background: linear-gradient(145deg, rgba(24, 38, 88, 0.82), rgba(8, 14, 42, 0.88));
    border: 1px solid var(--px-border);
    border-radius: 18px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    position: relative;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 16px 36px -10px rgba(0, 0, 0, 0.45);
    transition: transform 0.25s ease, border-color 0.25s ease;
}

.top-block:hover {
    border-color: rgba(138, 162, 255, 0.45);
    transform: translateY(-2px);
}

/* Block Header */
.top-head {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.top-tag {
    font-size: 8.5px;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--px-cyan);
}

.top-head strong {
    font-size: 11.5px;
    font-weight: 750;
    color: #f1f4ff;
    line-height: 1.25;
}

/* --------------------------------------------------------------------------
   BLOCK 1: CLIENT APPLICATIONS
   -------------------------------------------------------------------------- */
.top-clients {
    z-index: 2;
}

.top-client-devices {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    margin-bottom: 10px;
}

.top-device {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 8px 4px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    text-align: center;
    transition: all 0.2s ease;
}

.top-device:hover {
    background: rgba(86, 119, 255, 0.15);
    border-color: var(--px-cyan);
    transform: scale(1.04);
}

.device-icon {
    width: 20px;
    height: 20px;
    stroke: var(--px-cyan);
}

.top-device[data-platform="android"] .device-icon { stroke: #39d780; }
.top-device[data-platform="ios"] .device-icon { stroke: #8aa2ff; }
.top-device[data-platform="web"] .device-icon { stroke: #5ee9ff; }

.top-device span {
    font-size: 9.5px;
    font-weight: 700;
    color: #e2e8ff;
}

.top-client-list {
    list-style: none;
    padding: 0;
    margin: auto 0 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
    border-top: 1px dashed rgba(255, 255, 255, 0.09);
    padding-top: 8px;
}

.top-client-list li {
    font-size: 9.5px;
    color: var(--px-muted);
    font-weight: 550;
    display: flex;
    align-items: center;
    gap: 5px;
}

.top-client-list li i {
    font-style: normal;
    color: var(--px-cyan);
    font-size: 11px;
}

/* --------------------------------------------------------------------------
   CONNECTORS & DATA PACKET FLOWS
   -------------------------------------------------------------------------- */
.top-connector {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 0 4px;
    z-index: 1;
}

.conn-proto {
    font-size: 8px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--px-cyan);
    background: rgba(14, 22, 60, 0.9);
    border: 1px solid rgba(79, 216, 255, 0.3);
    padding: 2px 5px;
    border-radius: 999px;
    white-space: nowrap;
    position: absolute;
    top: 38px;
    z-index: 3;
}

.conn-line {
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, rgba(86, 119, 255, 0.3), rgba(79, 216, 255, 0.8), rgba(86, 119, 255, 0.3));
    position: relative;
    overflow: visible;
}

.conn-line .pkt {
    position: absolute;
    top: -3px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--px-cyan);
    box-shadow: 0 0 12px 2px var(--px-cyan);
    animation: packet-stream 2.2s linear infinite;
}

.conn-line .pkt:nth-child(2) {
    animation-delay: 1.1s;
}

.conn-line.multi .pkt:nth-child(3) {
    animation-delay: 0.6s;
}

@keyframes packet-stream {
    0% { left: 0%; opacity: 0; }
    15% { opacity: 1; }
    85% { opacity: 1; }
    100% { left: 100%; opacity: 0; }
}

/* Load Balancer Nodes */
.top-node-hub {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, #18286a, #0b133b);
    border: 1px solid rgba(79, 216, 255, 0.5);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 8px 0;
    position: relative;
    box-shadow: 0 0 20px rgba(79, 216, 255, 0.25);
    cursor: default;
    transition: transform 0.2s ease;
}

.top-node-hub:hover {
    transform: scale(1.12);
}

.top-node-hub svg {
    width: 20px;
    height: 20px;
    stroke: var(--px-cyan);
    z-index: 2;
}

.top-node-hub small {
    position: absolute;
    bottom: -22px;
    font-size: 7.5px;
    font-weight: 750;
    color: var(--px-muted);
    text-align: center;
    white-space: nowrap;
    width: 74px;
    line-height: 1.15;
}

.hub-ring {
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 1px dashed rgba(79, 216, 255, 0.4);
    animation: hub-turn 10s linear infinite;
}

@keyframes hub-turn {
    to { transform: rotate(360deg); }
}

/* --------------------------------------------------------------------------
   BLOCK 2 & 3: SERVER RACKS (MIDDLEWARE & CORE)
   -------------------------------------------------------------------------- */
.top-server-rack {
    display: flex;
    flex-direction: column;
    gap: 7px;
    margin-top: 4px;
}

.server-node {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 9px;
    padding: 7px 10px;
    display: flex;
    align-items: center;
    gap: 9px;
    transition: all 0.2s ease;
}

.server-node:hover {
    background: rgba(86, 119, 255, 0.12);
    border-color: rgba(138, 162, 255, 0.4);
}

.server-node.highlight {
    background: linear-gradient(135deg, rgba(47, 85, 255, 0.18), rgba(14, 25, 70, 0.35));
    border-color: rgba(79, 216, 255, 0.35);
}

.server-icon {
    width: 26px;
    height: 18px;
    background: #090e29;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 2px;
    padding-right: 3px;
    position: relative;
}

.server-icon i {
    width: 2px;
    height: 8px;
    background: rgba(255, 255, 255, 0.25);
    border-radius: 1px;
}

.led {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    position: absolute;
    left: 4px;
    background: #39d780;
    box-shadow: 0 0 6px #39d780;
}

.led.cyan {
    background: var(--px-cyan);
    box-shadow: 0 0 6px var(--px-cyan);
}

.led.active {
    animation: led-blink 1.8s ease-in-out infinite alternate;
}

@keyframes led-blink {
    from { opacity: 0.4; }
    to { opacity: 1; }
}

.server-node span {
    font-size: 10px;
    font-weight: 700;
    color: #f1f4ff;
}

.server-dots {
    display: flex;
    justify-content: center;
    gap: 4px;
    padding: 1px 0;
}

.server-dots span {
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: var(--px-muted);
}

/* --------------------------------------------------------------------------
   BLOCK 3: KYC MAIN SERVER (rkyc-server)
   -------------------------------------------------------------------------- */
.top-core-server {
    background: radial-gradient(circle at 50% 25%, rgba(79, 216, 255, 0.12), transparent 70%),
                linear-gradient(145deg, rgba(20, 36, 95, 0.92), rgba(8, 14, 45, 0.95));
    border-color: rgba(79, 216, 255, 0.35);
    box-shadow: 0 0 35px -8px rgba(47, 85, 255, 0.4);
}

.core-head {
    align-items: center;
    text-align: center;
    position: relative;
}

.server-id {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 9px;
    color: var(--px-cyan);
    background: rgba(0, 0, 0, 0.3);
    padding: 1px 5px;
    border-radius: 4px;
    margin-top: 1px;
}

.tech-badge {
    font-size: 8px;
    font-weight: 800;
    letter-spacing: 0.06em;
    color: #ffb86c;
    background: rgba(255, 184, 108, 0.12);
    border: 1px solid rgba(255, 184, 108, 0.25);
    padding: 1px 6px;
    border-radius: 999px;
    margin-top: 3px;
}

.core-port-badge {
    margin: 8px auto 6px;
    align-self: center;
    font-size: 8.5px;
    font-weight: 800;
    color: var(--px-cyan);
    background: rgba(79, 216, 255, 0.12);
    border: 1px solid rgba(79, 216, 255, 0.3);
    padding: 2px 9px;
    border-radius: 999px;
    letter-spacing: 0.05em;
}

/* Database & Storage Attachments */
.core-attachments {
    margin-top: auto;
    padding-top: 8px;
    border-top: 1px dashed rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.core-attach-item {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 5px 8px;
    display: flex;
    align-items: center;
    gap: 7px;
    transition: all 0.2s ease;
}

.core-attach-item:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(138, 162, 255, 0.35);
}

.attach-icon {
    width: 17px;
    height: 17px;
    stroke: #8aa2ff;
    flex-shrink: 0;
}

.attach-info {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
}

.attach-info b {
    font-size: 8.5px;
    color: #f1f4ff;
    font-weight: 700;
}

.attach-info small {
    font-size: 7.5px;
    color: var(--px-muted);
}

.attach-storage-icons {
    display: flex;
    align-items: center;
    gap: 3px;
    flex-shrink: 0;
}

.storage-badge {
    font-size: 7.5px;
    font-weight: 850;
    padding: 1px 4px;
    border-radius: 3px;
}

.storage-badge.s3 {
    background: rgba(57, 215, 128, 0.2);
    color: #39d780;
    border: 1px solid rgba(57, 215, 128, 0.4);
}

.storage-badge.nfs {
    background: rgba(79, 216, 255, 0.2);
    color: var(--px-cyan);
    border: 1px solid rgba(79, 216, 255, 0.4);
}

.or-txt {
    font-style: italic;
    font-size: 7px;
    color: var(--px-muted);
}

/* --------------------------------------------------------------------------
   BLOCK 4: AI MICRO SERVICES — 3 kategori × 5 servis, ikonlu
   -------------------------------------------------------------------------- */
.top-ai-matrix {
    background: linear-gradient(145deg, rgba(22, 35, 84, 0.85), rgba(7, 12, 38, 0.9));
    padding: 14px 16px 16px;
}

.ai-head {
    flex-direction: row;
    align-items: center;
    gap: 14px;
    margin-bottom: 12px;
    padding-bottom: 10px;
}

.ai-head strong {
    font-size: 15px;
    margin-right: auto;
}

.lang-tag {
    margin-left: 6px;
    font-size: 10px;
    font-weight: 750;
    color: #ffad53;
    background: rgba(255, 173, 83, 0.12);
    border: 1px solid rgba(255, 173, 83, 0.3);
    padding: 2px 7px;
    border-radius: 999px;
    vertical-align: 2px;
}

.ai-count {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--px-cyan);
    background: rgba(79, 216, 255, 0.12);
    border: 1px solid rgba(79, 216, 255, 0.25);
    padding: 4px 10px;
    border-radius: 999px;
}

.ai-groups {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ai-group { --gc: var(--px-cyan); flex: 1; display: flex; flex-direction: column; gap: 7px; }
.ai-group--doc { --gc: #8aa2ff; }
.ai-group--sec { --gc: #ffad53; }

.ai-group-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--gc);
}

.ai-group-label svg {
    width: 15px;
    height: 15px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.ai-group-label i {
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, color-mix(in srgb, var(--gc) 45%, transparent), transparent);
}

.ai-services-grid {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
}

.ai-chip {
    position: relative;
    overflow: hidden;
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-rows: auto 1fr;
    align-items: center;
    column-gap: 10px;
    row-gap: 8px;
    padding: 10px 12px 11px;
    border-radius: 13px;
    background: linear-gradient(160deg, color-mix(in srgb, var(--gc) 9%, transparent), rgba(255, 255, 255, 0.025));
    border: 1px solid color-mix(in srgb, var(--gc) 22%, transparent);
    transition: transform 0.35s var(--px-ease), border-color 0.3s, box-shadow 0.35s, background 0.3s;
    animation: chip-in 0.7s var(--px-ease) both;
    animation-delay: calc(0.25s + var(--i) * 45ms);
    cursor: default;
}

@keyframes chip-in {
    from { opacity: 0; transform: translateY(12px) scale(0.96); }
    to { opacity: 1; transform: none; }
}

.ai-chip:hover {
    transform: translateY(-3px);
    border-color: color-mix(in srgb, var(--gc) 70%, transparent);
    box-shadow: 0 12px 26px -12px color-mix(in srgb, var(--gc) 70%, transparent);
}

.chip-ico {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    color: var(--gc);
    background: color-mix(in srgb, var(--gc) 15%, transparent);
    border: 1px solid color-mix(in srgb, var(--gc) 35%, transparent);
    transition: transform 0.4s var(--px-ease), box-shadow 0.4s, background 0.4s, color 0.4s;
}

.chip-ico svg {
    width: 19px;
    height: 19px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.ai-chip:hover .chip-ico { transform: scale(1.08) rotate(-4deg); }

.ai-chip b {
    grid-column: 1 / -1;
    align-self: start;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.25;
    color: #eef2ff;
}

.ai-chip small {
    grid-row: 1;
    grid-column: 2;
    justify-self: end;
    align-self: start;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 10px;
    font-weight: 600;
    color: var(--px-muted);
    letter-spacing: 0.02em;
}

.chip-pulse {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--gc), transparent);
    opacity: 0;
    transform: scaleX(0.2);
    transition: opacity 0.4s, transform 0.6s var(--px-ease);
}

/* Dinamik işlem durumu (app.js her saniye sütun sütun ilerletir) */
.ai-chip.is-processing {
    border-color: color-mix(in srgb, var(--gc) 80%, transparent);
    box-shadow: 0 0 22px -6px var(--gc);
}

.ai-chip.is-processing .chip-ico {
    color: #0b1033;
    background: var(--gc);
    box-shadow: 0 0 16px var(--gc);
}

.ai-chip.is-processing .chip-pulse { opacity: 1; transform: scaleX(1); }
.ai-chip.is-processing small { color: var(--gc); }

/* --------------------------------------------------------------------------
   BOTTOM DEPLOYMENT & INFRASTRUCTURE STRIP
   -------------------------------------------------------------------------- */
.top-infra-strip {
    width: 100%;
    background: linear-gradient(145deg, rgba(18, 28, 70, 0.75), rgba(7, 12, 35, 0.8));
    border: 1px solid var(--px-border);
    border-radius: 14px;
    padding: 8px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.infra-label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #dce5ff;
    font-size: 9.5px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    flex-shrink: 0;
}

.infra-label svg {
    width: 15px;
    height: 15px;
    stroke: var(--px-cyan);
}

.infra-items {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.infra-pill {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 999px;
    padding: 4px 12px;
    font-size: 9.5px;
    font-weight: 700;
    color: #f1f4ff;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.infra-pill b {
    font-size: 11px;
}

.infra-pill:hover {
    background: rgba(86, 119, 255, 0.2);
    border-color: var(--px-cyan);
    transform: translateY(-1px);
}

/* --------------------------------------------------------------------------
   RESPONSIVE OPTIMIZATIONS
   -------------------------------------------------------------------------- */
@media (max-width: 1100px) {
    .top-architecture {
        grid-template-columns: 160px 55px 130px 55px 175px 50px 1fr;
    }
    .ai-services-grid {
        grid-template-columns: repeat(3, 1fr);
        grid-template-rows: auto;
    }
}

@media (max-width: 760px) {
    .top-architecture {
        display: flex;
        flex-direction: column;
        gap: 14px;
    }
    .top-connector {
        padding: 10px 0;
    }
    .conn-line {
        width: 2px;
        height: 24px;
    }
    .top-node-hub small {
        position: static;
        margin-top: 4px;
    }
    .ai-services-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .top-infra-strip {
        flex-direction: column;
        align-items: flex-start;
    }
}



/* ==========================================================================
   OKUNABİLİRLİK DÜZENİ (v3): AI katmanına daha çok alan, daha büyük etiketler
   ========================================================================== */
.topology-slide .body { max-height: none; }

.top-architecture {
    grid-template-columns: 172px 54px 142px 54px 182px 46px 1fr;
    min-height: 430px;
}

.top-tag { font-size: 10px; }
.top-head strong { font-size: 13.5px; line-height: 1.25; }
.top-device span,
.top-client-list li { font-size: 11.5px; }
.server-node span { font-size: 11.5px; }
.conn-proto { font-size: 9.5px; }
.top-node-hub small { font-size: 9px; white-space: normal; width: 58px; top: calc(100% + 22px); bottom: auto; }
.top-client-list li i { display: none; }
.top-client-list li { line-height: 1.25; }
.server-node span { white-space: nowrap; }
.attach-info b { font-size: 11px; }
.attach-info small { font-size: 9px; }
.core-port-badge { font-size: 10px; }
.server-id { font-size: 10px; }
.tech-badge { font-size: 9.5px; }

.top-infra-strip { padding: 10px 18px; }
.infra-label { font-size: 11px; }
.infra-pill {
    font-size: 12px;
    padding: 6px 13px 6px 10px;
    gap: 7px;
}
.infra-pill svg {
    width: 16px;
    height: 16px;
    flex: none;
    fill: none;
    stroke: var(--px-cyan);
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Açık tema */
html[data-theme="light"] .ai-group--bio { --gc: #0a8fc2; }
html[data-theme="light"] .ai-group--doc { --gc: #2b56f5; }
html[data-theme="light"] .ai-group--sec { --gc: #c46a00; }
html[data-theme="light"] .lang-tag { color: #b35f00; background: #fff4e6; border-color: rgba(196, 106, 0, 0.3); }
html[data-theme="light"] .ai-chip {
    background: linear-gradient(160deg, color-mix(in srgb, var(--gc) 7%, #fff), #fff);
    border-color: color-mix(in srgb, var(--gc) 22%, transparent);
}
html[data-theme="light"] .ai-chip b { color: #0b132e; }
html[data-theme="light"] .ai-chip small { color: #66739a; }
html[data-theme="light"] .ai-chip.is-processing small { color: var(--gc); }
html[data-theme="light"] .ai-chip.is-processing .chip-ico { color: #fff; }
html[data-theme="light"] .infra-pill svg { stroke: #1d45dc; }

/* Alçak ekran / küçük dizüstü */
@media (min-width: 761px) and (max-height: 790px) {
    .top-architecture { min-height: 330px; }
    .topology-slide .note { margin-top: 10px; }
    .ai-groups { gap: 8px; }
    .ai-group { gap: 4px; }
    .ai-group-label { font-size: 9.5px; }
    .ai-services-grid { gap: 6px; }
    .ai-chip { padding: 7px 9px; row-gap: 5px; column-gap: 8px; border-radius: 11px; }
    .chip-ico { width: 26px; height: 26px; border-radius: 8px; }
    .chip-ico svg { width: 15px; height: 15px; }
    .ai-chip b { font-size: 11.5px; }
    .ai-chip small { font-size: 9px; }
    .infra-pill { font-size: 11px; padding: 5px 11px 5px 9px; }
}

@media (max-width: 1100px) {
    .top-architecture { grid-template-columns: 150px 40px 124px 40px 165px 36px 1fr; }
    .ai-services-grid { grid-template-columns: repeat(5, 1fr); }
    .ai-chip b { font-size: 11.5px; }
}

@media (max-width: 760px) {
    .top-architecture { min-height: 0; }
    .ai-services-grid { grid-template-columns: repeat(2, 1fr); }
    .ai-chip b { font-size: 13px; }
}

@media (prefers-reduced-motion: reduce) {
    .ai-chip { animation: none; }
}
