/* TX.WTF Custom Styles */

/* ==================== Theme Variables ==================== */
:root {
    /* Primary/Accent colors */
    --theme-primary: #00d1b2;
    --theme-primary-dark: #00947e;
    --theme-primary-light: #00ffdc;
    
    /* Secondary/Accent colors */
    --theme-secondary: #3273dc;
    --theme-secondary-dark: #2366d1;
    --theme-secondary-light: #5a95f5;
    
    /* Background colors */
    --theme-bg-primary: #1a1a2e;
    --theme-bg-secondary: #16213e;
    --theme-bg-tertiary: #0f3460;
    
    /* Surface colors (boxes, cards, modals) */
    --theme-surface: #2d2d44;
    --theme-surface-light: #3d3d5c;
    --theme-surface-dark: #1d1d2e;
    
    /* Text colors */
    --theme-text-primary: #ffffff;
    --theme-text-secondary: #b5b5c3;
    --theme-text-muted: #7a7a8c;
    
    /* Button colors */
    --theme-btn-primary-bg: var(--theme-primary);
    --theme-btn-primary-text: #ffffff;
    --theme-btn-secondary-bg: var(--theme-secondary);
    --theme-btn-secondary-text: #ffffff;
    
    /* Success/Danger/Warning/Info */
    --theme-success: #48c774;
    --theme-danger: #f14668;
    --theme-warning: #ffdd57;
    --theme-info: #3298dc;
    
    /* Border colors */
    --theme-border: rgba(255, 255, 255, 0.1);
    --theme-border-light: rgba(255, 255, 255, 0.2);
    
    /* Shadow */
    --theme-shadow: rgba(0, 0, 0, 0.3);
    
    /* Input fields */
    --theme-input-bg: #363652;
    --theme-input-border: rgba(255, 255, 255, 0.2);
    --theme-input-text: #ffffff;
    
    /* Legacy variables for compatibility */
    --primary-color: var(--theme-primary);
    --dark-bg: var(--theme-bg-primary);
    --darker-bg: var(--theme-bg-secondary);
}

/* ==================== Background Container ==================== */
#background-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

/* Theme background (default) */
#background-container.theme-active {
    background: linear-gradient(135deg, var(--theme-bg-primary) 0%, var(--theme-bg-secondary) 100%);
}

/* WebGL background */
#background-container.webgl-active {
    background: transparent;
    pointer-events: auto; /* Allow orbit controls interaction */
}

#background-container.webgl-active canvas {
    display: block;
    width: 100%;
    height: 100%;
}

/* Attachment background */
#background-container.attachment-active {
    background-color: var(--theme-bg-primary);
}

/* Video background element */
#background-container .background-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Ensure content is readable over any background */
body.has-webgl-background #app-container,
body.has-attachment-background #app-container {
    position: relative;
    z-index: 1;
}

/* Semi-transparent overlay for content boxes when using dynamic backgrounds */
body.has-dynamic-background .box {
    background-color: rgba(45, 45, 68, 0.85) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

body.has-dynamic-background .navbar.is-dark {
    background-color: rgba(22, 33, 62, 0.9) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* ==================== Theme Application ==================== */
html {
    overflow-x: hidden;
    overflow-y: scroll; /* Always show vertical scrollbar to prevent layout shift */
}

body {
    min-height: 100vh;
    background: transparent; /* Background handled by #background-container */
    color: var(--theme-text-primary);
    overflow-x: hidden;
}

/* Prevent nested scrollbars in layout elements */
.section,
.container,
.columns,
.column {
    overflow-x: hidden;
    overflow-y: visible;
}

/* Navbar theming */
.navbar.is-dark {
    background-color: var(--theme-bg-secondary) !important;
}

/* Box theming - use !important to override Bulma */
.box {
    background-color: var(--theme-surface) !important;
    color: var(--theme-text-primary) !important;
    overflow-x: hidden;
    overflow-y: visible;
}

.box.has-background-dark {
    background-color: var(--theme-surface-dark) !important;
    color: var(--theme-text-primary) !important;
}

.box.has-background-light {
    background-color: var(--theme-surface-light) !important;
    color: var(--theme-text-primary) !important;
}

/* Button theming */
.button.is-primary {
    background-color: var(--theme-primary) !important;
    border-color: var(--theme-primary) !important;
    color: var(--theme-btn-primary-text) !important;
}

.button.is-primary:hover {
    background-color: var(--theme-primary-dark) !important;
    border-color: var(--theme-primary-dark) !important;
}

.button.is-link {
    background-color: var(--theme-secondary) !important;
    border-color: var(--theme-secondary) !important;
}

.button.is-link:hover {
    background-color: var(--theme-secondary-dark) !important;
}

.button.is-info {
    background-color: var(--theme-info) !important;
    border-color: var(--theme-info) !important;
}

.button.is-success {
    background-color: var(--theme-success) !important;
    border-color: var(--theme-success) !important;
}

.button.is-danger {
    background-color: var(--theme-danger) !important;
    border-color: var(--theme-danger) !important;
}

.button.is-warning {
    background-color: var(--theme-warning) !important;
    border-color: var(--theme-warning) !important;
}

/* Input theming */
.input, .textarea, .select select {
    background-color: var(--theme-input-bg);
    border-color: var(--theme-input-border);
    color: var(--theme-input-text);
}

.input:focus, .textarea:focus, .select select:focus {
    border-color: var(--theme-primary);
    box-shadow: 0 0 0 0.125em rgba(var(--theme-primary), 0.25);
}

.input::placeholder, .textarea::placeholder {
    color: var(--theme-text-muted);
}

/* Table theming */
.table {
    background-color: var(--theme-surface) !important;
    color: var(--theme-text-primary) !important;
}

.table th {
    color: var(--theme-text-primary) !important;
    border-color: var(--theme-border) !important;
    background-color: var(--theme-surface-dark) !important;
}

.table td {
    color: var(--theme-text-primary) !important;
    border-color: var(--theme-border) !important;
}

.table thead {
    background-color: var(--theme-surface-dark) !important;
}

.table thead th {
    color: var(--theme-text-primary) !important;
}

.table.is-striped tbody tr:not(.is-selected):nth-child(even) {
    background-color: var(--theme-surface-dark) !important;
}

.table.is-striped tbody tr:not(.is-selected):nth-child(even) td {
    color: var(--theme-text-primary) !important;
}

.table.is-hoverable tbody tr:not(.is-selected):hover {
    background-color: var(--theme-surface-light) !important;
}

.table.is-hoverable tbody tr:not(.is-selected):hover td {
    color: var(--theme-text-primary) !important;
}

/* Tabs theming */
.tabs.is-boxed li.is-active a {
    background-color: var(--theme-surface);
    border-color: var(--theme-border);
    border-bottom-color: transparent !important;
    color: var(--theme-primary);
}

.tabs.is-boxed a {
    border-color: var(--theme-border);
    color: var(--theme-text-secondary);
}

.tabs.is-boxed a:hover {
    background-color: var(--theme-surface-light);
    border-bottom-color: var(--theme-border);
}

/* Panel theming */
.panel-block {
    border-color: var(--theme-border);
    color: var(--theme-text-primary);
}

.panel-block:hover {
    background-color: var(--theme-surface-light) !important;
}

/* Notification theming */
.notification.is-info.is-light {
    background-color: rgba(50, 152, 220, 0.15);
    color: var(--theme-info);
}

.notification.is-warning.is-light {
    background-color: rgba(255, 221, 87, 0.15);
    color: #947600;
}

/* Label theming */
.label {
    color: var(--theme-text-primary);
}

.label.has-text-white {
    color: var(--theme-text-primary) !important;
}

/* Title/subtitle theming */
.title {
    color: var(--theme-text-primary) !important;
}

.title.has-text-light {
    color: var(--theme-text-primary) !important;
}

.subtitle {
    color: var(--theme-text-secondary) !important;
}

.subtitle.has-text-grey {
    color: var(--theme-text-secondary) !important;
}

/* Help text theming */
.help {
    color: var(--theme-text-muted);
}

.help.has-text-grey-light {
    color: var(--theme-text-muted) !important;
}

/* Modal theming */
.modal-card-head, .modal-card-foot {
    background-color: var(--theme-surface-dark);
    border-color: var(--theme-border);
}

.modal-card-title {
    color: var(--theme-text-primary);
}

.modal-card-body {
    background-color: var(--theme-surface);
    color: var(--theme-text-primary);
}

/* Tag theming */
.tag.is-dark {
    background-color: var(--theme-surface-dark);
    color: var(--theme-text-primary);
}

.tag.is-light {
    background-color: var(--theme-surface-light);
    color: var(--theme-text-primary);
}

.tag.is-info {
    background-color: var(--theme-secondary);
    color: #fff;
}

.tag.is-primary {
    background-color: var(--theme-primary);
    color: #fff;
}

/* Currency tags in exchange log */
.tag.currency-tag {
    background-color: var(--theme-surface);
    color: var(--theme-primary);
    border: 1px solid var(--theme-primary);
    font-weight: 600;
}

/* Progress bar theming */
.progress.is-primary::-webkit-progress-value {
    background-color: var(--theme-primary);
}

.progress.is-primary::-moz-progress-bar {
    background-color: var(--theme-primary);
}

/* Pagination theming */
.pagination-link.is-current {
    background-color: var(--theme-primary);
    border-color: var(--theme-primary);
}

/* Breadcrumb theming */
.breadcrumb a {
    color: var(--theme-secondary);
}

/* Text color utilities with theme support */
.has-text-primary {
    color: var(--theme-primary) !important;
}

/* ==================== End Theme Variables ==================== */

/* Hide all screens by default */
.screen.is-hidden {
    display: none !important;
}

/* Screens should not create nested scrollbars - let the body handle scrolling */
.screen:not(.is-hidden) {
    overflow-x: hidden;
    overflow-y: visible;
}

/* Login Screen */
#screen-login {
    min-height: 100vh;
    display: flex;
    align-items: center;
}

#screen-login .box {
    border-radius: 8px;
    box-shadow: 0 10px 40px var(--theme-shadow);
}

