/* ================================================================= */
/* 360-OS.CSS */
/* Specific styles for the Insight 360 OS "Visual Operating System" */
/* ================================================================= */

:root {
    --os-grid-color: rgba(255, 255, 255, 0.03);
    --os-glass-bg: rgba(20, 20, 25, 0.6);
    --os-glass-border: rgba(255, 255, 255, 0.08);
    --os-highlight: rgba(54, 142, 219, 0.6);
    --os-font-tech: 'Courier New', Courier, monospace;
}

/* --- Global OS Background (Grid) --- */
.page-360-os {
    /* Pure Black as requested */
    background-color: var(--color-bg-primary);
    background-image:
        linear-gradient(var(--os-grid-color) 1px, transparent 1px),
        linear-gradient(90deg, var(--os-grid-color) 1px, transparent 1px);
    background-size: 40px 40px;
    background-position: center top;
    position: relative;
    overflow-x: hidden;
    min-height: 100vh;
}

/* Fade at the bottom of the whole page to transition into CTA */
.page-360-os::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 400px;
    background: linear-gradient(to top, var(--color-bg-primary), transparent);
    z-index: 1;
    pointer-events: none;
}

.page-360-os .hero-video-container {
    position: relative;
    min-height: 60vh;
    width: 100%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #fff;
}

.page-360-os .hero-video-container::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 300px;
    /* Much deeper fade */
    /* Multi-stop gradient for a smoother "ease-in" feel */
    background: linear-gradient(to bottom,
            transparent 0%,
            rgba(19, 19, 19, 0.2) 20%,
            rgba(19, 19, 19, 0.5) 50%,
            rgba(19, 19, 19, 0.8) 80%,
            var(--color-bg-primary) 100%);
    z-index: 2;
    /* Above video and canvas, but behind content */
    pointer-events: none;
}

.page-360-os #hero-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    opacity: 0.5;
    /* Ensure it is above the background color but below content */
    pointer-events: auto;
    /* Allow mouse interaction */
    mix-blend-mode: screen;
    /* Enhance glow effect */
}

.page-360-os .hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1;
}

.page-360-os .hero-video-content {
    position: relative;
    z-index: 4;
    text-align: center;
    max-width: 900px;
    margin: 0 auto;
}

.page-360-os .hero-headline {
    margin-bottom: var(--spacing-sm) !important;
}

.page-360-os .hero-icon {
    font-size: 4rem;
    color: var(--color-accent-primary);
    margin-bottom: var(--spacing-sm);
    opacity: 0.9;
    display: inline-block;
    text-shadow: 0 0 20px rgba(54, 142, 219, 0.4);
}

/* --- HUD / Tech Elements --- */
.hud-text {
    font-family: var(--os-font-tech);
    font-size: 0.75rem;
    color: var(--color-accent-primary);
    text-transform: uppercase;
    letter-spacing: 2px;
    opacity: 0.8;
}

.hud-line {
    display: inline-block;
    height: 1px;
    background-color: var(--color-accent-primary);
    width: 40px;
    vertical-align: middle;
    margin: 0 10px;
    opacity: 0.5;
}

/* Wrapper for sections to add "window" feel */
.os-section-wrapper {
    position: relative;
    z-index: 2;
}

/* --- Glass Panels --- */
.glass-panel {
    background: var(--os-glass-bg);
    border: 1px solid var(--os-glass-border);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 4px;
    /* Techy, slight rounded */
    padding: var(--spacing-md);
    transition: all 0.3s ease;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
}

.glass-panel:hover {
    border-color: var(--os-highlight);
    box-shadow: 0 0 15px rgba(54, 142, 219, 0.15);
}

/* --- Clarity Tools: Bento Grid --- */
.clarity-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--spacing-md);
    padding: var(--spacing-md) 0;
}

.clarity-module {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
    min-height: 220px;
    text-align: left;
}

/* Reset anchor styling for linked clarity modules */
a.clarity-module-link {
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}

