/**
 * About Page Styles
 * Three-column layout matching network page aesthetic
 */

/* ========================================
   PAGE SETUP
   ======================================== */

body.about-page {
    overflow: hidden;
}

body.about-page .site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: #fff;
}

body.about-page footer {
    display: none !important;
}

/* ========================================
   ABOUT APP CONTAINER
   ======================================== */

.about-app {
    padding-top: 68px; /* Header height */
    height: 100vh;
    overflow: hidden;
}

@media (max-width: 768px) {
    .about-app {
        padding-bottom: 60px; /* Space for bottom tab bar */
        height: calc(100vh - 60px); /* Adjust height to account for tab bar */
    }
}

/* ========================================
   THREE-COLUMN GRID
   ======================================== */

.about-layout {
    display: grid;
    grid-template-columns: 5fr 4fr 3fr;
    height: calc(100vh - 68px);
    overflow: hidden;
}

.about-column {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-right: 1px solid #e5e5e5;
    background: #fff;
}

.about-column:last-child {
    border-right: none;
}

/* ========================================
   LEFT COLUMN - UNIVERSE GRAPH
   ======================================== */

.about-column--visual {
    background: #fcfcfc;
    position: relative;
    min-height: 0;
    overflow: hidden;
}

.about-visual-container {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.universe-graph-container {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
}

.universe-graph-container svg {
    width: 100%;
    height: 100%;
}

/* ========================================
   CENTER COLUMN - DETAIL
   ======================================== */

.about-column--detail {
    background: #fff;
    overflow-y: auto;
}

.about-detail-container {
    padding: 2rem;
    min-height: 100%;
}

/* Hide mobile-only elements on desktop */
.about-drag-handle,
.about-pull-tab {
    display: none;
}

/* Empty state */
.about-detail-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    text-align: center;
}

.about-detail-empty .placeholder-content {
    color: #999;
}

.about-detail-empty .placeholder-content svg {
    color: #ccc;
    margin-bottom: 1rem;
}

.about-detail-empty .placeholder-content h3 {
    font-size: 0.85rem;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #666;
    margin-bottom: 0.5rem;
}

.about-detail-empty .placeholder-content p {
    font-size: 0.75rem;
    color: #999;
}

/* Detail content */
.about-detail-content {
    max-width: 100%;
}

.about-detail-header {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #e5e5e5;
}

.about-detail-title {
    font-size: 1.5rem;
    font-weight: 500;
    color: #1a1a1a;
    margin: 0 0 0.5rem 0;
    line-height: 1.4;
}

.about-detail-subtitle {
    font-size: 1.2rem;
    color: #666;
    margin: 0;
}

.about-detail-body {
    font-size: 1.0rem;
    line-height: 1.7;
    color: #333;
}

.about-detail-body p {
    margin: 0 0 1rem 0;
}

.about-detail-body p:last-child {
    margin-bottom: 0;
}

/* Grid layouts for content */
.about-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin: 1.5rem 0;
}

.about-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin: 1.5rem 0;
}

.about-card {
    padding: 1.5rem;
    border: 1px solid #e5e5e5;
    background: #fff;
}

.about-card h5 {
    font-size: 0.85rem;
    font-weight: 500;
    margin: 0 0 0.5rem 0;
    color: #1a1a1a;
}

.about-card p {
    font-size: 0.75rem;
    color: #666;
    margin: 0;
    line-height: 1.6;
}

/* Table styles */
.about-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
}

.about-table thead {
    border-bottom: 1px solid #e5e5e5;
}

.about-table th {
    text-align: left;
    padding: 0.75rem 0;
    font-size: 0.7rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #666;
}

.about-table td {
    padding: 0.75rem 0;
    font-size: 0.75rem;
    color: #333;
    border-bottom: 1px solid #f0f0f0;
}

.about-table td:first-child {
    font-weight: 500;
    color: #1a1a1a;
}

/* Definition list */
.about-dl {
    margin: 1.5rem 0;
}

.about-dl dt {
    font-size: 0.7rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #999;
    margin-top: 1.5rem;
}

.about-dl dt:first-child {
    margin-top: 0;
}

.about-dl dd {
    font-size: 0.8rem;
    color: #333;
    margin: 0.5rem 0 0 0;
}

.about-dl dd span {
    font-size: 2rem;
    font-weight: 300;
    color: #1a1a1a;
}

/* Node detail styles */
.node-detail {
    padding: 1.5rem 0;
}

.node-detail-header {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #e5e5e5;
}

.node-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 0.5rem;
    border: 1px solid;
}

.node-title {
    font-size: 1.25rem;
    font-weight: 400;
    margin: 0 0 0.5rem 0;
    color: #1a1a1a;
}

.node-description {
    font-size: 0.8rem;
    color: #666;
    margin: 0;
}

