/* static/css/profile.css */

/* --- 1. The Deep Environment --- */
#arboretum-bg-canvas, #arboretum-tree-canvas {
    position: fixed; inset: 0; z-index: -2;
    width: 100vw; height: 100vh;
    pointer-events: none;
}
#arboretum-tree-canvas { z-index: -1; }

/* Push the sky and stars to the absolute background */
#sky.sky-container {
    position: fixed;
    inset: 0;
    z-index: -5 !important; 
    pointer-events: none;
}

/* Ensure the mountains and trees render in front of the sky */
#arboretum-wrapper {
    position: fixed;
    inset: 0;
    z-index: -2 !important;
    pointer-events: none;
}

/* --- 2. The UI Scaffolding --- */

/* Glassmorphism (Overriding main.css) */
.comment-card {
    background: rgba(82, 92, 116, 0.4);
    backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(4px);
    border: 1px solid rgba(56, 189, 248, 0.15);
    box-shadow: 0 20px 40px rgba(0,0,0,0.6), inset 0 0 20px rgba(56,189,248,0.05);
}

/* --- 3. Master Header Layout --- */
#summary-section.profile-summary {
    display: flex;
    flex-direction: row; /* Overrides the column stack from main.css */
    justify-content: space-between;
    align-items: center; 
    flex-wrap: wrap;
    gap: 2rem;
}

.ledger-profile-group {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

/* Left-Aligned Text Block (Repurposed from right-aligned) */
.profile-details-right {
    display: flex;
    flex-direction: column;
    align-items: flex-start; /* Anchors children to the left */
    text-align: left;        /* Aligns typography to the left */
    flex-grow: 1;
    padding-left: 1rem;      /* Gives breathing room from the crystal */
}

/* Force Stats to left-align */
.stat-row { 
    display: flex; 
    gap: 2.5rem; 
    justify-content: flex-start; /* Anchors the stat blocks to the left */
}

/* --- Cryptographic Identity Styling --- */
.profile-avatar-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
    width: 160px;
    align-self: stretch; /* Fills the summary section vertically */
}

.profile-avatar-container svg {
    width: 100%;
    height: 100%;
    object-fit: contain;
    /* Adds an ambient, icy glow behind the animated SVG */
    filter: drop-shadow(0 0 15px rgba(56, 189, 248, 0.4)); 
}

/* Left-Aligned Text Block (Repurposed from right-aligned) */
.profile-details-right {
    display: flex;
    flex-direction: column;
    align-items: flex-start; /* Anchors children to the left */
    text-align: left;        /* Aligns typography to the left */
    flex-grow: 1;
    padding-left: 1rem;      /* Gives breathing room from the crystal */
}

/* Reveal the 3D gap by spinning it */
@keyframes masterSpin {
    from { transform: rotateX(0deg) rotateY(0deg); }
    to { transform: rotateX(0deg) rotateY(-360deg); }
}

/* Ensure the wrapper respects the 3D depth */
#master-identity-wrapper {
    transform-style: preserve-3d;
    transform-origin: center center;
}

/* --- The New Cryptographic Identity Block --- */
.genomic-key-display {
    font-family: monospace;
    font-size: 0.95rem; /* Large enough to command presence */
    color: #38bdf8;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(56, 189, 248, 0.2);
    padding: 12px 16px;
    border-radius: 6px;
    word-break: break-all; /* CRITICAL: Forces the raw string to wrap within the column */
    line-height: 1.5;
    letter-spacing: 2px;
    box-shadow: inset 0 0 15px rgba(0,0,0,0.5);
    max-width: 600px; /* Prevents it from stretching endlessly on ultra-wide screens */
    margin-bottom: 0.5rem;
}


/* --- Master Identity DNA Container: High-Density "Chip" Optimization --- */
.master-dna-container {
    width: fit-content;
    padding: 0.6rem 0.8rem; /* Drastically reduced to hug the data */
    background: rgba(8, 12, 24, 0.85); /* Darker base for hardware contrast */
    border: 1px solid rgba(56, 189, 248, 0.4); /* Sharper edge line */
    border-radius: 6px; /* Harder corners */
    box-shadow: inset 0 0 12px rgba(0, 0, 0, 0.9); /* Deeply recessed socket look */
    display: flex;
    justify-content: center;
    align-items: center;
}

