/* ============================================================
   Evidence Board - Corkboard Investigation Wall
   ============================================================ */

/* ---- Board Container ---- */
#evidence-board {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: #5a4025;
    background-image:
        repeating-linear-gradient(0deg, rgba(0,0,0,0.03) 0px, transparent 1px, transparent 4px),
        repeating-linear-gradient(90deg, rgba(0,0,0,0.03) 0px, transparent 1px, transparent 4px),
        radial-gradient(ellipse at 30% 40%, rgba(120,90,50,0.4) 0%, transparent 60%),
        radial-gradient(ellipse at 70% 60%, rgba(100,75,40,0.3) 0%, transparent 60%);
    box-shadow: inset 0 0 60px rgba(0,0,0,0.5);
}

#board-connections {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

#board-cards {
    position: absolute;
    inset: 0;
    z-index: 2;
}

/* ---- Board Header ---- */
.board-header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 10;
    padding: 8px 12px;
    background: rgba(30, 20, 10, 0.85);
    backdrop-filter: blur(4px);
    border-bottom: 1px solid rgba(255,255,255,0.08);
    display: flex;
    align-items: center;
    gap: 12px;
}

.board-title {
    font-family: 'Source Code Pro', monospace;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 1.5px;
    color: #c0392b;
}

.board-strength-bar {
    flex: 1;
    height: 4px;
    background: rgba(255,255,255,0.08);
    border-radius: 2px;
    overflow: hidden;
}

.board-strength-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 0.5s ease, background 0.5s ease;
}

.board-strength-text {
    font-family: 'Source Code Pro', monospace;
    font-size: 0.6rem;
    color: rgba(255,255,255,0.5);
    white-space: nowrap;
}

/* ---- Base Card ---- */
.bcard {
    position: absolute;
    cursor: pointer;
    transform: rotate(var(--rot, 0deg));
    transform-origin: top center;
    transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.4s ease;
    background: #f5f0e8;
    border-radius: 2px;
    box-shadow: 2px 2px 6px rgba(0,0,0,0.35), 0 1px 2px rgba(0,0,0,0.2);
    opacity: 0;
    translate: 0 -10px;
    user-select: none;
}

.bcard-visible {
    opacity: 1;
    translate: 0 0;
}

.bcard:hover {
    transform: rotate(calc(var(--rot, 0deg) * 0.3)) scale(1.08);
    box-shadow: 4px 6px 14px rgba(0,0,0,0.45);
    z-index: 50;
}

.bcard-dragging {
    transform: rotate(2deg) scale(1.1) !important;
    box-shadow: 8px 12px 24px rgba(0,0,0,0.5) !important;
    cursor: grabbing !important;
    transition: none !important;
    z-index: 100 !important;
}

/* ---- Person Card ---- */
.bcard-person {
    width: 85px;
    padding: 18px 8px 10px;
    text-align: center;
}

.bcard-portrait {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #3a3025;
    color: #e8dcc8;
    font-family: 'Libre Franklin', sans-serif;
    font-size: 0.75rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 6px;
    border: 2px solid #8b7355;
}

.bcard-name {
    font-family: 'Libre Franklin', sans-serif;
    font-size: 0.65rem;
    font-weight: 700;
    color: #2c2014;
    line-height: 1.2;
}

.bcard-sub {
    font-family: 'Source Code Pro', monospace;
    font-size: 0.5rem;
    color: #7a6b58;
    margin-top: 2px;
    line-height: 1.3;
}

/* ---- Document Card ---- */
.bcard-document {
    width: 110px;
    padding: 18px 10px 10px;
    background: #fffef5;
    border-left: 3px solid #c0392b;
}

.bcard-snippet {
    font-family: 'Source Code Pro', monospace;
    font-size: 0.45rem;
    color: #8a7d6b;
    margin-top: 4px;
    line-height: 1.4;
}

/* ---- Organization Card ---- */
.bcard-org {
    width: 100px;
    padding: 14px 10px 10px;
    text-align: center;
    background: #e8e0d0;
    border: 1px solid #c8b89a;
}

/* ---- Project Compass (Central Node) ---- */
.bcard-compass {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: rgba(0,0,0,0.6);
    border: 2px dashed rgba(192, 57, 43, 0.6);
    box-shadow: 0 0 15px rgba(192, 57, 43, 0.3);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    transform: none;
}

.bcard-compass:hover {
    transform: scale(1.05);
}

.compass-label {
    font-family: 'Source Code Pro', monospace;
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 1px;
    color: rgba(192, 57, 43, 0.8);
}

.compass-status {
    font-family: 'Source Code Pro', monospace;
    font-size: 1.2rem;
    color: rgba(255,255,255,0.4);
    margin-top: 4px;
}

.compass-revealed {
    border: 2px solid #c0392b;
    background: rgba(120, 0, 0, 0.7);
    box-shadow: 0 0 20px rgba(231, 76, 60, 0.5), inset 0 0 15px rgba(0,0,0,0.4);
    animation: compassPulse 3s ease-in-out infinite;
}

.compass-revealed .compass-label {
    color: #e74c3c;
}

.compass-revealed .compass-status {
    color: #e74c3c;
    font-weight: 700;
    font-size: 0.7rem;
    letter-spacing: 1px;
}

