/* ========================================================
   APPLE-INSPIRED BASIC & BOLD MODERN DESIGN SYSTEM
   ======================================================== */

:root {
    --bg-color: #09090b; /* Stark Apple Black */
    --card-bg: #18181b;   /* Zinc-900 */
    --card-border: #27272a; /* Zinc-800 */
    --card-border-hover: #3f3f46; /* Zinc-700 */
    
    --text-primary: #fafafa; /* Zinc-50 */
    --text-secondary: #a1a1aa; /* Zinc-400 */
    --text-muted: #71717a; /* Zinc-500 */
    
    --accent-purple: #c084fc; /* Violet-400 */
    --accent-teal: #22d3ee; /* Cyan-400 */
    --accent-pink: #f472b6; /* Pink-400 */
    --accent-green: #34d399; /* Emerald-400 */
    --accent-blue: #3b82f6; /* Blue-500 */
    
    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-display: 'Outfit', var(--font-sans);
}

/* Reset overrides */
.demo-body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-sans);
    overflow: hidden;
}

.demo-wrapper {
    display: grid;
    grid-template-columns: 260px 1fr;
    height: 100vh;
    width: 100vw;
    background-color: var(--bg-color);
}

/* Sidebar - Apple Clean Style */
.demo-sidebar {
    background: #09090b;
    border-right: 1px solid var(--card-border);
    padding: 2rem 1.25rem;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.sidebar-header {
    margin-bottom: 2rem;
}

.logo-text {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 1.4rem;
    letter-spacing: -0.03em;
    color: var(--text-primary);
}

.logo-icon {
    margin-right: 0.25rem;
}

.user-profile-badge {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.25rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--card-border);
    padding-bottom: 1rem;
}

.badge-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
}