/* Title styling */
.title.is-1 {
    font-size: 3.5rem;
    letter-spacing: 2px;
    font-weight: 800;
}

/* Navbar */
.navbar.is-dark {
    background-color: var(--darker-bg);
}

/* Menu buttons - themed with gradient pattern */
.menu-buttons .button {
    justify-content: flex-start;
    padding-left: 1.5rem;
    transition: all 0.2s ease;
}

.menu-buttons .button .icon {
    margin-right: 0.5rem;
}

/* Menu button styling - row 1 (primary accent) */
.menu-buttons .button.is-menu-1 {
    background-color: var(--theme-primary) !important;
    border-color: var(--theme-primary) !important;
    color: var(--theme-surface-dark) !important;
}

.menu-buttons .button.is-menu-1:hover {
    background-color: var(--theme-primary-dark) !important;
    border-color: var(--theme-primary-dark) !important;
    transform: translateX(3px);
}

/* Menu button styling - row 2 (primary light) */
.menu-buttons .button.is-menu-2 {
    background-color: color-mix(in srgb, var(--theme-primary) 60%, var(--theme-surface-light)) !important;
    border-color: color-mix(in srgb, var(--theme-primary) 60%, var(--theme-surface-light)) !important;
    color: var(--theme-text-primary) !important;
}

.menu-buttons .button.is-menu-2:hover {
    background-color: var(--theme-primary) !important;
    border-color: var(--theme-primary) !important;
    transform: translateX(3px);
}

/* Menu button styling - row 3 (blend) */
.menu-buttons .button.is-menu-3 {
    background-color: color-mix(in srgb, var(--theme-primary) 30%, var(--theme-surface-light)) !important;
    border-color: color-mix(in srgb, var(--theme-primary) 30%, var(--theme-surface-light)) !important;
    color: var(--theme-text-primary) !important;
}

.menu-buttons .button.is-menu-3:hover {
    background-color: color-mix(in srgb, var(--theme-primary) 50%, var(--theme-surface-light)) !important;
    border-color: color-mix(in srgb, var(--theme-primary) 50%, var(--theme-surface-light)) !important;
    transform: translateX(3px);
}

/* Menu button styling - row 4 (surface) */
.menu-buttons .button.is-menu-4 {
    background-color: var(--theme-surface-light) !important;
    border-color: var(--theme-surface-light) !important;
    color: var(--theme-text-primary) !important;
}

.menu-buttons .button.is-menu-4:hover {
    background-color: color-mix(in srgb, var(--theme-secondary) 30%, var(--theme-surface-light)) !important;
    border-color: color-mix(in srgb, var(--theme-secondary) 30%, var(--theme-surface-light)) !important;
    transform: translateX(3px);
}

/* Menu button styling - row 5 (secondary blend) */
.menu-buttons .button.is-menu-5 {
    background-color: color-mix(in srgb, var(--theme-secondary) 30%, var(--theme-surface-light)) !important;
    border-color: color-mix(in srgb, var(--theme-secondary) 30%, var(--theme-surface-light)) !important;
    color: var(--theme-text-primary) !important;
}

.menu-buttons .button.is-menu-5:hover {
    background-color: color-mix(in srgb, var(--theme-secondary) 50%, var(--theme-surface-light)) !important;
    border-color: color-mix(in srgb, var(--theme-secondary) 50%, var(--theme-surface-light)) !important;
    transform: translateX(3px);
}

/* Menu button styling - row 6 (secondary light) */
.menu-buttons .button.is-menu-6 {
    background-color: color-mix(in srgb, var(--theme-secondary) 60%, var(--theme-surface-light)) !important;
    border-color: color-mix(in srgb, var(--theme-secondary) 60%, var(--theme-surface-light)) !important;
    color: var(--theme-text-primary) !important;
}

.menu-buttons .button.is-menu-6:hover {
    background-color: var(--theme-secondary) !important;
    border-color: var(--theme-secondary) !important;
    transform: translateX(3px);
}

/* Menu button styling - row 7 (secondary accent) */
.menu-buttons .button.is-menu-7 {
    background-color: var(--theme-secondary) !important;
    border-color: var(--theme-secondary) !important;
    color: #ffffff !important;
}

.menu-buttons .button.is-menu-7:hover {
    background-color: var(--theme-secondary-dark) !important;
    border-color: var(--theme-secondary-dark) !important;
    transform: translateX(3px);
}

/* Legacy menu button classes for compatibility */
.menu-buttons .button.is-menu-primary {
    background-color: var(--theme-primary) !important;
    border-color: var(--theme-primary) !important;
    color: var(--theme-surface-dark) !important;
}

.menu-buttons .button.is-menu-primary:hover {
    background-color: var(--theme-primary-dark) !important;
    border-color: var(--theme-primary-dark) !important;
}

.menu-buttons .button.is-menu-secondary {
    background-color: var(--theme-secondary) !important;
    border-color: var(--theme-secondary) !important;
    color: #ffffff !important;
}

.menu-buttons .button.is-menu-secondary:hover {
    background-color: var(--theme-secondary-dark) !important;
    border-color: var(--theme-secondary-dark) !important;
}

