/* ==========================================================================
   SIGTEKX AWS — CLOUD INFRASTRUCTURE DEEP DIVE
   ========================================================================== */

.sigtekx-aws-page {
    padding: 4rem 20px;
    max-width: 1100px;
    margin: 0 auto;
    position: relative;
    z-index: 10;
}

/* --- Hero --- */
.aws-hero {
    margin-bottom: 5rem;
    border-bottom: 1px solid #222;
    padding-bottom: 3rem;
}

.aws-hero .breadcrumb {
    font-family: 'Kode Mono', monospace;
    font-size: 0.75rem;
    color: #555;
    margin-bottom: 1.5rem;
    display: flex;
    gap: 8px;
    align-items: center;
}

.aws-hero .breadcrumb a {
    color: #666;
    text-decoration: none;
    transition: color 0.2s ease;
}

.aws-hero .breadcrumb a:hover {
    color: var(--accent-primary);
}

.aws-hero .breadcrumb .sep {
    color: #444;
}

.aws-hero h1 {
    font-size: 3rem;
    color: #fff;
    margin: 0 0 0.5rem 0;
    text-transform: uppercase;
    letter-spacing: -1px;
}

.aws-hero .module-tag {
    font-family: 'Kode Mono', monospace;
    font-size: 1rem;
    color: var(--accent-primary);
    margin-bottom: 2rem;
    display: block;
}

.aws-hero .abstract {
    font-size: 1.05rem;
    line-height: 1.8;
    color: #d0d0d0;
    max-width: 800px;
}

/* --- Section Titles --- */
.aws-section {
    margin-bottom: 5rem;
}

.aws-section-title {
    font-size: 1.5rem;
    color: var(--accent-primary);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 15px;
}

.aws-section-title::after {
    content: "";
    flex-grow: 1;
    height: 1px;
    background: linear-gradient(90deg, #333, transparent);
}

.section-text {
    font-size: 1.05rem;
    line-height: 1.8;
    color: #d0d0d0;
    margin-bottom: 2rem;
}

.section-text code {
    font-family: 'Kode Mono', monospace;
    font-size: 0.95em;
    color: var(--accent-primary);
    background: rgba(255, 69, 0, 0.06);
    padding: 1px 6px;
    border: 1px solid rgba(255, 69, 0, 0.15);
}

.section-text strong {
    color: var(--accent-primary);
}

/* --- Diagram Containers (shared with hub) --- */
.diagram-container {
    background: #0d0d0d;
    border: 1px solid #333;
    padding: 30px;
    margin: 2rem 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: zoom-in;
    transition: border-color 0.3s ease;
    position: relative;
}

.diagram-container:hover {
    border-color: var(--accent-primary);
}

.diagram-container::before {
    content: "CLICK TO EXPLORE";
    position: absolute;
    top: 10px;
    right: 10px;
    font-family: 'Kode Mono', monospace;
    font-size: 0.6rem;
    color: var(--accent-primary);
    letter-spacing: 1px;
    opacity: 0.5;
}

.diagram-container img {
    max-width: 100%;
    height: auto;
    display: block;
}

.diagram-caption {
    font-family: 'Kode Mono', monospace;
    font-size: 0.8rem;
    color: #888;
    margin-top: 20px;
    text-align: center;
    border-top: 1px solid #222;
    padding-top: 10px;
    width: 100%;
}

/* --- Screenshot containers --- */
.screenshot-container {
    background: #0d0d0d;
    border: 1px solid #333;
    padding: 4px;
    margin: 2rem 0;
    transition: border-color 0.3s ease;
    cursor: zoom-in;
    position: relative;
}

.screenshot-container:hover {
    border-color: var(--accent-primary);
}

.screenshot-container::before {
    content: "CLICK TO EXPLORE";
    position: absolute;
    top: 10px;
    right: 10px;
    font-family: 'Kode Mono', monospace;
    font-size: 0.6rem;
    color: var(--accent-primary);
    letter-spacing: 1px;
    opacity: 0.5;
    z-index: 2;
}

.screenshot-container img {
    width: 100%;
    height: auto;
    display: block;
}

.screenshot-label {
    font-family: 'Kode Mono', monospace;
    font-size: 0.8rem;
    color: #888;
    padding: 10px 12px;
    border-top: 1px solid #222;
    text-align: center;
}

/* --- Instance Spec Card --- */
.instance-card {
    background: #0a0a0a;
    border: 1px solid #222;
    margin-bottom: 3rem;
    overflow: hidden;
}

.instance-header {
    padding: 1.2rem 2rem;
    background: rgba(255, 69, 0, 0.04);
    border-bottom: 1px solid #222;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.instance-header h3 {
    font-family: 'Kode Mono', monospace;
    font-size: 0.8rem;
    color: var(--accent-primary);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin: 0;
}

.instance-header .spot-badge {
    font-family: 'Kode Mono', monospace;
    font-size: 0.7rem;
    color: #0a0a0a;
    background: var(--accent-primary);
    padding: 3px 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.instance-specs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0;
}

.spec-block {
    padding: 1.5rem 2rem;
    border-right: 1px solid #1a1a1a;
    border-bottom: 1px solid #1a1a1a;
}

.spec-block:nth-child(3n) {
    border-right: none;
}

.spec-block:nth-last-child(-n+3) {
    border-bottom: none;
}

.spec-label {
    font-family: 'Kode Mono', monospace;
    font-size: 0.65rem;
    color: #555;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 6px;
}

.spec-value {
    font-family: 'Kode Mono', monospace;
    font-size: 0.95rem;
    color: #fff;
}

.spec-value.accent {
    color: var(--accent-primary);
}

/* --- Service Grid (AWS services used) --- */
.service-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2px;
    background: #222;
    border: 1px solid #222;
    margin-bottom: 3rem;
}