.badge-name {
    font-size: 0.88rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.badge-role {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.nav-item {
    background: none;
    border: none;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 0.85rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
    width: 100%;
    text-decoration: none;
}

.nav-item:hover {
    background: #18181b;
    color: var(--text-primary);
}

.nav-item.active {
    background: #27272a;
    color: var(--text-primary);
}

.nav-btn-icon {
    font-size: 1.1rem;
}

.exit-demo-btn {
    margin-top: auto;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    padding: 0.65rem 0.85rem;
}

.exit-demo-btn:hover {
    color: #ef4444;
}

/* Main Panel Layout */
.demo-main {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.demo-main-header {
    background: #09090b;
    border-bottom: 1px solid var(--card-border);
    padding: 1.25rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.panel-title {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

/* Header Search Engine */
.header-search-container {
    display: flex;
    align-items: center;
    background: #18181b;
    border: 1px solid var(--card-border);
    padding: 0.45rem 1rem;
    border-radius: 9999px;
    width: 100%;
    max-width: 380px;
}

.search-icon {
    margin-right: 0.5rem;
    font-size: 0.9rem;
}

.header-search-container input {
    background: none;
    border: none;
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 0.85rem;
    width: 100%;
}

.header-search-container input:focus {
    outline: none;
}

.header-search-container:focus-within {
    border-color: var(--accent-blue);
}

.panel-content {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
    background: #09090b;
}

.demo-tab-content {
    display: none;
    height: 100%;
}

.demo-tab-content.active {
    display: block;
}

/* ========================================================
   1. FEED STYLING
   ======================================================== */
.feed-layout {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 2rem;
    align-items: start;
}

.feed-main-col {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    max-width: 700px;
}

.create-post-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 1.25rem;
}

.post-input-row {
    display: flex;
    gap: 0.85rem;
    margin-bottom: 1rem;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
}

.create-post-card textarea {
    flex: 1;
    background: none;
    border: none;
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 0.95rem;
    resize: none;
    height: 60px;
}

.create-post-card textarea:focus {
    outline: none;
}

.post-actions-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--card-border);
    padding-top: 0.75rem;
}

.media-upload-options {
    display: flex;
    gap: 0.5rem;
}

.action-btn {
    background: none;
    border: 1px solid var(--card-border);
    color: var(--text-secondary);
    padding: 0.35rem 0.75rem;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}

.action-btn:hover {
    background: #27272a;
    color: var(--text-primary);
}

.btn-primary {
    background: #fafafa;
    color: #09090b;
    border: none;
    border-radius: 6px;
    padding: 0.45rem 1rem;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    transition: opacity 0.15s ease;
}

.btn-primary:hover {
    opacity: 0.9;
}

.media-preview-box {
    margin-top: 0.75rem;
}

.preview-item {
    position: relative;
    display: inline-block;
    border-radius: 8px;
    overflow: hidden;
}

.preview-thumbnail {
    max-width: 120px;
    max-height: 80px;
    object-fit: cover;
    border: 1px solid var(--card-border);
}

.file-preview {
    background: #18181b;
    border: 1px solid var(--card-border);
    padding: 0.5rem 0.85rem;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.8rem;
}

.remove-preview {
    position: absolute;
    top: 2px;
    right: 2px;
    background: rgba(0,0,0,0.7);
    color: white;
    border: none;
    border-radius: 50%;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.75rem;
}

.feed-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 1.5rem;
}

.post-header {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    margin-bottom: 1rem;
}

.post-meta {
    display: flex;
    flex-direction: column;
}

.post-author {
    font-weight: 700;
    font-size: 0.95rem;
}

.post-time {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.post-body p {
    font-size: 0.92rem;
    line-height: 1.5;
    color: var(--text-primary);
    margin-bottom: 1rem;
    white-space: pre-line;
}

.post-media-content {
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 1rem;
    border: 1px solid var(--card-border);
}

.post-image {
    width: 100%;
    height: auto;
    max-height: 350px;
    object-fit: cover;
}

.post-file-card {
    display: flex;
    align-items: center;
    background: #09090b;
    border: 1px solid var(--card-border);
    padding: 0.75rem 1rem;
    border-radius: 8px;
    gap: 0.85rem;
    margin-bottom: 1rem;
}

.file-icon {
    font-size: 1.5rem;
}

.file-details {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.file-name {
    font-weight: 700;
    font-size: 0.85rem;
}

.file-size {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.file-download-btn {
    background: none;
    border: 1px solid var(--text-secondary);
    color: var(--text-secondary);
    padding: 0.3rem 0.75rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.78rem;
    font-weight: 700;
    transition: all 0.15s ease;
}

.file-download-btn:hover {
    background: #fafafa;
    color: #09090b;
    border-color: #fafafa;
}

.post-footer {
    display: flex;
    gap: 1.25rem;
    border-top: 1px solid var(--card-border);
    padding-top: 0.75rem;
}

.post-action-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 700;
    transition: color 0.15s ease;
}

.post-action-btn:hover {
    color: var(--text-primary);
}

.post-action-btn.liked {
    color: #ef4444;
}

.feed-side-col {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.side-widget-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 1rem;
}

.widget-title {
    font-family: var(--font-display);
    font-size: 0.8rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.85rem;
    color: var(--text-muted);
}

.widget-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.widget-date {
    display: inline-block;
    background: #27272a;
    color: var(--text-primary);
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.1rem 0.35rem;
    border-radius: 4px;
    margin-bottom: 0.15rem;
}

.widget-desc {
    font-size: 0.78rem;
    color: var(--text-secondary);
    line-height: 1.35;
}

.birthday-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.bday-text {
    font-size: 0.78rem;
    color: var(--text-secondary);
}

/* ========================================================
   2. TREE STYLING
   ======================================================== */
.ancestry-layout {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 1.5rem;
    height: calc(100vh - 120px);
}

.ancestry-tree-panel, .ancestry-timeline-panel {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.panel-card-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--card-border);
}

.card-header-title {
    font-family: var(--font-display);
    font-size: 1.05rem;
    font-weight: 800;
    letter-spacing: -0.01em;
}

.card-header-subtitle {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.tree-viewport {
    flex: 1;
    overflow: auto;
    padding: 1.5rem 1rem;
    display: flex;
    justify-content: center;
}

.tree-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.75rem;
}

.tree-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
}

.node-card {
    background: #09090b;
    border: 1px solid var(--card-border);
    border-radius: 8px;
    padding: 0.45rem 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: border-color 0.15s ease;
    min-width: 160px;
}

.node-card img {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
}

.node-card.deceased {
    opacity: 0.5;
}

.node-name {
    font-size: 0.78rem;
    font-weight: 700;
}

.node-loc {
    font-size: 0.68rem;
    color: var(--text-muted);
}

.node-card:hover {
    border-color: #fafafa;
}

.node-connector-horizontal {
    width: 15px;
    height: 1px;
    background: var(--card-border);
}

.tree-vertical-line-gen {
    width: 1px;
    height: 30px;
    background: var(--card-border);
}

.node-connector-horizontal-gen {
    width: 30px;
    height: 1px;
    background: var(--card-border);
}

/* Drawer Detail Panel */
.member-detail-drawer {
    position: fixed;
    top: 0;
    right: -320px;
    width: 300px;
    height: 100vh;
    background: #09090b;
    border-left: 1px solid var(--card-border);
    padding: 2.5rem 1.5rem;
    z-index: 100;
    transition: right 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.member-detail-drawer.active {
    right: 0;
}

.drawer-title {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 800;
}

.drawer-relation {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 700;
    margin-bottom: 1.25rem;
}

.drawer-divider {
    border: none;
    border-top: 1px solid var(--card-border);
    margin-bottom: 1.25rem;
}

.drawer-meta {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.drawer-bio {
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.45;
    margin-top: 1rem;
}

/* Timeline Panel */
.timeline-scroll-container {
    flex: 1;
    overflow-y: auto;
    padding: 1.25rem;
    position: relative;
}

.timeline-line {
    position: absolute;
    left: 2rem;
    top: 1.25rem;
    bottom: 1.25rem;
    width: 1px;
    background: var(--card-border);
}

.timeline-item {
    display: flex;
    gap: 1.25rem;
    margin-bottom: 1.25rem;
}

.timeline-badge {
    width: 38px;
    height: 38px;
    background: #09090b;
    border: 1px solid var(--card-border);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.78rem;
    font-weight: 700;
    font-family: var(--font-display);
    color: var(--text-secondary);
    z-index: 2;
    flex-shrink: 0;
}

.timeline-item.active .timeline-badge {
    border-color: #fafafa;
    color: #fafafa;
}

.timeline-card {
    background: #09090b;
    border: 1px solid var(--card-border);
    padding: 0.85rem;
    border-radius: 8px;
    flex: 1;
}

.timeline-item-title {
    font-size: 0.88rem;
    font-weight: 700;
}

.timeline-item-desc {
    font-size: 0.78rem;
    color: var(--text-secondary);
    line-height: 1.35;
    margin-top: 0.15rem;
}

/* ========================================================
   3. EVENTS
   ======================================================= */
.events-layout {
    max-width: 750px;
}

.events-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
}

.sub-headline {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 800;
}

.add-event-form-card {
    display: none;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 1.25rem;
    margin-bottom: 1.5rem;
}

.add-event-form-card h4 {
    margin-bottom: 1rem;
    font-family: var(--font-display);
}

.form-group select, .form-group textarea {
    background: #09090b;
    border: 1px solid var(--card-border);
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 0.85rem;
    width: 100%;
}

.form-group select:focus, .form-group textarea:focus {
    outline: none;
    border-color: var(--accent-blue);
}

.form-group textarea {
    height: 60px;
    resize: none;
}

.events-list {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

/* ========================================================
   4. PEOPLE (DIRECTORY)
   ======================================================== */
.directory-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    padding: 0.75rem 1.25rem;
    border-radius: 12px;
}

.directory-subtitle {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.add-directory-form-card {
    display: none;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 1.25rem;
    margin-bottom: 1.25rem;
}

.add-directory-form-card h4 {
    margin-bottom: 1rem;
    font-family: var(--font-display);
}

.directory-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.25rem;
}

.directory-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.dir-avatar {
    width: 50px;
    height: 50px;
    border-radius: 8px;
    object-fit: cover;
}

.dir-name {
    font-size: 0.95rem;
    font-weight: 700;
}

.dir-title {
    font-size: 0.78rem;
    font-weight: 600;
}

.dir-company {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.dir-loc {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.dir-skills-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.skill-tag {
    background: #09090b;
    border: 1px solid var(--card-border);
    color: var(--text-secondary);
    font-size: 0.7rem;
    padding: 0.1rem 0.35rem;
    border-radius: 4px;
}

.dir-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--card-border);
    padding-top: 0.65rem;
    margin-top: auto;
}

.collaboration-status {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-muted);
}

.collaboration-status.open {
    color: var(--accent-green);
}

.btn-auth {
    background: none;
    border: 1px solid var(--card-border);
    color: var(--text-primary);
    border-radius: 6px;
    padding: 0.35rem 0.75rem;
    font-size: 0.78rem;
    cursor: pointer;
    font-weight: 600;
}

.btn-auth:hover {
    background: #27272a;
}

/* ========================================================
   5. MEDIA (STREAMS)
   ======================================================== */
.media-layout {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 1.25rem;
    height: calc(100vh - 120px);
}

.stream-main-card {
    height: 100%;
    overflow-y: auto;
    padding-right: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.stream-player-container {
    background: #000;
    border-radius: 12px;
    border: 1px solid var(--card-border);
    overflow: hidden;
    aspect-ratio: 16/9;
}

.stream-live-player {
    width: 100%;
    height: 100%;
    position: relative;
    background: #09090b;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.stream-paused {
    filter: brightness(0.5);
}

.live-tag {
    position: absolute;
    top: 12px;
    left: 12px;
    background: #ef4444;
    color: white;
    font-size: 0.68rem;
    font-weight: 800;
    padding: 0.15rem 0.45rem;
    border-radius: 3px;
}

.viewer-count {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(0,0,0,0.6);
    color: white;
    font-size: 0.68rem;
    font-weight: 600;
    padding: 0.15rem 0.4rem;
    border-radius: 3px;
}

.stream-placeholder-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    text-align: center;
}

.broadcast-icon {
    font-size: 2rem;
}

.broadcast-title {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 800;
}

.broadcast-subtitle {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.player-controls {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0,0,0,0.7);
    padding: 0.65rem;
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.player-btn {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 0.78rem;
}

.progress-bar {
    flex: 1;
    height: 3px;
    background: rgba(255,255,255,0.2);
    border-radius: 2px;
}

.progress-fill {
    width: 65%;
    height: 100%;
    background: #fafafa;
}

.time-elapsed {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.archives-headline {
    font-family: var(--font-display);
    font-size: 0.95rem;
    font-weight: 800;
    margin-bottom: 0.85rem;
}

.archives-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.archive-video-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
}

.archive-video-title {
    font-size: 0.8rem;
    font-weight: 700;
    padding: 0.5rem 0.5rem 0.15rem 0.5rem;
}

.archive-video-meta {
    font-size: 0.7rem;
    color: var(--text-muted);
    padding: 0 0.5rem 0.5rem 0.5rem;
}

.stream-chat-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.chat-header-title {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--card-border);
    font-family: var(--font-display);
    font-size: 0.85rem;
    font-weight: 800;
}

.stream-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    background: #09090b;
}