.module-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: var(--spacing-sm);
}

.module-icon {
    font-size: 2rem;
    color: var(--color-text-secondary);
    transition: color 0.3s ease;
    flex-shrink: 0;
    align-self: flex-start;
    margin-top: 2px;
}

.clarity-module:hover .module-icon {
    color: var(--color-accent-primary);
    text-shadow: 0 0 10px rgba(54, 142, 219, 0.4);
}

.module-title {
    font-family: var(--font-family-header);
    font-size: 1.25rem;
    margin: 0;
    font-weight: 700;
    text-align: left;
    flex: 1;
    min-width: 0;
}

.module-desc {
    font-size: 0.95rem;
    color: var(--color-text-secondary);
    line-height: 1.5;
    flex-grow: 1;
    text-align: left;
    /* Left align description */
}

.module-footer {
    margin-top: var(--spacing-sm);
    text-align: right;
}

/* --- Blueprints: Execution Protocols --- */
.protocols-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: var(--spacing-md);
}

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

.protocol-item {
    display: flex;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-family: var(--os-font-tech);
    font-size: 0.9rem;
    color: var(--color-text-secondary);
}

.protocol-item::before {
    content: "[ ]";
    margin-right: 15px;
    color: var(--color-accent-primary);
    font-weight: bold;
}

.protocol-item:hover,
.protocol-item.selected {
    color: var(--color-text-primary);
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.05));
    cursor: pointer;
}

.protocol-item:hover::before,
.protocol-item.selected::before {
    content: "[x]";
    color: var(--color-accent-primary);
    text-shadow: 0 0 5px var(--color-accent-primary);
}

.protocol-item.selected {
    border-left: 2px solid var(--color-accent-primary);
    padding-left: 10px;
    /* Slight offset for selected */
}

/* --- Floating CTA --- */
.blueprints-floating-cta {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.blueprints-floating-cta.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.cta-inner-glass {
    background: rgba(20, 20, 25, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--color-accent-primary);
    padding: 15px 25px;
    border-radius: 0;
    /* Squared edges as requested */
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    color: var(--color-text-primary);
    font-family: var(--font-family-header);
    font-weight: bold;
}

.ml-md {
    margin-left: var(--spacing-md);
}

.simple-list {
    padding-left: 1.2em;
    margin: 0;
}

.simple-list li {
    margin-bottom: 5px;
}

/* --- Insight 360 Guides Page --- */
.page-360-guides .guides-hero-section {
    padding-top: var(--spacing-xl);
    padding-bottom: var(--spacing-sm);
}

.page-360-guides .guides-categories-section {
    padding-top: 0;
    padding-bottom: var(--spacing-md);
}

.page-360-clarity-tools .guides-hero-section {
    padding-top: calc(var(--spacing-xl) + var(--spacing-lg));
    padding-bottom: var(--spacing-lg);
}

.page-360-guides .clarity-grid {
    grid-template-columns: 1fr;
    align-items: stretch;
}

.page-360-clarity-tools .clarity-grid {
    grid-template-columns: 1fr;
    align-items: stretch;
}

.guides-status-line {
    font-family: var(--os-font-tech);
    font-size: 0.8rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--color-text-secondary);
    margin: var(--spacing-md) 0 0;
}

.guide-card {
    min-height: 270px;
    height: 100%;
    text-align: left;
}

.guide-card .module-header {
    justify-content: flex-start;
    margin-bottom: var(--spacing-xs);
}

.guide-card .module-title {
    text-align: left;
    line-height: 1.35;
}

.guide-subtitle {
    font-family: var(--font-family-header);
    font-size: 0.95rem;
    color: var(--color-accent-primary);
    line-height: 1.5;
    text-align: left;
    margin: 0 0 var(--spacing-sm);
}

.guide-open-btn {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-xs);
}

.guide-open-btn .material-symbols-outlined {
    font-size: 1.1rem;
    line-height: 1;
}

.guide-actions {
    display: grid;
    gap: var(--spacing-xs);
}

