/* Templates Page Styles */

/* Page background */
body {
    background: #f9f8f4;
    overflow-x: hidden;
}
html {
    overflow-x: hidden;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
html::-webkit-scrollbar {
    display: none;
}
.footer {
    background: #000000 !important;
}

/* ========================================
   Hero Section
   ======================================== */
.templates_hero {
    margin-top: 6.5vw;
    margin-bottom: 6vw;
    padding: 0 2.8vw;
}

.templates_hero_box {
    background: #0a0a0a;
    min-height: 26vw;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    border-radius: 1.5vw;
    padding: 4vw 2vw;
}

/* Conway's Game of Life Canvas */
#gameOfLife {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

/* Animated gradient blobs */
.templates_blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.85;
    transition: transform 0.15s ease-out;
}

.templates_blob.blob1 {
    width: 40vw;
    height: 40vw;
    background: radial-gradient(circle, rgba(140, 80, 200, 0.7) 0%, rgba(100, 60, 160, 0.4) 40%, transparent 70%);
    top: 10%;
    left: 15%;
    animation: templatesBlob1 12s ease-in-out infinite;
}

.templates_blob.blob2 {
    width: 35vw;
    height: 35vw;
    background: radial-gradient(circle, rgba(80, 140, 220, 0.7) 0%, rgba(60, 100, 180, 0.4) 40%, transparent 70%);
    top: 5%;
    right: 20%;
    animation: templatesBlob2 14s ease-in-out infinite;
}

.templates_blob.blob3 {
    width: 30vw;
    height: 30vw;
    background: radial-gradient(circle, rgba(100, 180, 150, 0.7) 0%, rgba(60, 140, 100, 0.4) 40%, transparent 70%);
    bottom: 10%;
    left: 30%;
    animation: templatesBlob3 10s ease-in-out infinite;
}

@keyframes templatesBlob1 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(5%, 10%) scale(1.05); }
    50% { transform: translate(-5%, 5%) scale(0.95); }
    75% { transform: translate(3%, -5%) scale(1.02); }
}
@keyframes templatesBlob2 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(-8%, -5%) scale(1.08); }
    50% { transform: translate(5%, 8%) scale(0.92); }
    75% { transform: translate(-3%, 3%) scale(1.05); }
}
@keyframes templatesBlob3 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(6%, -8%) scale(0.95); }
    50% { transform: translate(-4%, -4%) scale(1.1); }
    75% { transform: translate(-6%, 6%) scale(0.98); }
}

/* Hero Content */
.templates_hero_content {
    position: relative;
    z-index: 10;
    text-align: center;
    padding: 0 2vw;
}

.templates_hero_badge {
    display: inline-block;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 0.5vw 1.5vw;
    border-radius: 100px;
    font-size: 0.9vw;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 1.5vw;
    font-weight: 500;
    letter-spacing: 0.05em;
}

.templates_hero_content h1 {
    color: #ffffff;
    font-size: 3.5vw;
    font-weight: 400;
    margin: 0;
    line-height: 1.2;
    font-style: italic;
    font-family: 'Times New Roman', Times, serif;
}

.templates_hero_content p {
    color: rgba(255, 255, 255, 0.8);
    font-size: 1.1vw;
    margin-top: 1.5vw;
    max-width: 50vw;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.6;
    font-weight: 400;
}

/* ========================================
   Mobile Responsiveness
   ======================================== */
@media (max-width: 768px) {
    .templates_hero {
        margin-top: 80px;
        margin-bottom: 60px;
        padding: 0 4vw;
    }

    .templates_hero_box {
        min-height: auto;
        padding: 12vw 6vw;
        border-radius: 4vw;
    }

    .templates_hero_badge {
        font-size: 2.8vw;
        padding: 1.5vw 4vw;
        margin-bottom: 4vw;
    }

    .templates_hero_content h1 {
        font-size: 7vw;
    }

    .templates_hero_content p {
        font-size: 3.5vw;
        max-width: 100%;
        margin-top: 4vw;
    }

    .templates_blob.blob1 {
        width: 60vw;
        height: 60vw;
    }

    .templates_blob.blob2 {
        width: 50vw;
        height: 50vw;
    }

    .templates_blob.blob3 {
        width: 45vw;
        height: 45vw;
    }
}