@keyframes compassPulse {
    0%, 100% { box-shadow: 0 0 20px rgba(231,76,60,0.5); }
    50% { box-shadow: 0 0 35px rgba(231,76,60,0.8), 0 0 60px rgba(231,76,60,0.2); }
}

/* ---- Pin & Tape ---- */
.bcard-pin {
    position: absolute;
    top: -7px;
    left: 50%;
    translate: -50% 0;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 35%, #e74c3c, #922b21);
    box-shadow: 0 2px 4px rgba(0,0,0,0.5), inset 0 1px 2px rgba(255,255,255,0.3);
    z-index: 10;
}

.bcard-tape {
    position: absolute;
    top: -5px;
    left: 50%;
    translate: -50% 0;
    width: 32px;
    height: 14px;
    background: rgba(255, 245, 150, 0.65);
    border-radius: 2px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.15);
    z-index: 10;
}

/* ---- SVG Connections ---- */
.bconn {
    fill: none;
    stroke-linecap: round;
}

.bconn-source {
    stroke: rgba(236, 240, 241, 0.5);
    stroke-width: 1.5;
    stroke-dasharray: 4 3;
}

.bconn-org {
    stroke: rgba(149, 165, 166, 0.4);
    stroke-width: 1;
    stroke-dasharray: 6 4;
}

.bconn-evidence {
    stroke: rgba(192, 57, 43, 0.7);
    stroke-width: 2;
}

.bconn-implicates {
    stroke: rgba(231, 76, 60, 0.85);
    stroke-width: 3;
}

.bconn-label {
    font-family: 'Source Code Pro', monospace;
    font-size: 8px;
    fill: rgba(255,255,255,0.4);
    text-anchor: middle;
    pointer-events: none;
}

/* ---- Inspect Panel ---- */
#board-inspect {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 240px;
    background: rgba(22, 27, 34, 0.94);
    backdrop-filter: blur(8px);
    border-left: 1px solid rgba(255,255,255,0.08);
    padding: 16px;
    overflow-y: auto;
    transform: translateX(100%);
    transition: transform 0.25s ease;
    z-index: 200;
    color: var(--text-primary, #e6edf3);
}

#board-inspect.visible {
    transform: translateX(0);
}

.inspect-close {
    position: absolute;
    top: 8px;
    right: 8px;
    background: none;
    border: none;
    color: rgba(255,255,255,0.4);
    font-size: 0.85rem;
    cursor: pointer;
    padding: 4px 8px;
}

.inspect-close:hover {
    color: #fff;
}

.inspect-type {
    font-family: 'Source Code Pro', monospace;
    font-size: 0.55rem;
    letter-spacing: 2px;
    color: #c0392b;
    margin-bottom: 4px;
}

.inspect-name {
    font-family: 'Libre Franklin', sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 2px;
}

.inspect-subtitle {
    font-family: 'Source Code Pro', monospace;
    font-size: 0.7rem;
    color: rgba(255,255,255,0.5);
    margin-bottom: 12px;
}

.inspect-desc {
    font-family: 'Lora', serif;
    font-size: 0.8rem;
    line-height: 1.6;
    color: rgba(255,255,255,0.7);
    margin-bottom: 16px;
}

.inspect-section {
    margin-top: 12px;
}

.inspect-heading {
    font-family: 'Source Code Pro', monospace;
    font-size: 0.6rem;
    letter-spacing: 1.5px;
    color: rgba(255,255,255,0.35);
    margin-bottom: 8px;
}

.inspect-conn {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
    font-size: 0.75rem;
}

.inspect-conn-type {
    font-family: 'Source Code Pro', monospace;
    font-size: 0.55rem;
    padding: 2px 6px;
    border-radius: 3px;
    white-space: nowrap;
}

.inspect-conn-source {
    background: rgba(236, 240, 241, 0.15);
    color: #ecf0f1;
}

.inspect-conn-org {
    background: rgba(149, 165, 166, 0.15);
    color: #95a5a6;
}

.inspect-conn-evidence {
    background: rgba(192, 57, 43, 0.2);
    color: #e74c3c;
}

.inspect-conn-implicates {
    background: rgba(231, 76, 60, 0.25);
    color: #ff6b6b;
}

.inspect-conn-name {
    color: rgba(255,255,255,0.7);
}

/* ---- Mobile: List Mode ---- */
@media (max-width: 768px) {
    #evidence-board {
        overflow-y: auto;
        padding: 50px 12px 12px;
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        align-content: flex-start;
    }

    #board-connections {
        display: none;
    }

    .bcard {
        position: static !important;
        transform: none !important;
        translate: none !important;
        width: calc(50% - 4px) !important;
        opacity: 1;
    }

    .bcard-compass {
        width: 100% !important;
        height: auto;
        border-radius: 8px;
        padding: 12px;
        flex-direction: row;
        gap: 12px;
    }

    #board-inspect {
        width: 100%;
        height: 50%;
        top: auto;
        right: 0;
        bottom: 0;
        transform: translateY(100%);
        border-left: none;
        border-top: 1px solid rgba(255,255,255,0.08);
    }

    #board-inspect.visible {
        transform: translateY(0);
    }
}