.menu-buttons .button.is-menu-neutral {
    background-color: var(--theme-surface-light) !important;
    border-color: var(--theme-surface-light) !important;
    color: var(--theme-text-primary) !important;
}

.menu-buttons .button.is-menu-neutral:hover {
    background-color: var(--theme-surface) !important;
    border-color: var(--theme-surface) !important;
}

/* Menu Grid View */
.menu-grid {
    display: grid;
    grid-template-columns: repeat(var(--menu-grid-columns, 4), 1fr);
    gap: 0.75rem;
}

.menu-grid-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1rem 0.5rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    min-height: 80px;
    border: none !important;
}

.menu-grid-item .icon {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.menu-grid-item .label {
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1.2;
    word-wrap: break-word;
    max-width: 100%;
}

.menu-grid-item.no-label .label {
    display: none;
}

.menu-grid-item.no-label {
    min-height: 60px;
}

.menu-grid-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    filter: brightness(1.1);
}

/* Grid item menu color classes - match list button styles exactly */
/* Row 1 (primary accent) */
.menu-grid-item.is-menu-1 {
    background-color: var(--theme-primary) !important;
    color: var(--theme-surface-dark) !important;
}

/* Row 2 (primary light) */
.menu-grid-item.is-menu-2 {
    background-color: color-mix(in srgb, var(--theme-primary) 60%, var(--theme-surface-light)) !important;
    color: var(--theme-text-primary) !important;
}

/* Row 3 (blend) */
.menu-grid-item.is-menu-3 {
    background-color: color-mix(in srgb, var(--theme-primary) 30%, var(--theme-surface-light)) !important;
    color: var(--theme-text-primary) !important;
}

/* Row 4 (surface) */
.menu-grid-item.is-menu-4 {
    background-color: var(--theme-surface-light) !important;
    color: var(--theme-text-primary) !important;
}

/* Row 5 (secondary blend) */
.menu-grid-item.is-menu-5 {
    background-color: color-mix(in srgb, var(--theme-secondary) 30%, var(--theme-surface-light)) !important;
    color: var(--theme-text-primary) !important;
}

/* Row 6 (secondary light) */
.menu-grid-item.is-menu-6 {
    background-color: color-mix(in srgb, var(--theme-secondary) 60%, var(--theme-surface-light)) !important;
    color: var(--theme-text-primary) !important;
}

/* Row 7 (secondary accent) */
.menu-grid-item.is-menu-7 {
    background-color: var(--theme-secondary) !important;
    color: #ffffff !important;
}

/* Legacy/neutral styles */
.menu-grid-item.is-menu-primary {
    background-color: var(--theme-primary) !important;
    color: var(--theme-surface-dark) !important;
}

.menu-grid-item.is-menu-secondary {
    background-color: var(--theme-secondary) !important;
    color: #ffffff !important;
}

.menu-grid-item.is-menu-neutral {
    background-color: var(--theme-surface-light) !important;
    color: var(--theme-text-primary) !important;
}

/* User Status Indicators */
.user-status-indicator {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 4px;
    vertical-align: middle;
}

.user-status-indicator.status-online {
    background-color: #23d160;
    box-shadow: 0 0 4px rgba(35, 209, 96, 0.5);
}

.user-status-indicator.status-offline {
    background-color: #6c757d;
}

.user-status-indicator.status-away {
    background-color: #ffdd57;
    box-shadow: 0 0 4px rgba(255, 221, 87, 0.5);
}

.user-status-indicator.status-busy {
    background-color: #ff3860;
    box-shadow: 0 0 4px rgba(255, 56, 96, 0.5);
}

.user-status-indicator.status-dnd {
    background-color: #ff3860;
    box-shadow: 0 0 4px rgba(255, 56, 96, 0.5);
}

/* Small status for compact layouts */
.user-status-indicator.is-small {
    width: 8px;
    height: 8px;
}

/* User Badges/Emblems */
.user-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    font-size: 0.6rem;
    margin-left: 4px;
    vertical-align: middle;
}

.user-badge.is-small {
    width: 14px;
    height: 14px;
    font-size: 0.5rem;
}