@media (max-width: 480px) {
    .templates_hero {
        margin-top: 75px;
        margin-bottom: 50px;
        padding: 0 4vw;
    }

    .templates_hero_box {
        padding: 15vw 5vw;
        border-radius: 5vw;
    }

    .templates_hero_badge {
        font-size: 3.2vw;
        padding: 2vw 5vw;
    }

    .templates_hero_content h1 {
        font-size: 9vw;
    }

    .templates_hero_content p {
        font-size: 4vw;
    }
}

/* ========================================
   Flow Diagram Section
   ======================================== */
.flow_diagram_section {
    padding: 4vw 5vw 6vw;
    background: #ffffff;
}

.flow_diagram_header {
    text-align: center;
    margin-bottom: 3vw;
}

.flow_badge {
    display: inline-block;
    padding: 0.4vw 1.2vw;
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 2vw;
    color: #3b82f6;
    font-size: 0.8vw;
    font-weight: 500;
    margin-bottom: 1vw;
}

.flow_diagram_header h2 {
    font-size: 2.5vw;
    font-weight: 400;
    font-style: italic;
    font-family: 'Times New Roman', Times, serif;
    color: #1a1a1a;
    margin-bottom: 0.8vw;
}

.flow_diagram_header p {
    font-size: 1vw;
    color: #666;
}

.flow_diagram_container {
    position: relative;
    background: #ffffff;
    border-radius: 1.5vw;
    padding: 3vw;
    border: 2px solid #e0e0e0;
    min-height: 28vw;
}

.ecosystem_label {
    position: absolute;
    bottom: -0.7vw;
    left: 50%;
    transform: translateX(-50%);
    background: #ffffff;
    padding: 0 1vw;
    font-size: 1vw;
    font-weight: 700;
    color: #1a1a1a;
}

/* SVG Flow Connections */
.flow_connections {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.flow_line {
    fill: none;
    stroke: #1a1a1a;
    stroke-width: 2;
    stroke-dasharray: 8 4;
    animation: flowDash 1s linear infinite;
}

.flow_line.flow_pass {
    stroke: #22c55e;
}

.flow_line.flow_fail {
    stroke: #ef4444;
}

.flow_arrow {
    fill: #1a1a1a;
}

.flow_arrow.flow_pass {
    fill: #22c55e;
}

.flow_arrow.flow_fail {
    fill: #ef4444;
}

@keyframes flowDash {
    to {
        stroke-dashoffset: -24;
    }
}

/* Grid Layout */
.flow_diagram_grid {
    position: relative;
    z-index: 2;
    display: flex;
    gap: 1.5vw;
    height: 100%;
}

/* Box Containers */
.edge_sites_box,
.cloud_sites_box {
    position: relative;
    border: 2px solid #d0d0d0;
    border-radius: 1vw;
    background: #ffffff;
}

.edge_sites_box {
    flex: 2.5;
    padding: 2vw;
    display: grid;
    grid-template-columns: auto 1fr 1fr 1fr;
    grid-template-rows: auto auto auto;
    gap: 1.5vw;
    align-items: center;
}

.cloud_sites_box {
    flex: 1;
    padding: 2vw;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1vw;
}

.box_label {
    position: absolute;
    top: -0.7vw;
    left: 1.5vw;
    background: #ffffff;
    padding: 0 0.5vw;
    font-size: 0.9vw;
    font-weight: 700;
    color: #1a1a1a;
}

/* Flow Items */
.flow_item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3vw;
}

.item_box {
    background: #ffffff;
    border: 1px solid #d0d0d0;
    border-radius: 0.5vw;
    padding: 0.8vw 1.2vw;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3vw;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    transition: all 0.3s ease;
}

.item_box:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    border-color: #3b82f6;
}

.item_icon {
    width: 2.2vw;
    height: 2.2vw;
}