.master-dna-container .dna-block {
    width: 7.2ch; /* Widened to safely fit 6 characters + letter spacing */
    height: 58px; /* Compressed to exactly 4 rows based on line-height */
    line-height: 1.15;
    letter-spacing: 0.1em;
    padding: 0;
    margin: 0;
    text-align: center;
    resize: none;
    overflow: hidden;
    font-size: 0.8rem; /* Slight step down for terminal-style precision */
    color: #7dd3fc; /* Forces a crisp, illuminated cyan */
    text-shadow: 0 0 5px rgba(56, 189, 248, 0.6); /* LED glow effect */
}

/* --- 4. Activity Feeds --- */
.activity-list { display: flex; flex-direction: column; gap: 1rem; }
.activity-item {
    background: rgba(2, 6, 23, 0.4); border: 1px solid rgba(255,255,255,0.05);
    border-radius: 8px; padding: 1.2rem 1.2rem 0.8rem 1.2rem; 
    transition: background 0.2s ease, border-color 0.2s ease; cursor: pointer;
}
.activity-item:hover { background: rgba(56, 189, 248, 0.05); border-color: rgba(56, 189, 248, 0.3); }

.activity-title { color: #e2e8f0; font-size: 1.1rem; margin-bottom: 0.5rem; font-weight: 500; }
.activity-desc { 
    color: #94a3b8; 
    font-size: 0.9rem; 
    line-height: 1.5; 
    
    /* Legacy Webkit */
    display: -webkit-box; 
    -webkit-line-clamp: 2; 
    -webkit-box-orient: vertical; 
    
    /* Standard Fallbacks */
    line-clamp: 2; 
    overflow: hidden; 
}
.activity-footer {
    margin-top: 1rem; padding-top: 0.8rem; border-top: 1px solid rgba(255, 255, 255, 0.05);
    display: flex; justify-content: space-between; align-items: center;
    font-size: 0.8rem; color: #64748b; 
}
.activity-stats-left, .activity-stats-right { display: flex; gap: 1.5rem; align-items: center; }
.stat-pill span { color: #38bdf8; }
.stat-pill.forecast span.accumulating { color: #34d399; }
.stat-pill.snowfall { display: flex; align-items: center; gap: 4px; }
.mini-activity-flake { width: 16px; height: 16px; }

/* --- Constellation / Drift Carousel Layout --- */
.drift-carousel-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
}

/* The Scroll Buttons - Explicitly sized and protected from shrinking */
.drift-scroll-btn {
    flex-shrink: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 24px;
    height: 24px;
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(255,255,255,0.2);
    color: #38bdf8;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s;
    z-index: 10;
}

.drift-scroll-btn:hover {
    background: #38bdf8;
    color: #0f172a;
}

/* The Flake Container - Allowed to grow, forced to handle overflow internally */
.scrollable-drift {
    flex-grow: 1;
    min-width: 0; /* Critical: prevents flex-child from expanding parent beyond 100% */
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    scroll-behavior: smooth;
    gap: 4px;
    padding: 12px;
    background: rgba(0,0,0,0.3);
    border-radius: 6px;
    box-shadow: inset 0 2px 10px rgba(0,0,0,0.5);
    
    /* Hide scrollbar visually while keeping functionality */
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.scrollable-drift::-webkit-scrollbar {
    display: none;
}

/* Flake Wrappers */
.drift-flake-wrapper {
    flex: 0 0 auto;
    width: 44px;
    height: 44px;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 50%;
    position: relative;
    transition: transform 0.3s, z-index 0.3s;
}

.drift-flake-wrapper + .drift-flake-wrapper {
    margin-left: -10px; /* Overlap effect */
}

.drift-flake-wrapper:hover {
    transform: scale(1.2);
    z-index: 5;
}