/* Admin Crown Badge */
.user-badge.badge-admin {
    background: linear-gradient(135deg, #ffd700, #ffb700);
    color: #7a5000;
    box-shadow: 0 1px 3px rgba(255, 183, 0, 0.4);
}

/* Custom Emblems */
.user-badge.badge-emblem {
    background-color: var(--theme-primary);
    color: white;
}

.user-badge.badge-verified {
    background: linear-gradient(135deg, #3273dc, #209cee);
    color: white;
}

.user-badge.badge-vip {
    background: linear-gradient(135deg, #9b59b6, #8e44ad);
    color: white;
}

.user-badge.badge-founder {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
}

.user-badge.badge-contributor {
    background: linear-gradient(135deg, #27ae60, #2ecc71);
    color: white;
}

.user-badge.badge-moderator {
    background: linear-gradient(135deg, #2980b9, #3498db);
    color: white;
}

/* User display with status and badges */
.user-display {
    display: inline-flex;
    align-items: center;
}

.user-display .username {
    font-weight: 500;
}

.user-display .user-badges {
    display: inline-flex;
    align-items: center;
    margin-left: 4px;
}

/* Tables */
.table-container {
    overflow-x: auto;
}

.table th {
    white-space: nowrap;
}

/* Panel items */
.panel-block {
    cursor: pointer;
}

.panel-block:hover {
    background-color: #f5f5f5;
}

/* Notifications */
.notification-container {
    position: fixed;
    top: 60px;
    right: 20px;
    z-index: 1000;
    max-width: 400px;
}

.notification-container .notification {
    margin-bottom: 10px;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

.notification.is-removing {
    animation: slideOut 0.3s ease-in forwards;
}

/* Balance cards */
.balance-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

.balance-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 8px;
    padding: 1rem;
    color: white;
    overflow: hidden;
}

.balance-card .currency {
    font-size: 0.9rem;
    opacity: 0.9;
}

.balance-card .amount {
    font-size: 1.25rem;
    font-weight: bold;
    word-break: break-all;
}

/* Status tags */
.tag.is-active {
    background-color: #48c774;
    color: white;
}

.tag.is-inactive {
    background-color: #f14668;
    color: white;
}

/* Order status */
.order-status-active {
    color: #48c774;
}

.order-status-cancelled {
    color: #f14668;
}

.order-status-filled {
    color: #3298dc;
}

/* Permission tags */
.permission-tag {
    margin: 2px;
}

/* Loading spinner */
.loading-spinner {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
}

/* Transaction type badges */
.transaction-credit {
    color: #48c774;
    font-weight: bold;
}

.transaction-debit {
    color: #f14668;
    font-weight: bold;
}

/* Responsive adjustments */
@media screen and (max-width: 768px) {
    .title.is-1 {
        font-size: 2.5rem;
    }
    
    .table td, .table th {
        font-size: 0.85rem;
    }
    
    .notification-container {
        left: 10px;
        right: 10px;
        max-width: none;
    }
    
    /* Mobile menu grid - adjust columns based on screen size */
    .menu-grid {
        grid-template-columns: repeat(min(var(--menu-grid-columns, 4), 3), 1fr);
        gap: 0.5rem;
    }
    
    .menu-grid-item {
        padding: 0.75rem 0.25rem;
        min-height: 70px;
    }
    
    .menu-grid-item .icon {
        font-size: 1.25rem;
        margin-bottom: 0.25rem;
    }
    
    .menu-grid-item .label {
        font-size: 0.65rem;
    }
    
    /* Posts fill screen width on mobile */
    .section {
        padding: 1rem 0.5rem;
    }
    
    /* Post boxes on mobile - full width with minimal margin */
    .post-box,
    .box {
        border-radius: 0;
        margin-left: -0.5rem;
        margin-right: -0.5rem;
        width: calc(100% + 1rem);
    }
    
    /* Post feed container */
    #feed-container .box,
    #post-detail-container .box {
        border-radius: 0;
        margin-left: -0.5rem;
        margin-right: -0.5rem;
        width: calc(100% + 1rem);
    }
    
    /* Reduce padding in post content on mobile */
    .media-content {
        overflow-x: hidden;
    }
    
    .post-content {
        font-size: 0.95rem;
    }
    
    /* Modal adjustments for mobile */
    .modal-card {
        max-width: 95%;
        margin: 0 auto;
    }
}

/* Even smaller screens */
@media screen and (max-width: 480px) {
    /* Force 2 columns on very small screens */
    .menu-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .menu-grid-item {
        padding: 0.5rem 0.25rem;
        min-height: 60px;
    }
    
    .menu-grid-item .icon {
        font-size: 1.1rem;
    }
    
    .menu-grid-item .label {
        font-size: 0.6rem;
    }
    
    /* Tighter sections on very small screens */
    .section {
        padding: 0.75rem 0.25rem;
    }
    
    .box {
        padding: 0.75rem;
    }
}

/* Dark mode boxes when logged in */
.section:not(#screen-login) .box {
    background-color: white;
}

/* Modal styling */
.modal-card {
    max-width: 500px;
    margin: 0 auto;
}

/* Form improvements */
.field.has-addons .control.is-expanded {
    flex-grow: 1;
}

/* Session table improvements */
#auth-sessions-table-body td {
    vertical-align: middle;
}

#auth-sessions-table-body .uuid-cell {
    font-family: monospace;
    font-size: 0.8rem;
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* User agent cell */
.user-agent-cell {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Panel icon */
.panel-icon-right {
    float: right;
}

/* Group user item */
.group-user-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.group-user-item .user-info {
    flex-grow: 1;
}

/* Hover effects for clickable rows */
.table tbody tr.is-clickable:hover {
    background-color: #f5f5f5;
    cursor: pointer;
}

/* Autocomplete dropdown styles */
.autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 100;
    background: white;
    border: 1px solid #dbdbdb;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    max-height: 250px;
    overflow-y: auto;
}

.autocomplete-item {
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    border-bottom: 1px solid #f5f5f5;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.autocomplete-item:last-child {
    border-bottom: none;
}

.autocomplete-item:hover,
.autocomplete-item.is-active {
    background-color: #f0f0f0;
}

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

.autocomplete-item .user-info {
    flex: 1;
}

.autocomplete-item .user-username {
    font-weight: 600;
    color: #363636;
}

.autocomplete-item .user-details {
    font-size: 0.8rem;
    color: #7a7a7a;
}

.autocomplete-empty {
    padding: 0.75rem;
    color: #7a7a7a;
    text-align: center;
    font-style: italic;
}

/* User's order highlighting in order book and trades */
.user-order-highlight {
    background-color: rgba(255, 221, 87, 0.3) !important;
    border-left: 3px solid #ffdd57 !important;
    font-weight: 600;
}

.user-order-highlight td:first-child::before {
    content: "★ ";
    color: #ffdd57;
}

/* Dark mode variant for order book */
.has-background-light .user-order-highlight {
    background-color: rgba(255, 221, 87, 0.25) !important;
}

/* Flash highlight for updated data */
@keyframes flashHighlight {
    0% {
        background-color: rgba(0, 209, 178, 0.5);
    }
    100% {
        background-color: transparent;
    }
}

@keyframes flashHighlightRow {
    0% {
        background-color: rgba(0, 209, 178, 0.4) !important;
    }
    100% {
        background-color: inherit;
    }
}

.flash-update {
    animation: flashHighlight 1s ease-out;
}

.flash-update-row {
    animation: flashHighlightRow 1s ease-out;
}

/* Price increase flash (green) */
@keyframes flashPriceUp {
    0% {
        background-color: rgba(35, 209, 96, 0.6);
        color: #fff;
    }
    100% {
        background-color: transparent;
    }
}

/* Price decrease flash (red) */
@keyframes flashPriceDown {
    0% {
        background-color: rgba(255, 56, 96, 0.6);
        color: #fff;
    }
    100% {
        background-color: transparent;
    }
}

.flash-price-up {
    animation: flashPriceUp 1s ease-out;
}

.flash-price-down {
    animation: flashPriceDown 1s ease-out;
}

/* New row flash (for trades) */
@keyframes flashNewRow {
    0% {
        background-color: rgba(50, 115, 220, 0.5) !important;
    }
    50% {
        background-color: rgba(50, 115, 220, 0.3) !important;
    }
    100% {
        background-color: inherit;
    }
}

.flash-new-row {
    animation: flashNewRow 1.5s ease-out;
}

/* Exchange Log clickable rows */
.exchange-log-row {
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.exchange-log-row:hover {
    background-color: var(--theme-surface-light) !important;
}

.exchange-log-row:hover td {
    color: var(--theme-primary) !important;
}

/* Price Ticker */
.price-ticker {
    background-color: var(--darker-bg);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    overflow: hidden;
    white-space: nowrap;
    height: 32px;
    line-height: 32px;
}

.price-ticker.is-hidden {
    display: none !important;
}

.ticker-wrapper {
    width: 100%;
    overflow: hidden;
    position: relative;
    display: flex;
    align-items: center;
}

.ticker-content {
    display: inline-flex;
    animation: tickerScroll 60s linear infinite;
    padding-left: 20px;
    flex-grow: 1;
}

.ticker-content:hover {
    animation-play-state: paused;
}

@keyframes tickerScroll {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%);
    }
}

.ticker-item {
    display: inline-flex;
    align-items: center;
    padding: 0 20px;
    font-size: 0.85rem;
    color: #fff;
    cursor: pointer;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.ticker-item:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.ticker-item .ticker-pair {
    font-weight: 600;
    color: #00d1b2;
    margin-right: 8px;
}

.ticker-item .ticker-price {
    font-family: monospace;
    padding: 2px 6px;
    border-radius: 3px;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.ticker-item .ticker-change {
    margin-left: 8px;
    font-size: 0.75rem;
    padding: 2px 6px;
    border-radius: 3px;
}

.ticker-item .ticker-change.is-up {
    background-color: rgba(35, 209, 96, 0.2);
    color: #23d160;
}

.ticker-item .ticker-change.is-down {
    background-color: rgba(255, 56, 96, 0.2);
    color: #ff3860;
}

.ticker-item .ticker-change.is-neutral {
    background-color: rgba(255, 255, 255, 0.1);
    color: #7a7a7a;
}

/* Ticker price flash animations */
@keyframes tickerFlashUp {
    0% {
        background-color: rgba(35, 209, 96, 0.6);
        color: #fff;
    }
    100% {
        background-color: transparent;
        color: inherit;
    }
}

@keyframes tickerFlashDown {
    0% {
        background-color: rgba(255, 56, 96, 0.6);
        color: #fff;
    }
    100% {
        background-color: transparent;
        color: inherit;
    }
}

.ticker-flash-up {
    animation: tickerFlashUp 1s ease-out;
}

.ticker-flash-down {
    animation: tickerFlashDown 1s ease-out;
}

/* Clickable table rows */
tr.is-clickable:hover {
    background-color: rgba(50, 115, 220, 0.1) !important;
}

/* ==================== Theme Picker Styles ==================== */
.theme-preset-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.theme-preset-card {
    border: 2px solid var(--theme-border);
    border-radius: 8px;
    padding: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
    background: var(--theme-surface-dark);
}

.theme-preset-card:hover {
    border-color: var(--theme-primary);
    transform: translateY(-2px);
}

.theme-preset-card.is-active {
    border-color: var(--theme-primary);
    box-shadow: 0 0 10px rgba(0, 209, 178, 0.3);
}

.theme-preset-swatch {
    display: flex;
    height: 40px;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.theme-preset-swatch > div {
    flex: 1;
}

.theme-preset-name {
    font-size: 0.85rem;
    font-weight: 600;
    text-align: center;
    color: var(--theme-text-primary);
}

.theme-color-picker-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.theme-color-picker-row label {
    min-width: 140px;
    font-size: 0.9rem;
}

.theme-color-picker-row input[type="color"] {
    width: 50px;
    height: 35px;
    border: 2px solid var(--theme-border);
    border-radius: 4px;
    padding: 2px;
    cursor: pointer;
    background: var(--theme-surface-dark);
}

.theme-color-picker-row input[type="text"] {
    width: 100px;
    font-family: monospace;
}

.theme-preview-box {
    padding: 1rem;
    border-radius: 8px;
    margin-top: 1rem;
}

.theme-preview-box .preview-title {
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.theme-preview-box .preview-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* Custom theme color sections */
.theme-color-section {
    margin-bottom: 1.5rem;
    padding: 1rem;
    border-radius: 8px;
    background: var(--theme-surface-dark);
}

.theme-color-section h5 {
    margin-bottom: 1rem;
    color: var(--theme-text-primary);
    border-bottom: 1px solid var(--theme-border);
    padding-bottom: 0.5rem;
}

/* ==================== Streams UI ==================== */

/* Stream list styling */
.stream-list .panel-block {
    cursor: pointer;
    transition: background-color 0.2s;
}

.stream-list .panel-block:hover {
    background-color: var(--theme-surface-light);
}

.stream-list .panel-block.is-active {
    background-color: var(--theme-primary);
    color: #fff;
}

.stream-list .panel-block.is-active .has-text-grey {
    color: rgba(255, 255, 255, 0.8) !important;
}

.stream-list .stream-item-info {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
}

.stream-list .stream-item-name {
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.stream-list .stream-item-meta {
    font-size: 0.75rem;
    opacity: 0.7;
}

/* Stream messages area */
.stream-messages {
    background-color: var(--theme-surface-dark);
    font-family: inherit;
}

.stream-message {
    padding: 0.5rem 0.75rem;
    margin-bottom: 0.5rem;
    border-radius: 8px;
    background-color: var(--theme-surface);
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.stream-message .message-header-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.25rem;
}

.stream-message .message-author {
    font-weight: 600;
    color: var(--theme-primary);
}

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

.stream-message .message-content {
    word-wrap: break-word;
}

.stream-message.is-own {
    background-color: var(--theme-primary);
    color: #fff;
    margin-left: 20%;
}

.stream-message.is-own .message-author {
    color: rgba(255, 255, 255, 0.9);
}

.stream-message.is-own .message-time {
    color: rgba(255, 255, 255, 0.7);
}

.stream-message.is-system {
    background-color: transparent;
    border: 1px dashed var(--theme-border);
    font-style: italic;
    text-align: center;
    color: var(--theme-text-muted);
}

/* Stream visibility badges */
.stream-visibility-private {
    background-color: #ff6b6b;
    color: #fff;
}

.stream-visibility-group {
    background-color: #ffa500;
    color: #fff;
}

.stream-visibility-public {
    background-color: #4caf50;
    color: #fff;
}

.stream-visibility-anonymous {
    background-color: #9e9e9e;
    color: #fff;
}

/* Stream invitation item */
.stream-invitation-item {
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--theme-border);
}

.stream-invitation-item:last-child {
    border-bottom: none;
}

.stream-invitation-buttons {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

/* Subscriber list */
.subscriber-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    border-bottom: 1px solid var(--theme-border);
}

.subscriber-item:last-child {
    border-bottom: none;
}

.subscriber-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.subscriber-permissions {
    display: flex;
    gap: 0.25rem;
}

.subscriber-permissions .tag {
    font-size: 0.65rem;
}

/* ==================== Notification Badge ==================== */
.notification-badge {
    position: absolute;
    top: -5px;
    right: -8px;
    background-color: var(--theme-danger);
    color: white;
    border-radius: 50%;
    min-width: 18px;
    height: 18px;
    font-size: 0.65rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    box-shadow: 0 0 4px rgba(0, 0, 0, 0.3);
    animation: notification-pulse 2s infinite;
}

@keyframes notification-pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

#notification-icon {
    position: relative;
}

#notification-icon.has-notifications .fa-bell {
    color: var(--theme-primary);
    animation: bell-ring 0.5s ease-in-out;
}

@keyframes bell-ring {
    0%, 100% { transform: rotate(0); }
    25% { transform: rotate(15deg); }
    50% { transform: rotate(-15deg); }
    75% { transform: rotate(10deg); }
}

/* Notification list items */
.notification-item {
    padding: 0.75rem;
    border-radius: 6px;
    margin-bottom: 0.5rem;
    background-color: var(--theme-surface);
    border-left: 3px solid var(--theme-primary);
    transition: background-color 0.2s;
}

.notification-item:hover {
    background-color: var(--theme-surface-light);
}

.notification-item.is-unviewed {
    background-color: var(--theme-surface-light);
    border-left-color: var(--theme-info);
}

.notification-item .notification-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.25rem;
}

.notification-item .notification-type {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--theme-text-muted);
}

.notification-item .notification-time {
    font-size: 0.7rem;
    color: var(--theme-text-muted);
}

.notification-item .notification-message {
    font-size: 0.9rem;
    color: var(--theme-text-primary);
}

.notification-item .notification-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

/* ==================== Social Feed Styles ==================== */

/* Post Composer */
.post-composer {
    border: 1px solid var(--theme-border);
    transition: border-color 0.2s ease;
}

.post-composer:focus-within {
    border-color: var(--theme-primary);
}

.post-composer .textarea {
    background-color: var(--theme-input-bg);
    border-color: var(--theme-input-border);
    color: var(--theme-input-text);
    resize: none;
    transition: all 0.2s ease;
}

.post-composer .textarea:focus {
    border-color: var(--theme-primary);
    box-shadow: 0 0 0 0.125em rgba(var(--theme-primary), 0.25);
}

.post-composer .file-input {
    display: none;
}

.attachment-preview {
    padding: 0.5rem;
    background-color: var(--theme-surface-dark);
    border-radius: 4px;
}

/* New Posts Button */
.new-posts-button {
    position: sticky;
    top: 60px;
    z-index: 50;
    animation: slideDown 0.3s ease-out;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Post Card */
.post-card {
    background-color: var(--theme-surface);
    border: 1px solid var(--theme-border);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
    transition: border-color 0.2s ease;
}

.post-card:hover {
    border-color: var(--theme-border-light);
}

.post-card .post-header {
    display: flex;
    align-items: flex-start;
    margin-bottom: 0.75rem;
}

.post-card .post-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    margin-right: 0.75rem;
    flex-shrink: 0;
    object-fit: cover;
}

.post-card .post-author-info {
    flex-grow: 1;
    min-width: 0;
}

.post-card .post-author-name {
    font-weight: 600;
    color: var(--theme-text-primary);
    cursor: pointer;
    transition: color 0.2s ease;
}

.post-card .post-author-name:hover {
    color: var(--theme-primary);
}

.post-card .post-author-username {
    font-size: 0.875rem;
    color: var(--theme-text-muted);
}

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

.post-card .post-content {
    color: var(--theme-text-primary);
    line-height: 1.5;
    white-space: pre-wrap;
    word-wrap: break-word;
    margin-bottom: 0.75rem;
}

.post-card .post-content a {
    color: var(--theme-primary);
}

.post-card .post-content a:hover {
    text-decoration: underline;
}

.post-card .post-content .hashtag {
    color: var(--theme-primary);
    cursor: pointer;
}

.post-card .post-content .hashtag:hover {
    text-decoration: underline;
}

.post-card .post-content .mention {
    color: var(--theme-secondary);
    cursor: pointer;
}

.post-card .post-content .mention:hover {
    text-decoration: underline;
}

/* Post Attachments */
.post-attachments {
    margin-bottom: 0.75rem;
}

/* Single attachment - full width */
.post-attachments.single-attachment .post-attachment-media {
    width: 100%;
    max-height: 500px;
    object-fit: cover;
    border-radius: 8px;
    display: block;
}

/* Video container inside single attachment */
.post-attachments.single-attachment .video-container {
    width: 100%;
}

.post-attachments.single-attachment .video-container .post-video {
    width: 100%;
    min-height: 200px;
    max-height: 500px;
    object-fit: contain;
    border-radius: 8px;
    display: block;
    background: var(--theme-surface-dark);
}

/* Multiple attachments - grid layout */
.post-attachments.multi-attachment {
    display: grid;
    gap: 4px;
    border-radius: 8px;
    overflow: hidden;
}

.post-attachments.multi-attachment.grid-2 {
    grid-template-columns: repeat(2, 1fr);
}

.post-attachments.multi-attachment.grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

.post-attachments.multi-attachment.grid-4 {
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(2, 1fr);
}

.post-attachments.multi-attachment .post-attachment-media {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 0;
    cursor: pointer;
}

/* Video container inside multi attachment grid */
.post-attachments.multi-attachment .video-container {
    width: 100%;
    height: 100%;
}

.post-attachments.multi-attachment .video-container .post-video {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 0;
}

/* For 3 attachments - first one spans full width on top */
.post-attachments.multi-attachment.grid-3 .attachment-item:first-child {
    grid-column: span 3;
}

.post-attachments.multi-attachment.grid-3 .attachment-item:first-child .post-attachment-media {
    height: 200px;
}

/* More than 4 attachments indicator */
.attachment-more-indicator {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    font-weight: bold;
    cursor: pointer;
}

.attachment-item {
    position: relative;
    overflow: hidden;
}

.post-attachment-media {
    max-width: 100%;
    max-height: 400px;
    width: auto;
    height: auto;
    border-radius: 8px;
    object-fit: contain;
    display: block;
}

.post-attachment-video {
    max-width: 100%;
    max-height: 400px;
    border-radius: 8px;
}

.post-attachment-audio {
    width: 100%;
    max-width: 400px;
}

.post-attachment-file {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1rem;
    background-color: var(--theme-surface-dark);
    border-radius: 4px;
    color: var(--theme-text-primary);
    text-decoration: none;
    transition: background-color 0.2s ease;
}

.post-attachment-file:hover {
    background-color: var(--theme-surface-light);
    color: var(--theme-primary);
}

.post-attachment-file .icon {
    margin-right: 0.5rem;
}

/* Audio Player Styles */
.post-audio-attachments {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin: 0.75rem 0;
}

.audio-player-card {
    background: var(--theme-surface-dark);
    border: 1px solid var(--theme-border);
    border-radius: 12px;
    padding: 0.75rem 1rem;
    position: relative;
}

.audio-player-card audio {
    display: none; /* Hidden, we use custom controls */
}

.audio-player-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.audio-player-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--theme-primary), var(--theme-primary-hover));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1rem;
}