.stream-chat-row {
    font-size: 0.78rem;
    line-height: 1.35;
}

.stream-chat-user {
    font-weight: 700;
}

.stream-chat-text {
    color: var(--text-secondary);
}

.chat-user-msg {
    border-left: 2px solid var(--text-muted);
    padding-left: 0.35rem;
}

.stream-chat-input-row {
    padding: 0.75rem;
    border-top: 1px solid var(--card-border);
    display: flex;
    gap: 0.4rem;
}

.stream-chat-input-row input {
    flex: 1;
    background: #09090b;
    border: 1px solid var(--card-border);
    padding: 0.35rem 0.75rem;
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 0.78rem;
}

/* ========================================================
   6. CALLS STYLING
   ======================================================== */
.call-choice-screen {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 2.5rem;
    text-align: center;
    max-width: 600px;
    margin: 4rem auto;
}

.call-choice-screen h3 {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 800;
}

.call-choice-screen p {
    color: var(--text-secondary);
    font-size: 0.88rem;
    margin-bottom: 2rem;
    margin-top: 0.25rem;
}

.call-options-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.call-option-card {
    background: #09090b;
    border: 1px solid var(--card-border);
    padding: 1.5rem;
    border-radius: 10px;
    cursor: pointer;
    transition: border-color 0.15s ease;
}