.item_icon svg {
    width: 100%;
    height: 100%;
    color: #1a1a1a;
}

.item_name {
    font-size: 0.8vw;
    font-weight: 600;
    color: #1a1a1a;
    text-align: center;
    white-space: nowrap;
}

.item_sub {
    font-size: 0.7vw;
    color: #666;
}

.item_label {
    font-size: 0.7vw;
    color: #666;
    margin-top: 0.3vw;
}

/* Grid Positions - Edge Sites */
.user_item {
    grid-column: 1;
    grid-row: 2;
}

.orch_item {
    grid-column: 2;
    grid-row: 2;
}

.slm_item {
    grid-column: 3;
    grid-row: 1;
}

.reward_item {
    grid-column: 4;
    grid-row: 1;
}

.pass_label_box {
    grid-column: 4;
    grid-row: 2;
    justify-self: center;
}

.cache_item {
    grid-column: 4;
    grid-row: 3;
}

.response_label_box {
    grid-column: 2 / 4;
    grid-row: 3;
    justify-self: start;
    align-self: center;
}

/* Flow Labels */
.flow_label {
    font-size: 0.75vw;
    color: #1a1a1a;
    text-align: center;
    line-height: 1.4;
}

.label_pass {
    color: #22c55e;
    font-weight: 700;
}

.label_fail {
    color: #ef4444;
    font-weight: 700;
}

/* Cloud Box Items */
.fail_label_box {
    margin-top: 1vw;
}

.cloud_item {
    margin-top: 1vw;
}

.cloud_response_label_box {
    margin-top: auto;
    margin-bottom: 1vw;
}

/* ========================================
   Flow Diagram Mobile Responsiveness
   ======================================== */
@media (max-width: 1024px) {
    .flow_diagram_container {
        overflow-x: auto;
    }

    .flow_diagram_grid {
        min-width: 60vw;
    }
}

@media (max-width: 768px) {
    .flow_diagram_section {
        padding: 8vw 4vw;
    }

    .flow_badge {
        font-size: 2.8vw;
        padding: 1.2vw 3vw;
    }

    .flow_diagram_header h2 {
        font-size: 6vw;
    }

    .flow_diagram_header p {
        font-size: 3.5vw;
    }

    .flow_diagram_container {
        padding: 4vw;
        min-height: 70vw;
    }

    .flow_diagram_grid {
        min-width: 130vw;
    }

    .box_label {
        font-size: 2.5vw;
    }

    .item_icon {
        width: 5vw;
        height: 5vw;
    }

    .item_name {
        font-size: 2.2vw;
    }

    .item_sub,
    .item_label {
        font-size: 1.8vw;
    }

    .item_box {
        padding: 2vw;
    }

    .flow_label {
        font-size: 2vw;
    }

    .ecosystem_label {
        font-size: 2.5vw;
    }

    .edge_sites_box {
        gap: 3vw;
        padding: 4vw;
    }

    .cloud_sites_box {
        padding: 4vw;
        gap: 2vw;
    }
}

@media (max-width: 480px) {
    .flow_diagram_grid {
        min-width: 170vw;
    }

    .flow_diagram_container {
        min-height: 90vw;
    }

    .flow_diagram_header h2 {
        font-size: 7vw;
    }

    .flow_diagram_header p {
        font-size: 4vw;
    }

    .item_icon {
        width: 6vw;
        height: 6vw;
    }

    .item_name {
        font-size: 2.8vw;
    }

    .item_box {
        padding: 2.5vw;
    }

    .box_label {
        font-size: 3vw;
    }

    .flow_label {
        font-size: 2.5vw;
    }
}

/* ========================================
   Color System Reference Section
   ======================================== */
.color_system_section {
    padding: 4vw 5vw 6vw;
    background: #F8FAFC;
}

.color_system_header {
    text-align: center;
    margin-bottom: 3vw;
}