.audio-player-details {
    flex: 1;
    min-width: 0;
}

.audio-player-filename {
    display: block;
    font-weight: 500;
    color: var(--theme-text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 0.9rem;
}

.audio-player-duration {
    font-size: 0.75rem;
    color: var(--theme-text-muted);
}

.audio-player-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.audio-play-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: var(--theme-primary);
    color: white;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s, transform 0.1s;
    flex-shrink: 0;
}

.audio-play-btn:hover {
    background: var(--theme-primary-hover);
    transform: scale(1.05);
}

.audio-play-btn:active {
    transform: scale(0.95);
}

.audio-progress-container {
    flex: 1;
    height: 6px;
    background: var(--theme-surface-light);
    border-radius: 3px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.audio-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--theme-primary), var(--theme-primary-hover));
    border-radius: 3px;
    width: 0%;
    transition: width 0.1s linear;
}

.audio-current-time {
    font-size: 0.75rem;
    color: var(--theme-text-muted);
    min-width: 35px;
    text-align: right;
}

/* Responsive audio player */
@media screen and (max-width: 480px) {
    .audio-player-card {
        padding: 0.5rem 0.75rem;
    }
    
    .audio-player-icon {
        width: 32px;
        height: 32px;
        font-size: 0.875rem;
    }
    
    .audio-play-btn {
        width: 32px;
        height: 32px;
    }
}