.page-360-guides .guide-card .module-footer,
.page-360-clarity-tools .guide-card .module-footer {
    text-align: left;
}

.page-360-guides .guide-actions,
.page-360-clarity-tools .guide-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-sm);
    margin-top: auto;
    padding-top: var(--spacing-sm);
}

.page-360-guides .guide-card,
.page-360-clarity-tools .guide-card {
    min-height: 0;
    padding: calc(var(--spacing-sm) + var(--spacing-xs));
    justify-content: flex-start;
}

.page-360-guides .guide-card-top,
.page-360-clarity-tools .guide-card-top {
    display: grid;
    gap: var(--spacing-xs);
}

.page-360-guides .guide-card-meta,
.page-360-clarity-tools .guide-card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-xs);
}

.page-360-guides .guide-chip,
.page-360-clarity-tools .guide-chip {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid rgba(54, 142, 219, 0.45);
    background: rgba(54, 142, 219, 0.12);
    color: #c9deff;
    font-size: 0.72rem;
    font-family: var(--os-font-tech);
    letter-spacing: 1px;
    text-transform: uppercase;
}

.page-360-guides .guide-inline-action {
    appearance: none;
    border: 0;
    background: transparent;
    color: var(--color-text-secondary);
    font-size: 0.86rem;
    cursor: pointer;
    padding: 0;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.page-360-guides .guide-inline-action:hover {
    color: var(--color-text-primary);
}

.page-360-guides .guide-card .module-title,
.page-360-clarity-tools .guide-card .module-title {
    margin-top: 2px;
    font-size: 1.15rem;
    line-height: 1.28;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.page-360-guides .guide-card .guide-subtitle,
.page-360-clarity-tools .guide-card .guide-subtitle {
    margin: 0;
    color: #95c8ff;
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.page-360-guides .guide-open-btn,
.page-360-clarity-tools .guide-open-btn {
    width: auto;
    min-height: 40px;
    padding: 0.6rem 1.15rem;
    font-size: 0.98rem;
}

.page-360-clarity-tools .guide-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
}

.page-360-clarity-tools .guide-open-btn {
    flex-shrink: 0;
    white-space: nowrap;
}

.page-360-clarity-tools .card-secondary-link {
    flex-shrink: 0;
}

.page-360-guides .card-secondary-link,
.page-360-clarity-tools .card-secondary-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--color-text-secondary);
    text-decoration: none;
    font-family: var(--font-family-body);
    font-size: 0.96rem;
    white-space: nowrap;
}

.page-360-guides .card-secondary-link .material-symbols-outlined,
.page-360-clarity-tools .card-secondary-link .material-symbols-outlined {
    font-size: 1.05rem;
    line-height: 1;
}

.page-360-guides .card-secondary-link:hover,
.page-360-clarity-tools .card-secondary-link:hover {
    color: var(--color-text-primary);
}

.page-360-guide-detail {
    --guide-page-max: 980px;
    --guide-page-gutter: clamp(18px, 3.2vw, 34px);
    --guide-panel-pad: clamp(18px, 2.4vw, 26px);
    --guide-stack-tight: clamp(10px, 1.6vw, 14px);
    --guide-stack-base: clamp(14px, 2vw, 20px);
    --guide-stack-loose: clamp(24px, 3vw, 36px);
    --guide-tech-color: var(--color-accent-primary);
}

.page-360-guide-detail .main-container.max-w-900 {
    max-width: var(--guide-page-max) !important;
    padding-left: var(--guide-page-gutter);
    padding-right: var(--guide-page-gutter);
}

.page-360-guide-detail .section-padding {
    padding-top: var(--guide-stack-loose);
    padding-bottom: var(--guide-stack-loose);
}

.page-360-guide-detail .section-padding.pt-0 {
    padding-top: 0;
}

.page-360-guide-detail h1.section-headline {
    font-size: clamp(1.9rem, 4.4vw, 2.45rem);
    margin-bottom: var(--guide-stack-tight);
}