.service-item {
    background: #0a0a0a;
    padding: 1.5rem;
}

.service-name {
    font-family: 'Kode Mono', monospace;
    font-size: 0.85rem;
    color: #fff;
    margin-bottom: 8px;
}

.service-role {
    font-size: 0.8rem;
    color: #666;
    line-height: 1.5;
}

/* --- Pipeline Steps --- */
.pipeline {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin: 2rem 0 3rem 0;
}

.pipeline-step {
    display: grid;
    grid-template-columns: 60px 1fr;
    gap: 0;
    position: relative;
}

.pipeline-index {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 1.5rem;
}

.pipeline-num {
    width: 32px;
    height: 32px;
    border: 1px solid #333;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Kode Mono', monospace;
    font-size: 0.75rem;
    color: #666;
    background: #0a0a0a;
    position: relative;
    z-index: 1;
}

.pipeline-step:hover .pipeline-num {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.pipeline-line {
    width: 1px;
    flex-grow: 1;
    background: #222;
}

.pipeline-step:last-child .pipeline-line {
    display: none;
}

.pipeline-body {
    border: 1px solid #1a1a1a;
    border-left: none;
    padding: 1.5rem 2rem;
    margin-bottom: 2px;
    transition: border-color 0.2s ease;
}

.pipeline-step:hover .pipeline-body {
    border-color: #333;
}

.pipeline-script {
    font-family: 'Kode Mono', monospace;
    font-size: 0.85rem;
    color: var(--accent-primary);
    margin-bottom: 6px;
}

.pipeline-desc {
    font-size: 0.9rem;
    color: #888;
    line-height: 1.6;
}

/* --- Docker Build Stages --- */
.docker-stages {
    display: grid;
    grid-template-columns: 1fr 40px 1fr;
    gap: 0;
    align-items: stretch;
    margin: 2rem 0 3rem 0;
}

.docker-stage {
    background: #0a0a0a;
    border: 1px solid #222;
    padding: 2rem;
}

.docker-stage:hover {
    border-color: #333;
}

.docker-stage-header {
    font-family: 'Kode Mono', monospace;
    font-size: 0.7rem;
    color: #555;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 0.5rem;
}

.docker-stage-title {
    font-family: 'Kode Mono', monospace;
    font-size: 1.1rem;
    color: #fff;
    margin-bottom: 1rem;
}

.docker-stage-base {
    font-family: 'Kode Mono', monospace;
    font-size: 0.75rem;
    color: var(--accent-primary);
    background: rgba(255, 69, 0, 0.06);
    padding: 4px 10px;
    border: 1px solid rgba(255, 69, 0, 0.15);
    display: inline-block;
    margin-bottom: 1.2rem;
}

.docker-stage-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.docker-stage-list li {
    font-size: 0.85rem;
    color: #888;
    padding: 6px 0;
    border-bottom: 1px solid #1a1a1a;
    padding-left: 12px;
    position: relative;
}

.docker-stage-list li::before {
    content: ">";
    position: absolute;
    left: 0;
    color: #444;
    font-family: 'Kode Mono', monospace;
}

.docker-stage-list li:last-child {
    border-bottom: none;
}

.docker-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Kode Mono', monospace;
    color: #444;
    font-size: 1.2rem;
}