/* Video Embeds (YouTube, Vimeo, etc.) */
.post-video-embeds {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin: 0.75rem 0;
}

.video-embed-container {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    background-color: var(--theme-surface-dark);
}

.video-embed-wrapper {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    height: 0;
    overflow: hidden;
}

.video-embed-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 12px;
}

/* TikTok has different aspect ratio */
.video-embed-container[data-provider="tiktok"] .video-embed-wrapper {
    padding-bottom: 177%; /* 9:16 portrait aspect ratio */
    max-width: 325px;
}

/* Embedded post video embeds (smaller) */
.embedded-post-video-embeds {
    margin-top: 0.5rem;
}

.embedded-post-video-embeds .video-embed-wrapper {
    max-height: 300px;
    padding-bottom: 56.25%;
}

/* Link Previews */
.post-link-previews {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin: 0.75rem 0;
}

.link-preview-card {
    display: flex;
    border: 1px solid var(--theme-border);
    border-radius: 12px;
    overflow: hidden;
    background-color: var(--theme-surface-dark);
    text-decoration: none;
    color: inherit;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.link-preview-card:hover {
    background-color: var(--theme-surface-light);
    border-color: var(--theme-primary);
}

.link-preview-image {
    flex-shrink: 0;
    width: 120px;
    min-height: 80px;
    overflow: hidden;
    background-color: var(--theme-surface);
}

.link-preview-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.link-preview-content {
    flex: 1;
    padding: 0.75rem;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.link-preview-site {
    font-size: 0.75rem;
    color: var(--theme-text-muted);
    text-transform: lowercase;
    margin-bottom: 0.25rem;
}

.link-preview-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--theme-text-primary);
    line-height: 1.3;
    margin-bottom: 0.25rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.link-preview-description {
    font-size: 0.8rem;
    color: var(--theme-text-muted);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Responsive link previews */
@media screen and (max-width: 480px) {
    .link-preview-card {
        flex-direction: column;
    }
    
    .link-preview-image {
        width: 100%;
        height: 150px;
    }
}

/* Post Actions */
.post-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    border-top: 1px solid var(--theme-border);
    padding-top: 0.75rem;
}

.post-action {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: var(--theme-text-muted);
    cursor: pointer;
    transition: color 0.2s ease;
    font-size: 0.875rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

.post-action:hover {
    color: var(--theme-primary);
    background-color: var(--theme-surface-light);
}

.post-action.is-active {
    color: var(--theme-danger);
}

.post-action.is-active:hover {
    color: var(--theme-danger);
}

.post-action .icon {
    font-size: 1rem;
}

.post-action .count {
    font-size: 0.875rem;
}

/* Post truncation styling */
.post-content-truncated,
.post-content-full {
    margin-bottom: 0.75rem;
    line-height: 1.5;
    word-break: break-word;
}

.post-expand-link {
    color: var(--theme-primary);
    cursor: pointer;
    font-weight: 500;
    margin-left: 0.25rem;
}

.post-expand-link:hover {
    text-decoration: underline;
    color: var(--theme-primary-dark);
}

/* Reply styling - only indent in feed, not on post screen */
#feed-posts .post-card.is-reply {
    margin-left: 2rem;
    border-left: 2px solid var(--theme-primary);
}

/* Post screen replies - no indentation, full width */
#post-screen-replies .post-card.is-reply {
    margin-left: 0;
    border-left: none;
}