.call-option-card:hover {
    border-color: #fafafa;
}

.call-option-icon {
    font-size: 2rem;
}

.call-option-card h4 {
    margin-top: 0.5rem;
    font-weight: 700;
}

.call-option-card p {
    font-size: 0.78rem;
    margin-bottom: 0;
    margin-top: 0.5rem;
}

.video-grid-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    height: 100%;
}

.video-card-call {
    background: #18181b;
    border: 1px solid var(--card-border);
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 4/3;
}

.camera-stream {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scaleX(-1);
}

.caller-still {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.caller-label {
    position: absolute;
    bottom: 8px;
    left: 8px;
    background: rgba(0,0,0,0.7);
    color: white;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.72rem;
    font-weight: 600;
}

.audio-pulse {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 6px;
    height: 6px;
    background: var(--accent-green);
    border-radius: 50%;
}

.call-controls {
    display: flex;
    justify-content: center;
    gap: 0.85rem;
    padding: 0.75rem 0;
}

.call-btn-ctrl {
    background: #18181b;
    border: 1px solid var(--card-border);
    color: var(--text-primary);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-weight: 700;
    font-size: 0.8rem;
    cursor: pointer;
}

.call-btn-ctrl.active {
    background: #fafafa;
    color: #09090b;
    border-color: #fafafa;
}

.call-btn-ctrl.hangup {
    background: #ef4444;
    border: none;
    color: white;
}

/* ========================================================
   7. CHAT STYLING
   ======================================================== */
.chat-viewport {
    display: grid;
    grid-template-columns: 240px 1fr;
    border: 1px solid var(--card-border);
    background: var(--card-bg);
    border-radius: 12px;
    height: calc(100vh - 140px);
    overflow: hidden;
}

.chat-rooms-list {
    border-right: 1px solid var(--card-border);
    background: #09090b;
    display: flex;
    flex-direction: column;
    padding: 0.5rem;
    gap: 0.25rem;
}

.room-item {
    background: none;
    border: none;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem;
    border-radius: 6px;
    cursor: pointer;
    width: 100%;
}

.room-item:hover {
    background: #18181b;
}

.room-item.active {
    background: #27272a;
}

.room-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #27272a;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
}