/* --- IAM Policies --- */
.iam-card {
    background: #0a0a0a;
    border: 1px solid #222;
    margin-bottom: 2rem;
    overflow: hidden;
}

.iam-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #1a1a1a;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.iam-role {
    font-family: 'Kode Mono', monospace;
    font-size: 0.85rem;
    color: #fff;
}

.iam-type {
    font-family: 'Kode Mono', monospace;
    font-size: 0.65rem;
    color: #555;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.iam-policies {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 0;
}

.iam-policy {
    padding: 1rem 1.5rem;
    border-right: 1px solid #1a1a1a;
}

.iam-policy:last-child {
    border-right: none;
}

.iam-policy-name {
    font-family: 'Kode Mono', monospace;
    font-size: 0.8rem;
    color: var(--accent-primary);
    margin-bottom: 4px;
}

.iam-policy-type {
    font-size: 0.7rem;
    color: #555;
}

/* --- Cost Table --- */
.cost-table {
    width: 100%;
    border-collapse: collapse;
    font-family: 'Kode Mono', monospace;
    font-size: 0.85rem;
    margin: 2rem 0;
}

.cost-table th {
    text-align: left;
    border-bottom: 2px solid #333;
    padding: 10px 12px;
    color: #666;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.cost-table td {
    padding: 12px;
    border-bottom: 1px solid #1a1a1a;
    color: #a0a0a0;
}

.cost-table tr:last-child td {
    border-bottom: none;
    color: #fff;
    border-top: 1px solid #333;
}

.cost-table .cost-value {
    color: var(--accent-primary);
    text-align: right;
}

/* --- Decision Rationale Cards --- */
.rationale-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2px;
    background: #222;
    border: 1px solid #222;
    margin: 2rem 0;
}

.rationale-card {
    background: #0a0a0a;
    padding: 2rem;
}

.rationale-q {
    font-family: 'Kode Mono', monospace;
    font-size: 0.85rem;
    color: #fff;
    margin-bottom: 0.8rem;
}

.rationale-a {
    font-size: 0.85rem;
    color: #888;
    line-height: 1.6;
}

.rationale-a strong {
    color: var(--accent-primary);
    font-weight: 600;
}

/* --- Security Callout --- */
.security-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 2px;
    background: #222;
    border: 1px solid #222;
    margin: 2rem 0;
}

.security-item {
    background: #0a0a0a;
    padding: 1.5rem;
}

.security-item h4 {
    font-family: 'Kode Mono', monospace;
    font-size: 0.8rem;
    color: #fff;
    margin: 0 0 8px 0;
}