/* Feed tabs styling */
.tabs.is-boxed {
    background-color: var(--theme-surface);
    border-radius: 8px 8px 0 0;
    padding: 0.5rem 0.5rem 0;
    margin-bottom: 0 !important;
}

.tabs.is-boxed li.is-active a {
    background-color: var(--theme-surface-light);
    border-color: var(--theme-border);
    border-bottom-color: transparent;
    color: var(--theme-primary);
}

.tabs.is-boxed a {
    border-color: var(--theme-border);
    color: var(--theme-text-secondary);
    background-color: transparent;
}

.tabs.is-boxed a:hover {
    background-color: var(--theme-surface-dark);
    color: var(--theme-text-primary);
}

/* Feed container styling */
#feed-container {
    background-color: var(--theme-surface);
    border-radius: 0 0 8px 8px;
    padding: 1rem;
    border: 1px solid var(--theme-border);
    border-top: none;
    overflow-x: hidden;
    overflow-y: visible;
}

/* Hashtag feed container */
#hashtag-feed-container {
    background-color: var(--theme-surface);
    border-radius: 8px;
    padding: 1rem;
    border: 1px solid var(--theme-border);
    overflow-x: hidden;
    overflow-y: visible;
}

/* Ensure post lists don't create scrollbars */
#feed-posts,
#hashtag-feed-posts,
#profile-posts-feed,
#profile-replies-feed,
#post-screen-content,
#post-screen-replies {
    overflow-x: hidden;
    overflow-y: visible;
}

/* Post screen action bar (permalink, embed) */
.post-screen-actions {
    padding: 0.75rem;
    background: var(--theme-surface-dark);
    border-radius: 8px;
    margin-top: 0.5rem;
}

.post-screen-actions .level-left span {
    word-break: break-all;
}

/* Tab content boxes should not create scrollbars */
#profile-screen-content-posts,
#profile-screen-content-replies,
.tabs.is-boxed + .box {
    overflow-x: hidden;
    overflow-y: visible;
}

/* Image lightbox effect */
.post-attachment-media.is-clickable {
    cursor: pointer;
    transition: transform 0.2s ease;
}

.post-attachment-media.is-clickable:hover {
    transform: scale(1.01);
}

/* Video container with inline playback */
.video-container {
    position: relative;
    width: 100%;
    border-radius: 12px;
    overflow: hidden;
}

.video-container .post-video {
    width: 100%;
    min-height: 150px;
    max-height: 400px;
    background: var(--theme-surface-dark);
    border-radius: 12px;
}

.video-fullscreen-btn {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    border: none;
    border-radius: 4px;
    padding: 0.4rem 0.6rem;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
    z-index: 10;
    opacity: 0;
}

.video-container:hover .video-fullscreen-btn {
    opacity: 1;
}

.video-fullscreen-btn:hover {
    background: rgba(0, 0, 0, 0.8);
    transform: scale(1.1);
}

/* Video play overlay - shown when controls are hidden */
.video-play-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 4rem;
    color: rgba(255, 255, 255, 0.85);
    cursor: pointer;
    transition: color 0.2s ease, transform 0.2s ease;
    z-index: 5;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
    pointer-events: auto;
}

.video-play-overlay:hover {
    color: white;
    transform: translate(-50%, -50%) scale(1.1);
}

.video-container:hover .video-play-overlay {
    color: white;
}

/* Lightbox overlay */
.image-lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.lightbox-container {
    position: relative;
    max-width: 95vw;
    max-height: 95vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-container img,
.lightbox-container video {
    max-width: 95vw;
    max-height: 90vh;
    object-fit: contain;
}

.lightbox-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1001;
}

.lightbox-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    width: 50px;
    height: 50px;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    z-index: 1001;
}

.lightbox-nav:hover {
    background: rgba(255, 255, 255, 0.2);
}

.lightbox-nav.prev {
    left: 1rem;
}

.lightbox-nav.next {
    right: 1rem;
}

.lightbox-counter {
    position: absolute;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    font-size: 0.9rem;
    background: rgba(0, 0, 0, 0.5);
    padding: 0.5rem 1rem;
    border-radius: 4px;
}

/* Visibility badge */
.visibility-badge {
    display: inline-flex;
    align-items: center;
    font-size: 0.7rem;
    padding: 0.1rem 0.4rem;
    border-radius: 3px;
    margin-left: 0.5rem;
    background-color: var(--theme-surface-light);
    color: var(--theme-text-muted);
}

/* Repost styling */
.repost-info {
    display: flex;
    align-items: center;
    font-size: 0.8rem;
    color: var(--theme-text-muted);
    margin-bottom: 0.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px dashed var(--theme-border);
}

.repost-info .icon {
    margin-right: 0.25rem;
    color: var(--theme-success);
}

/* Reply thread indicator */
.reply-indicator {
    display: flex;
    align-items: center;
    font-size: 0.8rem;
    color: var(--theme-text-muted);
    margin-bottom: 0.5rem;
}

.reply-indicator .icon {
    margin-right: 0.25rem;
}

/* Post dropdown menu */
.post-menu {
    position: relative;
}

.post-menu-trigger {
    color: var(--theme-text-muted);
    cursor: pointer;
    padding: 0.25rem;
    transition: color 0.2s ease;
}

.post-menu-trigger:hover {
    color: var(--theme-text-primary);
}

.post-menu-dropdown {
    position: absolute;
    right: 0;
    top: 100%;
    background-color: var(--theme-surface);
    border: 1px solid var(--theme-border);
    border-radius: 4px;
    box-shadow: 0 4px 12px var(--theme-shadow);
    min-width: 150px;
    z-index: 100;
    display: none;
}

.post-menu-dropdown.is-active {
    display: block;
}

.post-menu-item {
    display: block;
    padding: 0.5rem 1rem;
    color: var(--theme-text-primary);
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.post-menu-item:hover {
    background-color: var(--theme-surface-light);
}

.post-menu-item.is-danger {
    color: var(--theme-danger);
}

/* Empty feed state */
#feed-empty {
    padding: 3rem 1rem;
}

/* Load more button */
#feed-load-more .button {
    color: var(--theme-text-secondary);
    border-color: var(--theme-border);
}

#feed-load-more .button:hover {
    color: var(--theme-primary);
    border-color: var(--theme-primary);
}

/* ==================== Registry Browser ==================== */

.registry-tree {
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.9rem;
}

.registry-tree-node {
    user-select: none;
}

.registry-tree-item {
    display: flex;
    align-items: center;
    padding: 0.25rem 0.5rem;
    cursor: pointer;
    border-radius: 4px;
    transition: background-color 0.15s ease;
    margin-bottom: 2px;
}

.registry-tree-item:hover {
    background-color: var(--theme-surface);
}

.registry-tree-item.is-selected {
    background-color: var(--theme-primary);
    color: white;
}

.registry-tree-item.is-selected .registry-tree-icon {
    color: white;
}

.registry-tree-toggle {
    width: 1.25rem;
    text-align: center;
    flex-shrink: 0;
    color: var(--theme-text-muted);
}