.page-360-guide-detail h2.section-headline {
    font-size: clamp(1.45rem, 2.7vw, 1.95rem);
    margin-bottom: var(--guide-stack-tight);
}

.page-360-guide-detail .guide-subtitle {
    max-width: 100%;
    margin: 0 0 var(--guide-stack-tight);
    color: #95c8ff;
}

.page-360-guide-detail .section-paragraph {
    max-width: 100%;
    margin: 0 0 var(--guide-stack-base);
    color: var(--color-text-secondary);
}

.page-360-guide-detail .hud-text {
    color: var(--guide-tech-color);
    opacity: 1;
}

.page-360-guide-detail .guide-detail-actions {
    display: flex;
    align-items: flex-start;
    gap: var(--guide-stack-base);
    flex-wrap: wrap;
}

.page-360-guide-detail .guide-detail-actions-bottom {
    margin-top: var(--guide-stack-tight);
}

.page-360-guide-detail .guide-detail-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 42px;
    padding: 0.62rem 1.2rem;
    white-space: nowrap;
}

.page-360-guide-detail .guide-detail-links {
    display: flex;
    align-items: center;
    gap: var(--guide-stack-base);
    flex-wrap: wrap;
    min-height: 42px;
}

.page-360-guide-detail .guide-detail-link {
    color: var(--color-text-secondary);
    text-decoration: none;
    border-bottom: 1px solid rgba(179, 179, 179, 0.5);
    font-size: 0.96rem;
    line-height: 1.2;
    padding-bottom: 2px;
}

.page-360-guide-detail .guide-detail-link:hover {
    color: var(--color-text-primary);
    border-bottom-color: rgba(234, 234, 234, 0.85);
}

.page-360-guide-detail .guide-detail-panel {
    padding: var(--guide-panel-pad);
}

.page-360-guide-detail .guide-split-grid {
    gap: var(--guide-stack-base);
}

.page-360-guide-detail .guide-faq-panel {
    display: grid;
    gap: var(--guide-stack-base);
}

.page-360-guide-detail .guide-faq-intro .section-paragraph {
    margin-bottom: 0;
}

.page-360-guide-detail .guide-faq-hint {
    margin-top: 6px;
    color: var(--guide-tech-color);
    font-family: var(--os-font-tech);
    font-size: 0.75rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    opacity: 0.92;
}

.page-360-guide-detail .guide-faq-stack {
    gap: var(--guide-stack-tight);
    overflow-anchor: none;
}

.page-360-guide-detail .guide-faq-item {
    padding: 12px 14px;
    border-color: rgba(255, 255, 255, 0.14);
    transition: border-color 0.22s ease, background-color 0.22s ease;
    overflow: clip;
}

.page-360-guide-detail .guide-faq-item:hover {
    border-color: rgba(54, 142, 219, 0.45);
    background: rgba(54, 142, 219, 0.07);
}

.page-360-guide-detail .guide-faq-item[open] {
    border-color: rgba(54, 142, 219, 0.52);
    background: rgba(54, 142, 219, 0.1);
}

.page-360-guide-detail .guide-faq-trigger {
    position: relative;
    display: block;
    padding-right: 30px;
    cursor: pointer;
    user-select: none;
}

.page-360-guide-detail .guide-faq-trigger::after {
    content: 'expand_more';
    font-family: 'Material Symbols Outlined';
    font-size: 1.3rem;
    line-height: 1;
    position: absolute;
    top: 50%;
    right: 0;
    transform: translateY(-50%);
    color: var(--color-accent-primary);
    transition: transform 0.22s ease;
}

.page-360-guide-detail .guide-faq-item[open] .guide-faq-trigger::after {
    transform: translateY(-50%) rotate(180deg);
}

.page-360-guide-detail .guide-faq-trigger:focus-visible {
    outline: 2px solid rgba(54, 142, 219, 0.65);
    outline-offset: 3px;
}