.security-item p {
    font-size: 0.8rem;
    color: #666;
    line-height: 1.5;
    margin: 0;
}

/* --- Screenshots Side by Side --- */
.screenshots-duo {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin: 2rem 0;
}

/* --- Performance Metrics (Cloud) --- */
.perf-wrap {
    background: #0a0a0a;
    border: 1px solid #222;
    padding: 2rem;
    margin: 2rem 0;
}

.perf-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0;
    border-top: 1px solid #1a1a1a;
    border-left: 1px solid #1a1a1a;
}

.perf-metric {
    padding: 1.5rem;
    border-right: 1px solid #1a1a1a;
    border-bottom: 1px solid #1a1a1a;
    background: #0d0d0d;
}

.perf-value {
    font-family: 'Kode Mono', monospace;
    font-size: 1.5rem;
    color: var(--accent-primary);
    font-weight: 600;
    margin-bottom: 6px;
}

.perf-label {
    font-family: 'Kode Mono', monospace;
    font-size: 0.65rem;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.perf-context {
    font-family: 'Kode Mono', monospace;
    font-size: 0.75rem;
    color: #555;
    margin-top: 1.5rem;
    padding-top: 1.2rem;
    border-top: 1px solid #1a1a1a;
    line-height: 1.8;
    text-align: right;
}

/* --- Actions --- */
.aws-actions {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-top: 4rem;
}

/* --- Explorer Modal --- */
#diagram-explorer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(5, 5, 5, 0.98);
    z-index: 99999;
    display: none;
    flex-direction: column;
}

.explorer-header {
    padding: 20px 40px;
    background: #000;
    border-bottom: 1px solid #222;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
}

.explorer-title {
    font-family: 'Kode Mono', monospace;
    color: var(--accent-primary);
    font-size: 0.9rem;
}

.explorer-btns {
    display: flex;
    gap: 20px;
    align-items: center;
}

.explorer-content {
    flex: 1;
    position: relative;
    overflow: hidden;
    cursor: grab;
    display: flex;
    align-items: center;
    justify-content: center;
}

.explorer-content:active {
    cursor: grabbing;
}

#explorer-img {
    position: absolute;
    transform-origin: center;
    will-change: transform;
    user-select: none;
    -webkit-user-drag: none;
    max-width: none;
}

.close-btn {
    font-size: 2.5rem;
    color: #fff;
    cursor: pointer;
    line-height: 1;
}

.close-btn:hover {
    color: var(--accent-primary);
}

.explorer-hint {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: #666;
    padding: 8px 15px;
    border: 1px solid #222;
    font-family: 'Kode Mono', monospace;
    font-size: 0.7rem;
    pointer-events: none;
}

/* --- Responsive --- */
@media (max-width: 900px) {
    .aws-hero h1 {
        font-size: 2.2rem;
    }

    .instance-specs {
        grid-template-columns: 1fr 1fr;
    }

    .spec-block:nth-child(3n) {
        border-right: 1px solid #1a1a1a;
    }

    .spec-block:nth-child(2n) {
        border-right: none;
    }

    .docker-stages {
        grid-template-columns: 1fr;
    }

    .docker-arrow {
        transform: rotate(90deg);
        padding: 0.5rem 0;
    }

    .iam-policies {
        grid-template-columns: 1fr;
    }

    .iam-policy {
        border-right: none;
        border-bottom: 1px solid #1a1a1a;
    }

    .iam-policy:last-child {
        border-bottom: none;
    }

    .rationale-grid {
        grid-template-columns: 1fr;
    }

    .screenshots-duo {
        grid-template-columns: 1fr;
    }

    .perf-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 600px) {
    .instance-specs {
        grid-template-columns: 1fr;
    }

    .spec-block {
        border-right: none !important;
    }

    .service-grid {
        grid-template-columns: 1fr;
    }

    .perf-grid {
        grid-template-columns: 1fr;
    }

    .perf-context {
        text-align: left;
    }
}