.registry-tree-icon {
    width: 1.25rem;
    text-align: center;
    flex-shrink: 0;
    margin-right: 0.5rem;
    color: var(--theme-primary);
}

.registry-tree-label {
    flex-grow: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.registry-tree-children {
    margin-left: 1.5rem;
    border-left: 1px dashed var(--theme-border);
    padding-left: 0.5rem;
}

.registry-tree-loading {
    padding: 0.5rem 1rem;
    color: var(--theme-text-muted);
    font-style: italic;
}

.registry-value-display {
    background-color: var(--theme-surface-dark);
    color: var(--theme-text-primary);
    padding: 1rem;
    border-radius: 4px;
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-word;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.85rem;
    max-height: 200px;
    overflow-y: auto;
}

.registry-children-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.registry-child-tag {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    background-color: var(--theme-surface-dark);
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.15s ease;
    font-size: 0.85rem;
}

.registry-child-tag:hover {
    background-color: var(--theme-primary);
    color: white;
}

.registry-child-tag .icon {
    margin-right: 0.25rem;
}

.registry-search-result {
    display: flex;
    align-items: center;
    padding: 0.5rem;
    border-bottom: 1px solid var(--theme-border);
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.registry-search-result:hover {
    background-color: var(--theme-surface);
}

.registry-search-result:last-child {
    border-bottom: none;
}

.registry-search-result-path {
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.85rem;
    color: var(--theme-text-primary);
}

/* ==================== Repost Header Styling ==================== */

.repost-header {
    display: flex;
    align-items: center;
    font-size: 0.8rem;
    color: var(--theme-text-primary);
    margin-bottom: 0.5rem;
    padding-bottom: 0.5rem;
    cursor: pointer;
}

.repost-header span {
    color: inherit;
}

.repost-header:hover {
    color: var(--theme-primary);
}

.repost-header:hover span {
    color: inherit;
}

.repost-header .icon {
    margin-right: 0.35rem;
    color: var(--theme-success);
}

.repost-header strong {
    font-weight: 600;
    color: inherit;
}

/* ==================== Embedded Post Styling (Quote Reposts) ==================== */

.embedded-post {
    margin-top: 0.75rem;
    padding: 0.75rem;
    border: 1px solid var(--theme-border);
    border-radius: 12px;
    background-color: var(--theme-surface-dark);
    cursor: pointer;
    transition: border-color 0.15s ease;
}

.embedded-post:hover {
    border-color: var(--theme-text-muted);
}

.embedded-post-header {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
}

.embedded-post-avatar {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    object-fit: cover;
}

.embedded-post-author {
    font-weight: 600;
    color: var(--theme-text-primary);
}

.embedded-post-username {
    color: var(--theme-text-muted);
}

.embedded-post-time {
    color: var(--theme-text-muted);
}

.embedded-post-content {
    font-size: 0.9rem;
    line-height: 1.4;
    color: var(--theme-text-primary);
}

.embedded-post-attachments {
    margin-top: 0.5rem;
}

.embedded-post-attachments .post-attachments {
    max-height: 200px;
    overflow: hidden;
    border-radius: 8px;
}

.embedded-post-attachments .post-attachment-media {
    max-height: 200px;
    object-fit: cover;
}

/* ==================== Media Grid ==================== */

.media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 8px;
}

.media-grid-item {
    position: relative;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border-radius: 8px;
    background: var(--theme-surface-dark);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.media-grid-item:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 12px var(--theme-shadow);
}

.media-grid-item img,
.media-grid-item video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.media-grid-item .media-type-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
}

.media-grid-item .media-attached-badge {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: var(--theme-primary);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
}

.media-grid-item .media-audio-placeholder,
.media-grid-item .media-file-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--theme-surface);
    color: var(--theme-text-muted);
}

/* Media Fullscreen Overlay */
.media-fullscreen-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.media-fullscreen-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.media-fullscreen-content .fullscreen-media {
    max-width: 90vw;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 8px;
}

.media-fullscreen-controls {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    gap: 8px;
}

.media-fullscreen-info {
    margin-top: 16px;
    text-align: center;
    color: white;
}

/* Media Picker Modal */
.media-picker-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 8px;
    max-height: 400px;
    overflow-y: auto;
    padding: 8px;
}

.media-picker-item {
    position: relative;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border-radius: 4px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color 0.2s ease;
}

.media-picker-item:hover {
    border-color: var(--theme-primary);
}

.media-picker-item.selected {
    border-color: var(--theme-primary);
    box-shadow: 0 0 0 2px var(--theme-primary);
}

.media-picker-item img,
.media-picker-item video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.media-picker-item .checkmark {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 20px;
    height: 20px;
    background: var(--theme-primary);
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 10px;
}

.media-picker-item.selected .checkmark {
    display: flex;
}

/* Avatar picker specific */
.avatar-picker-preview {
    width: 128px;
    height: 128px;
    border-radius: 50%;
    overflow: hidden;
    margin: 0 auto 16px;
    background: var(--theme-surface);
}

.avatar-picker-preview img,
.avatar-picker-preview video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-picker-preview video {
    object-fit: cover;
}

/* Global Loading Overlay */
.global-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    color: white;
}

.global-loading-overlay.is-active {
    display: flex;
}

/* ==================== Mobile-First Improvements ==================== */

/* Ensure containers don't overflow on mobile */
.container {
    max-width: 100%;
    overflow-x: hidden;
}

/* Post attachments on mobile */
@media screen and (max-width: 768px) {
    /* Post attachment images fill available width */
    .post-attachments .image,
    .post-attachments figure {
        max-width: 100%;
    }
    
    .post-attachments img,
    .post-attachments video {
        max-width: 100%;
        height: auto;
    }
    
    /* Reduce avatar size on mobile for more content space */
    .post-avatar,
    .media-left .image.is-48x48 {
        width: 40px;
        height: 40px;
    }
    
    .media-left .image.is-48x48 img {
        width: 40px;
        height: 40px;
    }
    
    /* Tighter post metadata */
    .post-meta {
        font-size: 0.8rem;
    }
    
    /* Post action buttons */
    .post-actions .button {
        padding: 0.25rem 0.5rem;
        font-size: 0.85rem;
    }
    
    /* Direct messages container on mobile */
    #dm-conversations-container,
    #dm-messages-container {
        max-height: 60vh;
    }
    
    /* Columns stack on mobile */
    .columns.is-mobile-stacked {
        display: block;
    }
    
    .columns.is-mobile-stacked > .column {
        width: 100%;
    }
    
    /* Hide non-essential elements on mobile */
    .is-hidden-mobile {
        display: none !important;
    }
    
    /* Full-width buttons on mobile */
    .button.is-fullwidth-mobile {
        width: 100%;
    }
    
    /* Tabs on mobile */
    .tabs ul {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .tabs li {
        flex-shrink: 0;
    }
}

/* Touch-friendly sizing */
@media screen and (max-width: 768px) {
    /* Larger touch targets */
    .button:not(.is-small) {
        min-height: 44px;
    }
    
    .input,
    .textarea,
    .select select {
        min-height: 44px;
        font-size: 16px; /* Prevents iOS zoom on focus */
    }
    
    /* Panel items should be easier to tap */
    .panel-block {
        min-height: 48px;
    }
}

/* Landscape mobile orientation */
@media screen and (max-width: 768px) and (orientation: landscape) {
    .menu-grid {
        grid-template-columns: repeat(min(var(--menu-grid-columns, 4), 4), 1fr);
    }
    
    #dm-conversations-container,
    #dm-messages-container {
        max-height: 40vh;
    }
}