.page-360-guide-detail .guide-faq-answer {
    display: grid;
    grid-template-rows: 0fr;
    margin-top: 0;
    padding-top: 0;
    border-top: 1px solid transparent;
    opacity: 0.7;
    transition:
        grid-template-rows 0.3s ease,
        margin-top 0.3s ease,
        padding-top 0.3s ease,
        border-top-color 0.3s ease,
        opacity 0.2s ease;
}

.page-360-guide-detail .guide-faq-answer-inner {
    overflow: hidden;
    min-height: 0;
    line-height: 1.5;
}

.page-360-guide-detail .guide-faq-item[open] .guide-faq-answer {
    grid-template-rows: 1fr;
    margin-top: 8px;
    padding-top: 9px;
    border-top-color: rgba(255, 255, 255, 0.08);
    opacity: 1;
}

.guide-detail-panel {
    background: var(--os-glass-bg);
    border: 1px solid var(--os-glass-border);
    border-radius: 8px;
    padding: var(--spacing-md);
}

.guide-split-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--spacing-md);
}

.guide-bullet-list {
    margin: 0;
    padding-left: 1.2rem;
    display: grid;
    gap: 8px;
}

.guide-bullet-list li {
    color: var(--color-text-secondary);
    line-height: 1.5;
}

.guide-faq-stack {
    display: grid;
    gap: 12px;
}

.guide-faq-item {
    border: 1px solid var(--os-glass-border);
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    padding: 12px 14px;
}

.guide-faq-item summary {
    list-style: none;
    cursor: pointer;
    font-weight: 600;
}

.guide-faq-item summary::-webkit-details-marker {
    display: none;
}

.guide-faq-answer {
    margin-top: 10px;
    color: var(--color-text-secondary);
    line-height: 1.55;
}

.os-modal-open {
    overflow: hidden;
}

.os-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.72);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 9999;
}

.os-modal-backdrop[hidden] {
    display: none !important;
}

.os-modal-card {
    width: min(740px, 100%);
    max-height: 90vh;
    overflow-y: auto;
    background: #0f1117;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    padding: 22px;
    box-shadow: 0 24px 50px rgba(0, 0, 0, 0.5);
    position: relative;
}

.os-modal-actions {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: var(--spacing-md);
}

.os-modal-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    cursor: pointer;
    font-size: 22px;
    line-height: 1;
}

@media (max-width: 700px) {
    .os-modal-card {
        padding: 16px;
    }

    .guide-split-grid {
        grid-template-columns: 1fr;
    }

    .page-360-guide-detail .guide-detail-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .page-360-guide-detail .guide-detail-primary {
        width: 100%;
    }

    .page-360-guide-detail .guide-detail-links {
        min-height: 0;
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
}

@media (max-width: 640px) {

    .page-360-guides .guide-actions,
    .page-360-clarity-tools .guide-actions {
        align-items: flex-start;
        flex-direction: column;
    }

    .page-360-guides .guide-open-btn,
    .page-360-clarity-tools .guide-open-btn {
        width: 100%;
    }

    .os-modal-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .os-modal-actions .btn {
        width: 100%;
    }
}

@media (min-width: 768px) {
    .page-360-guides .clarity-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .page-360-os .clarity-grid-tools {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .page-360-os .clarity-grid-guide-cats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .page-360-clarity-tools .clarity-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 1200px) {
    .page-360-os .clarity-grid-tools {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .page-360-os .clarity-grid-guide-cats {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .page-360-clarity-tools .clarity-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* --- Responsive Overrides --- */
@media (max-width: 600px) {
    .blueprints-floating-cta {
        bottom: 20px;
        right: 15px;
        left: 15px;
        /* Full width approach for mobile */
    }

    .cta-inner-glass {
        padding: 8px 12px;
        font-size: 0.85rem;
        justify-content: space-between;
    }

    .cta-inner-glass .btn-sm {
        padding: 0.5rem 1rem;
        font-size: 0.75rem;
        margin-left: 8px;
    }
}