.node-section {
    margin-bottom: 1.5rem;
}

.node-section-title {
    font-size: 0.7rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #999;
    margin: 0 0 0.75rem 0;
}

.node-section-content {
    font-size: 0.8rem;
    line-height: 1.7;
    color: #333;
}

.tech-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.tech-tag {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    background: #f5f5f5;
    font-size: 0.7rem;
    color: #666;
}

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

.connection-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    color: #666;
    margin-bottom: 0.5rem;
}

.connection-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* ========================================
   RIGHT COLUMN - NAVIGATION
   ======================================== */

.about-column--nav {
    background: #fafafa;
}

.about-nav-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.about-nav-header {
    padding: 1.5rem;
    border-bottom: 1px solid #e5e5e5;
    background: #fff;
    flex-shrink: 0;
}

.about-nav-header h2 {
    font-size: 0.7rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: #1a1a1a;
    margin: 0;
}

.about-nav-list {
    flex: 1;
    overflow-y: auto;
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.nav-item {
    display: block;
    width: 100%;
    padding: 1rem;
    background: #fff;
    border: 1px solid #e5e5e5;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
    text-decoration: none;
    color: #1a1a1a;
}

.nav-item:hover {
    border-color: #1a1a1a;
    background: #fafafa;
}

.nav-item.active {
    border-color: #1a1a1a;
    border-width: 2px;
    padding: calc(1rem - 1px);
    background: #fff;
}

.nav-item-label {
    font-size: 0.8rem;
    font-weight: 400;
    color: inherit;
}

/* HTMX loading indicator */
.htmx-request .about-detail-container {
    opacity: 0.6;
    pointer-events: none;
}

/* ========================================
   RESPONSIVE
   ======================================== */

/* Hide mobile nav toggle on desktop */
/* Mobile nav toggle button styling is handled in base.css */
.mobile-nav-overlay {
    display: none;
}

@media (max-width: 1200px) {
    .about-layout {
        grid-template-columns: 1fr 1fr;
    }
    
    .about-column--nav {
        display: none;
    }
}

@media (max-width: 768px) {
    .about-layout {
        display: flex;
        flex-direction: column;
        height: 100%;
    }
    
    /* Column 5 (visual) - full screen fixed */
    .about-column--visual {
        position: fixed;
        top: 68px; /* Header height */
        left: 0;
        right: 0;
        bottom: 60px; /* Tab bar height */
        width: 100%;
        height: calc(100vh - 68px - 60px);
        z-index: 1;
        order: 1;
    }
    
    /* Column 4 (detail) - starts mostly off-screen below, draggable bottom sheet */
    .about-column--detail {
        position: fixed;
        top: calc(95vh - 120px); /* Start mostly off-screen, showing ~80px peek */
        left: 0;
        right: 0;
        bottom: 60px; /* Tab bar height */
        width: 100%;
        height: calc(100vh - 68px - 60px);
        overflow: visible; /* No internal scrolling - whole container moves */
        z-index: 2;
        background: #fff;
        order: 2;
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
        border-radius: 20px 20px 0 0;
        will-change: transform;
        touch-action: pan-y; /* Allow vertical panning */
    }
    
    /* Bounce animation for content updates */
    .about-column--detail.bounce {
        animation: bottomSheetBounce 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    }
    
    @keyframes bottomSheetBounce {
        0% {
            transform: translateY(var(--current-translate, 0));
        }
        25% {
            transform: translateY(calc(var(--current-translate, 0) - 8px));
        }
        50% {
            transform: translateY(calc(var(--current-translate, 0) + 5px));
        }
        70% {
            transform: translateY(calc(var(--current-translate, 0) - 3px));
        }
        85% {
            transform: translateY(calc(var(--current-translate, 0) + 2px));
        }
        100% {
            transform: translateY(var(--current-translate, 0));
        }
    }
    
    /* Drag handle */
    /* Drag handle - show on mobile */
    .about-drag-handle {
        display: flex;
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 40px;
        align-items: center;
        justify-content: center;
        cursor: grab;
        z-index: 10;
        background: #fff;
        border-radius: 20px 20px 0 0;
    }
    
    .about-drag-handle:active {
        cursor: grabbing;
    }
    
    .about-drag-handle-bar {
        width: 40px;
        height: 4px;
        background: #ccc;
        border-radius: 2px;
        margin-top: 8px;
    }
    
    /* Pull-up tab indicator - show on mobile */
    .about-pull-tab,
    #about-pull-tab {
        display: flex !important;
        position: fixed !important;
        bottom: calc(60px + 20px) !important; /* Tab bar height + offset */
        left: 50% !important;
        transform: translateX(-50%) translateY(0) !important;
        width: 56px !important;
        height: 32px !important;
        background: #fff !important;
        border: 1px solid #e5e5e5 !important;
        border-radius: 20px 20px 0 0 !important;
        align-items: center !important;
        justify-content: center !important;
        cursor: pointer !important;
        z-index: 3 !important;
        box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.1) !important;
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease !important;
        opacity: 1 !important;
        pointer-events: auto !important;
        color: #000000 !important;
        font-family: inherit !important;
        font-size: inherit !important;
        font-weight: inherit !important;
        text-transform: none !important;
        letter-spacing: normal !important;
        padding: 0 !important;
        margin: 0 !important;
    }
    
    .about-pull-tab.hidden,
    #about-pull-tab.hidden {
        opacity: 0 !important;
        pointer-events: none !important;
        transform: translateX(-50%) translateY(20px) !important;
    }
    
    .about-pull-tab:hover:not(.hidden),
    #about-pull-tab:hover:not(.hidden) {
        background: #f5f5f5 !important;
        box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.15) !important;
        transform: translateX(-50%) translateY(-2px) !important;
        color: #000000 !important;
    }
    
    .about-pull-tab:active:not(.hidden),
    #about-pull-tab:active:not(.hidden) {
        transform: translateX(-50%) translateY(0px) !important;
        background: #fff !important;
        color: #000000 !important;
    }
    
    .about-pull-tab svg,
    #about-pull-tab svg {
        width: 20px !important;
        height: 20px !important;
        stroke: #000000 !important;
        fill: none !important;
        stroke-width: 2.5 !important;
        stroke-linecap: round !important;
        stroke-linejoin: round !important;
        transition: transform 0.3s ease !important;
        color: #000000 !important;
    }
    
    .about-pull-tab svg polyline,
    #about-pull-tab svg polyline {
        stroke: #000000 !important;
        fill: none !important;
    }
    
    .about-pull-tab:not(.hidden) svg {
        animation: slideUpBounce 0.6s ease-out;
    }
    
    @keyframes slideUpBounce {
        0% {
            transform: translateY(10px);
            opacity: 0;
        }
        60% {
            transform: translateY(-2px);
        }
        100% {
            transform: translateY(0);
            opacity: 1;
        }
    }
    
    /* Hide pull tab when bottom sheet is fully expanded */
    .about-column--detail.expanded ~ .about-pull-tab,
    .about-column--detail.expanded + .about-pull-tab {
        opacity: 0;
        pointer-events: none;
    }
    
    /* Detail container - scrollable content */
    .about-detail-container {
        height: 100%;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        padding-top: 40px; /* Space for drag handle */
        padding: 2rem;
        padding-top: calc(2rem + 40px); /* Space for drag handle + padding */
        padding-bottom: calc(10vh + 50px); /* 10% margin + space for scroll indicator */
        position: relative;
        min-height: 100%;
    }
    
    /* Scroll indicator button */
    .about-scroll-indicator {
        position: absolute;
        bottom: 1rem;
        left: 50%;
        transform: translateX(-50%);
        width: 48px;
        height: 48px;
        border-radius: 50%;
        background: rgba(255, 255, 255, 0.95);
        border: 1px solid #e5e5e5;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        z-index: 10;
        transition: opacity 0.3s ease, transform 0.3s ease;
        opacity: 0;
        pointer-events: none;
    }
    
    .about-scroll-indicator.visible {
        opacity: 1;
        pointer-events: auto;
    }
    
    .about-scroll-indicator:hover {
        transform: translateX(-50%) translateY(-2px);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    }
    
    .about-scroll-indicator svg {
        width: 20px;
        height: 20px;
        stroke: #1a1a1a;
        stroke-width: 2;
    }
    
    /* Column 3 (nav) - slide-out menu */
    .about-column--nav {
        order: 3;
        display: block !important; /* Override display: none from 1200px breakpoint */
        position: fixed;
        top: 0;
        right: -100%;
        width: 80%;
        max-width: 320px;
        height: 100vh;
        z-index: 1000;
        background: #fff;
        transition: right 0.3s ease;
        box-shadow: -2px 0 8px rgba(0, 0, 0, 0.1);
        overflow-y: auto;
    }
    
    .about-column--nav.mobile-nav-open {
        right: 0;
    }
    
    .about-grid-2,
    .about-grid-3 {
        grid-template-columns: 1fr;
    }
    
    /* Mobile nav toggle button */
    /* Mobile nav toggle button is now in header - styling handled in base.css */
    
    /* Mobile nav overlay */
    .mobile-nav-overlay {
        display: block;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s ease, visibility 0.3s ease;
    }
    
    .mobile-nav-overlay.active {
        opacity: 1;
        visibility: visible;
    }
    
    /* Prevent body scroll when menu is open */
    body.mobile-nav-open {
        overflow: hidden;
    }
}