.room-user-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
}

.room-name {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-primary);
}

.room-preview {
    font-size: 0.68rem;
    color: var(--text-muted);
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
    width: 140px;
}

.chat-conversation {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: #09090b;
}

.chat-messages-container {
    flex: 1;
    overflow-y: auto;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.chat-message-row {
    display: flex;
    gap: 0.65rem;
    max-width: 80%;
}

.message-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    margin-top: 0.15rem;
}

.msg-them {
    align-self: flex-start;
}

.msg-you {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.message-bubble-wrapper {
    display: flex;
    flex-direction: column;
}

.msg-sender-name {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-bottom: 0.1;
    font-weight: 700;
}

.message-bubble {
    background: #18181b;
    border: 1px solid var(--card-border);
    padding: 0.5rem 0.75rem;
    border-radius: 10px;
    font-size: 0.88rem;
    color: var(--text-primary);
    line-height: 1.4;
}

.msg-you .message-bubble {
    background: #fafafa;
    border: none;
    color: #09090b;
}

.msg-time {
    font-size: 0.62rem;
    color: var(--text-muted);
    margin-top: 0.15rem;
    align-self: flex-end;
}

.msg-you .msg-time {
    align-self: flex-start;
}

.chat-input-container {
    padding: 0.85rem 1.25rem;
    border-top: 1px solid var(--card-border);
    display: flex;
    gap: 0.5rem;
    background: #09090b;
}

.chat-input-container input {
    flex: 1;
    background: #18181b;
    border: 1px solid var(--card-border);
    padding: 0.5rem 0.85rem;
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 0.88rem;
}

.chat-input-container input:focus {
    outline: none;
    border-color: #fafafa;
}

/* ========================================================
   8. FILES STYLING
   ======================================================== */
.files-layout {
    display: grid;
    grid-template-columns: 200px 1fr 240px;
    gap: 1.25rem;
    align-items: start;
    height: calc(100vh - 120px);
}

.vault-navigation {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.storage-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 10px;
    padding: 0.85rem;
}

.storage-card h4 {
    font-size: 0.78rem;
    margin-bottom: 0.35rem;
}

.storage-bar {
    height: 4px;
    background: #27272a;
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 0.35rem;
}

.storage-fill {
    height: 100%;
    background: #fafafa;
}

.storage-label {
    font-size: 0.68rem;
    color: var(--text-muted);
}

.folder-list {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.folder-item {
    background: none;
    border: none;
    text-align: left;
    color: var(--text-secondary);
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.folder-item.active {
    background: #27272a;
    color: var(--text-primary);
}

.vault-explorer {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.vault-header-bar {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--card-border);
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
}

.vault-search-input {
    flex: 1;
    background: #09090b;
    border: 1px solid var(--card-border);
    padding: 0.35rem 0.75rem;
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 0.78rem;
}

.vault-search-input:focus {
    outline: none;
    border-color: #fafafa;
}

.vault-files-grid {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 0.85rem;
    align-content: start;
}

.file-grid-item {
    background: #09090b;
    border: 1px solid var(--card-border);
    border-radius: 8px;
    padding: 0.85rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    text-align: center;
    cursor: pointer;
}

.file-grid-item:hover {
    border-color: #fafafa;
}

.file-thumbnail-icon {
    font-size: 1.75rem;
}

.file-grid-name {
    font-size: 0.78rem;
    font-weight: 700;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
    width: 100%;
}

.file-grid-details {
    font-size: 0.68rem;
    color: var(--text-muted);
}

.vault-detail-panel {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 1.25rem;
    height: 100%;
    display: flex;
    flex-direction: column;
    opacity: 0.35;
    pointer-events: none;
}

.vault-detail-panel.active {
    opacity: 1;
    pointer-events: all;
}

.vault-detail-title {
    font-family: var(--font-display);
    font-size: 0.95rem;
    font-weight: 800;
}

.vault-detail-rows {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 0.85rem;
}

.vault-detail-row {
    font-size: 0.78rem;
    color: var(--text-secondary);
}

/* Form layouts */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.85rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.form-group label {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.form-group input {
    background: #09090b;
    border: 1px solid var(--card-border);
    padding: 0.45rem 0.75rem;
    border-radius: 6px;
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 0.85rem;
    width: 100%;
}

.form-group input:focus {
    outline: none;
    border-color: #fafafa;
}

/* ========================================================
   RESPONSIVE DESIGN OVERRIDES
   ======================================================== */
@media (max-width: 1100px) {
    .demo-wrapper {
        grid-template-columns: 70px 1fr;
    }
    .user-profile-badge, .sidebar-header .logo-text, .nav-item span:not(.badge-count), .exit-demo-btn span {
        display: none;
    }
    .demo-sidebar {
        padding: 1.5rem 0.25rem;
        align-items: center;
    }
    .nav-item {
        justify-content: center;
        padding: 0.65rem;
    }
    .exit-demo-btn {
        justify-content: center;
    }
    .files-layout {
        grid-template-columns: 150px 1fr;
    }
    .vault-detail-panel {
        display: none;
    }
    .media-layout {
        grid-template-columns: 1fr;
    }
    .stream-chat-card {
        height: 300px;
    }
}

@media (max-width: 768px) {
    .feed-layout {
        grid-template-columns: 1fr;
    }
    .feed-side-col {
        display: none;
    }
    .ancestry-layout {
        grid-template-columns: 1fr;
    }
    .files-layout {
        grid-template-columns: 1fr;
    }
    .vault-navigation {
        display: none;
    }
    .video-grid-container {
        grid-template-columns: 1fr;
    }
    .call-options-grid {
        grid-template-columns: 1fr;
    }
}

/* Mini Messenger Styling */
.mini-messenger {
    position: fixed;
    bottom: 0;
    right: 2rem;
    width: 320px;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-bottom: none;
    border-radius: 12px 12px 0 0;
    z-index: 9999;
    font-family: var(--font-sans);
    box-shadow: 0 -5px 25px rgba(0, 0, 0, 0.6);
    transition: height 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    height: 40px; /* Collapsed */
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.mini-messenger.open {
    height: 400px;
}

.mini-messenger-header {
    height: 40px;
    background: #18181b;
    border-bottom: 1px solid var(--card-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 1rem;
    cursor: pointer;
    user-select: none;
}

.mini-messenger-title {
    font-size: 0.85rem;
    font-weight: 700;
}

.mini-messenger-toggle {
    font-size: 1rem;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
}

.mini-messenger-body {
    flex: 1;
    overflow-y: auto;
    padding: 0.85rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    background: #09090b;
}

.mini-messenger-input-row {
    padding: 0.5rem 0.75rem;
    border-top: 1px solid var(--card-border);
    display: flex;
    gap: 0.4rem;
    background: #18181b;
}

.mini-messenger-input-row input {
    flex: 1;
    background: #09090b;
    border: 1px solid var(--card-border);
    padding: 0.35rem 0.65rem;
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 0.78rem;
}