.color_badge {
    display: inline-block;
    padding: 0.4vw 1.2vw;
    background: rgba(140, 51, 239, 0.1);
    border: 1px solid rgba(140, 51, 239, 0.3);
    border-radius: 2vw;
    color: #8C33EF;
    font-size: 0.8vw;
    font-weight: 500;
    margin-bottom: 1vw;
}

.color_system_header h2 {
    font-size: 2.5vw;
    font-weight: 400;
    font-style: italic;
    font-family: 'Times New Roman', Times, serif;
    color: #1a1a1a;
    margin-bottom: 0.8vw;
}

.color_system_header p {
    font-size: 1vw;
    color: #475569;
    max-width: 50vw;
    margin: 0 auto;
    line-height: 1.6;
}

.color_group {
    margin-bottom: 3vw;
}

.color_group h3 {
    font-size: 1.3vw;
    font-weight: 600;
    color: #120E1C;
    margin-bottom: 0.8vw;
}

.color_group_desc {
    font-size: 0.9vw;
    color: #64748B;
    margin-bottom: 1.5vw;
    line-height: 1.5;
}

.color_swatches {
    display: flex;
    gap: 1.5vw;
    flex-wrap: wrap;
    margin-bottom: 1.5vw;
}

.color_swatch {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.4vw;
    flex: 0 0 calc(25% - 1.2vw);
    max-width: calc(25% - 1.2vw);
}

.swatch_color {
    width: 100%;
    height: 5vw;
    border-radius: 0.5vw;
    border: 1px solid #E2E8F0;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.swatch_color:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.swatch_name {
    font-size: 0.85vw;
    font-weight: 600;
    color: #1E293B;
}

.swatch_hex {
    font-size: 0.75vw;
    color: #64748B;
    font-family: 'Courier New', monospace;
    background: #F1F5F9;
    padding: 0.2vw 0.5vw;
    border-radius: 0.25vw;
}

/* CSS Variables Code Block */
.css_vars_group {
    background: #ffffff;
    padding: 2vw;
    border-radius: 1vw;
    border: 1px solid #E2E8F0;
}

.css_vars_code {
    background: #120E1C;
    color: #F1F5F9;
    padding: 1.5vw;
    border-radius: 0.5vw;
    overflow-x: auto;
    font-size: 0.8vw;
    line-height: 1.7;
}

.css_vars_code code {
    font-family: 'Courier New', Consolas, monospace;
    white-space: pre;
}

/* ========================================
   Color System Mobile Responsiveness
   ======================================== */
@media (max-width: 1024px) {
    .color_swatch {
        flex: 0 0 calc(50% - 0.75vw);
        max-width: calc(50% - 0.75vw);
    }

    .swatch_color {
        height: 8vw;
    }
}

@media (max-width: 768px) {
    .color_system_section {
        padding: 8vw 4vw;
    }

    .color_badge {
        font-size: 2.8vw;
        padding: 1.2vw 3vw;
    }

    .color_system_header h2 {
        font-size: 6vw;
    }

    .color_system_header p {
        font-size: 3.5vw;
        max-width: 100%;
    }

    .color_group h3 {
        font-size: 4vw;
    }

    .color_group_desc {
        font-size: 3vw;
    }

    .color_swatch {
        flex: 0 0 calc(50% - 2vw);
        max-width: calc(50% - 2vw);
    }

    .swatch_color {
        height: 15vw;
    }

    .swatch_name {
        font-size: 3vw;
    }

    .swatch_hex {
        font-size: 2.5vw;
    }

    .css_vars_group {
        padding: 4vw;
    }

    .css_vars_code {
        font-size: 2.2vw;
        padding: 3vw;
    }
}

@media (max-width: 480px) {
    .color_swatch {
        flex: 0 0 100%;
        max-width: 100%;
    }

    .swatch_color {
        height: 20vw;
    }

    .color_system_header h2 {
        font-size: 7vw;
    }

    .color_group h3 {
        font-size: 5vw;
    }

    .swatch_name {
        font-size: 4vw;
    }

    .swatch_hex {
        font-size: 3vw;
    }

    .css_vars_code {
        font-size: 2.8vw;
    }
}
