/* ==========================================================================
   Galene FreeBSD frontend - stylesheet
   Theme inspired by the FreeBSD Project (https://www.freebsd.org/)
   Layout inspired by Google Meet / Jitsi Meet.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Design tokens (FreeBSD palette)
   -------------------------------------------------------------------------- */
:root {
    /* FreeBSD brand reds */
    --fbsd-red:        #990000;
    --fbsd-red-dark:   #790000;
    --fbsd-red-bright: #d1332e;
    --fbsd-red-soft:   #ab2b28;

    /* Surfaces (dark theme) */
    --bg:              #1a1a1a;
    --bg-elevated:     #202124;
    --surface:         #2d2d2d;
    --surface-hover:   #3a3a3a;
    --surface-active:  #444444;
    --border:          #3c4043;

    /* Text */
    --text:            #e8eaed;
    --text-muted:      #9aa0a6;
    --text-faint:      #5f6368;

    /* Feedback */
    --danger:          #d1332e;
    --success:         #81c995;
    --warning:         #fdd663;

    /* Layout */
    --control-size:    48px;
    --radius:          12px;
    --radius-sm:       8px;
    --radius-pill:     999px;

    /* Typography */
    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
            "Helvetica Neue", Arial, sans-serif;
    --font-mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo,
                 monospace;
}

/* --------------------------------------------------------------------------
   2. Reset & base
   -------------------------------------------------------------------------- */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html,
body {
    height: 100%;
}

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
    color: inherit;
}

input {
    font-family: inherit;
}

a {
    color: var(--fbsd-red-bright);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.hidden {
    display: none !important;
}

/* --------------------------------------------------------------------------
   3. FreeBSD orb (placeholder shown when a camera is off)
   -------------------------------------------------------------------------- */
.orb {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at 30% 25%, #2a2a2a, #141414 70%);
}

.orb svg {
    width: 45%;
    height: 45%;
    max-width: 160px;
    max-height: 160px;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.5));
}

.orb .orb-name {
    position: absolute;
    bottom: 8px;
    left: 0;
    right: 0;
    text-align: center;
    font-size: 13px;
    color: var(--text-muted);
    pointer-events: none;
}

/* --------------------------------------------------------------------------
   4. Landing page (index.html)
   -------------------------------------------------------------------------- */
.landing {
    min-height: 100%;
    display: flex;
    flex-direction: column;
}

.landing-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 24px;
}

.landing-header .brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 20px;
    font-weight: 600;
    color: var(--text);
}

.landing-header .brand .brand-logo {
    height: 52px;
    width: auto;
}
.landing-header .brand svg {
    width: 28px;
    height: 28px;
}

.landing-header .brand .brand-accent {
    color: var(--fbsd-red-bright);
}

.landing-header .spacer {
    flex: 1;
}

.landing-header .server-badge {
    font-size: 12px;
    color: var(--text-muted);
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 6px 12px;
    border-radius: var(--radius-pill);
    max-width: 320px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.landing-main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.landing-hero {
    display: flex;
    align-items: center;
    gap: 64px;
    max-width: 1000px;
    width: 100%;
}

.landing-copy {
    flex: 1;
    min-width: 0;
}

.landing-copy h1 {
    font-size: 40px;
    font-weight: 400;
    line-height: 1.2;
    margin-bottom: 16px;
    letter-spacing: -0.5px;
}

.landing-copy h1 .accent {
    color: var(--fbsd-red-bright);
    font-weight: 600;
}

.landing-copy p {
    color: var(--text-muted);
    font-size: 16px;
    max-width: 440px;
}

.landing-actions {
    flex: 1;
    min-width: 0;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 32px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.landing-actions .btn-new {
    width: 100%;
    background: var(--fbsd-red);
    color: #fff;
    font-size: 16px;
    font-weight: 500;
    padding: 14px 20px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: background 0.15s ease;
}

.landing-actions .name-field {
    margin-bottom: 16px;
}

.landing-actions .name-field label {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.landing-actions .name-field input {
    width: 100%;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    padding: 12px 14px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.15s ease;
}

.landing-actions .name-field input:focus {
    border-color: var(--fbsd-red-bright);
}

.landing-actions .name-field input::placeholder {
    color: var(--text-faint);
}

.landing-actions .btn-new:hover {
    background: var(--fbsd-red-bright);
}

.landing-actions .btn-new svg {
    width: 20px;
    height: 20px;
}

.landing-actions .divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 20px 0;
    color: var(--text-faint);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.landing-actions .divider::before,
.landing-actions .divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--border);
}

.join-form {
    display: flex;
    gap: 8px;
}

.join-form input {
    flex: 1;
    min-width: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    padding: 12px 14px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.15s ease;
}

.join-form input:focus {
    border-color: var(--fbsd-red-bright);
}

.join-form input::placeholder {
    color: var(--text-faint);
}

.join-form .btn-join {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
    font-size: 14px;
    font-weight: 500;
    padding: 12px 20px;
    border-radius: var(--radius-sm);
    transition: background 0.15s ease;
}

.join-form .btn-join:hover {
    background: var(--surface-hover);
}

.landing-error {
    margin-top: 16px;
    color: var(--danger);
    font-size: 13px;
    min-height: 20px;
}

.landing-footer {
    padding: 16px 24px;
    color: var(--text-faint);
    font-size: 12px;
    text-align: center;
    border-top: 1px solid var(--border);
}

/* --------------------------------------------------------------------------
   5. Meeting room (meet.html)
   -------------------------------------------------------------------------- */
.meeting {
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* 5.1 Top bar */
.meeting-topbar {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 20px;
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.meeting-topbar .brand {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 16px;
    color: var(--text);
}

.meeting-topbar .brand .brand-logo {
    height: 40px;
    width: auto;
}

.meeting-topbar .brand svg {
    width: 22px;
    height: 22px;
}

.meeting-topbar .brand .brand-accent {
    color: var(--fbsd-red-bright);
}

.meeting-topbar .meeting-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.meeting-topbar .meeting-title {
    font-size: 15px;
    font-weight: 500;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.meeting-topbar .meeting-meta {
    font-size: 12px;
    color: var(--text-muted);
}

.meeting-topbar .spacer {
    flex: 1;
}

.meeting-topbar .topbar-status {
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
}

.meeting-topbar .topbar-status .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success);
}

.meeting-topbar .topbar-status.connecting .dot {
    background: var(--warning);
    animation: pulse 1.2s infinite;
}

.meeting-topbar .topbar-status.error .dot {
    background: var(--danger);
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* 5.2 Main area: video grid + sidebar */
.meeting-body {
    flex: 1;
    display: flex;
    min-height: 0;
}

.video-stage {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    overflow: auto;
}

/* 5.3 Video grid */
.video-grid {
    display: grid;
    gap: 12px;
    width: 100%;
    height: 100%;
    align-content: center;
    justify-content: center;
}

/* Grid layouts by participant count */
.video-grid.count-1 {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr);
    max-width: 900px;
    max-height: 100%;
}

.video-grid.count-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: minmax(0, 1fr);
    max-width: 1200px;
}

.video-grid.count-3,
.video-grid.count-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: repeat(2, minmax(0, 1fr));
    max-width: 1200px;
}

.video-grid.count-5,
.video-grid.count-6 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-template-rows: repeat(2, minmax(0, 1fr));
    max-width: 1400px;
}

.video-grid.count-7,
.video-grid.count-8,
.video-grid.count-9 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-template-rows: repeat(3, minmax(0, 1fr));
    max-width: 1400px;
}

.video-grid.count-10,
.video-grid.count-11,
.video-grid.count-12 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    grid-template-rows: repeat(3, minmax(0, 1fr));
    max-width: 1600px;
}

.video-grid.count-13,
.video-grid.count-14,
.video-grid.count-15,
.video-grid.count-16 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    grid-template-rows: repeat(4, minmax(0, 1fr));
    max-width: 1600px;
}

/* Main tile (active speaker / screenshare) + thumbnails layout */
.video-stage.has-main {
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 8px;
}

.main-tile {
    flex: 1;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.main-tile .video-tile {
    width: 100%;
    height: 100%;
    max-width: 1200px;
}

.video-grid.thumbnails {
    flex: 0 0 auto;
    height: 150px;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    grid-auto-rows: 150px;
    max-width: 100%;
    align-content: center;
}

/* Active speaker highlight */
.video-tile.tile-active {
    border-color: var(--fbsd-red-bright);
    box-shadow: 0 0 0 2px var(--fbsd-red-bright);
}

/* 5.4 Video tile */
.video-tile {
    position: relative;
    background: var(--surface);
    border-radius: var(--radius);
    overflow: hidden;
    min-width: 0;
    min-height: 0;
    border: 1px solid var(--border);
}

.video-tile video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.video-tile .tile-label {
    position: absolute;
    bottom: 8px;
    left: 8px;
    background: rgba(0, 0, 0, 0.6);
    color: var(--text);
    font-size: 12px;
    padding: 3px 10px;
    border-radius: var(--radius-pill);
    display: flex;
    align-items: center;
    gap: 6px;
    max-width: calc(100% - 16px);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.video-tile .tile-label .mic-off {
    color: var(--danger);
    flex-shrink: 0;
}

.video-tile .tile-label svg {
    width: 12px;
    height: 12px;
}

.video-tile .tile-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.6);
    color: var(--text-muted);
    font-size: 11px;
    padding: 2px 8px;
    border-radius: var(--radius-pill);
}

.video-tile .tile-badge.op {
    color: var(--warning);
}

/* Hand badge (raised hand) on a tile */
.video-tile .tile-hand {
    position: absolute;
    top: 8px;
    left: 8px;
    background: rgba(0, 0, 0, 0.6);
    color: var(--warning);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.video-tile .tile-hand svg {
    width: 16px;
    height: 16px;
}

.video-tile.local {
    border-color: var(--fbsd-red-dark);
}

.video-tile.local::after {
    content: "";
    position: absolute;
    inset: 0;
    border: 2px solid var(--fbsd-red);
    border-radius: var(--radius);
    pointer-events: none;
}

/* Camera-off placeholder */
.video-tile .placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at 30% 25%, #2a2a2a, #141414 70%);
}

.video-tile .placeholder .orb-img {
    width: 70%;
    max-width: 200px;
    max-height: 50%;
    object-fit: contain;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.5));
}

/* 5.5 Empty state (no participants yet) */
.empty-stage {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    color: var(--text-muted);
    text-align: center;
    padding: 24px;
}

.empty-stage .empty-orb {
    width: 240px;
    height: auto;
    opacity: 0.85;
}

.empty-stage h2 {
    font-size: 22px;
    font-weight: 400;
    color: var(--text);
}

.empty-stage p {
    font-size: 14px;
    max-width: 360px;
}

/* 5.6 Sidebar (chat / participants) */
.sidebar {
    width: 340px;
    flex-shrink: 0;
    background: var(--bg-elevated);
    border-left: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.sidebar.hidden {
    display: none;
}

.sidebar-tabs {
    display: flex;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.sidebar-tabs .tab {
    flex: 1;
    padding: 12px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-bottom: 2px solid transparent;
    transition: color 0.15s ease, border-color 0.15s ease;
}

.sidebar-tabs .tab svg {
    width: 16px;
    height: 16px;
}

.sidebar-tabs .tab.active {
    color: var(--text);
    border-bottom-color: var(--fbsd-red-bright);
}

.sidebar-tabs .tab .count {
    background: var(--surface);
    border-radius: var(--radius-pill);
    font-size: 11px;
    padding: 1px 8px;
    color: var(--text-muted);
}

/* Close button in the sidebar tabs */
.sidebar-tabs .sidebar-close {
    flex: 0 0 auto;
    width: 44px;
    padding: 12px 8px;
    color: var(--text-muted);
    border-bottom: none;
}

.sidebar-tabs .sidebar-close:hover {
    color: var(--text);
    background: var(--surface);
}

.sidebar-tabs .sidebar-close svg {
    width: 18px;
    height: 18px;
}

.sidebar-panel {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.sidebar-panel.hidden {
    display: none;
}

/* Chat */
.chat-messages {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.chat-message {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.chat-message .msg-head {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.chat-message .msg-author {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
}

.chat-message .msg-author.me {
    color: var(--fbsd-red-bright);
}

.chat-message .msg-time {
    font-size: 11px;
    color: var(--text-faint);
}

.chat-message .msg-body {
    font-size: 14px;
    color: var(--text);
    word-wrap: break-word;
    overflow-wrap: anywhere;
}

.chat-message.system {
    align-items: center;
    text-align: center;
    color: var(--text-muted);
    font-size: 12px;
    font-style: italic;
}

.chat-empty {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-faint);
    font-size: 13px;
    text-align: center;
    padding: 24px;
}

.chat-input {
    display: flex;
    gap: 8px;
    padding: 12px;
    border-top: 1px solid var(--border);
    flex-shrink: 0;
}

.chat-input input {
    flex: 1;
    min-width: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    color: var(--text);
    padding: 10px 16px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.15s ease;
}

.chat-input input:focus {
    border-color: var(--fbsd-red-bright);
}

.chat-input .btn-send {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--fbsd-red);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.15s ease;
}

.chat-input .btn-send:hover {
    background: var(--fbsd-red-bright);
}

.chat-input .btn-send svg {
    width: 18px;
    height: 18px;
}

/* Participants list */
.participants-list {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 8px;
}

.participant {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    transition: background 0.15s ease;
}

.participant:hover {
    background: var(--surface);
}

.participant .p-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--fbsd-red-dark);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    font-weight: 600;
    flex-shrink: 0;
}

.participant .p-name {
    flex: 1;
    min-width: 0;
    font-size: 14px;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.participant .p-name .me-tag {
    color: var(--fbsd-red-bright);
    font-size: 12px;
    margin-left: 4px;
}

.participant .p-status {
    display: flex;
    gap: 6px;
    color: var(--text-muted);
    flex-shrink: 0;
}

.participant .p-status svg {
    width: 16px;
    height: 16px;
}

.participant .p-status .off {
    color: var(--danger);
}

.participant .p-status .on {
    color: var(--text-muted);
}

.participant .p-status .hand {
    color: var(--warning);
}

.participant .p-badge {
    font-size: 11px;
    color: var(--warning);
    flex-shrink: 0;
}

/* 5.7 Control bar */
.control-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 12px 20px;
    background: var(--bg-elevated);
    border-top: 1px solid var(--border);
    flex-shrink: 0;
    flex-wrap: wrap;
    /* Keep the toolbar above the sidebar (which is a fixed overlay on mobile). */
    position: relative;
    z-index: 60;
}

.control-btn {
    width: var(--control-size);
    height: var(--control-size);
    border-radius: 50%;
    background: var(--surface);
    color: var(--text);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease, color 0.15s ease;
    position: relative;
}

.control-btn svg {
    width: 22px;
    height: 22px;
}

.control-btn:hover {
    background: var(--surface-hover);
}

.control-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.control-btn.off {
    background: var(--danger);
    color: #fff;
}

.control-btn.off:hover {
    background: var(--fbsd-red-bright);
}

.control-btn.leave {
    background: var(--danger);
    color: #fff;
    width: 72px;
    border-radius: var(--radius-pill);
    font-size: 13px;
    font-weight: 500;
    gap: 6px;
}

.control-btn.leave:hover {
    background: var(--fbsd-red-bright);
}

.control-btn.leave svg {
    width: 18px;
    height: 18px;
}

.control-btn .btn-tooltip {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--surface-active);
    color: var(--text);
    font-size: 12px;
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease;
    z-index: 10;
}

.control-btn:hover .btn-tooltip {
    opacity: 1;
}

.control-btn .btn-tooltip::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: var(--surface-active);
}

/* 5.8 Connection / error overlay */
.overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.overlay.hidden {
    display: none;
}

.overlay-card {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 32px;
    max-width: 420px;
    width: 90%;
    text-align: center;
}

.overlay-card .overlay-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
    color: var(--fbsd-red-bright);
}

.overlay-card .overlay-logo {
    width: 200px;
    height: auto;
    margin: 0 auto 16px;
    display: block;
}

.overlay-card .name-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.overlay-card .name-form input {
    width: 100%;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    padding: 12px 14px;
    font-size: 15px;
    outline: none;
    transition: border-color 0.15s ease;
    text-align: center;
}

.overlay-card .name-form input:focus {
    border-color: var(--fbsd-red-bright);
}

.overlay-card .name-form input::placeholder {
    color: var(--text-faint);
}

.overlay-card h2 {
    font-size: 20px;
    font-weight: 500;
    margin-bottom: 8px;
}

.overlay-card p {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 20px;
    word-wrap: break-word;
}

.overlay-card .btn-primary {
    background: var(--fbsd-red);
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    padding: 10px 24px;
    border-radius: var(--radius-sm);
    transition: background 0.15s ease;
}

.overlay-card .btn-primary:hover {
    background: var(--fbsd-red-bright);
}

/* 5.9 Toast notifications */
.toast-container {
    position: fixed;
    top: 16px;
    right: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 200;
}

.toast {
    background: var(--surface-active);
    color: var(--text);
    font-size: 13px;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    max-width: 320px;
    animation: slide-in 0.2s ease;
}

.toast.error {
    background: var(--danger);
    color: #fff;
}

.toast.info {
    border-left: 3px solid var(--fbsd-red-bright);
}

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

/* --------------------------------------------------------------------------
   6. Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 900px) {
    .landing-hero {
        flex-direction: column;
        gap: 32px;
    }

    .landing-copy h1 {
        font-size: 30px;
    }

    .sidebar {
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        max-width: 360px;
        z-index: 50;
        box-shadow: -8px 0 24px rgba(0, 0, 0, 0.5);
    }

    .video-grid.count-2,
    .video-grid.count-3,
    .video-grid.count-4 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .video-grid.count-5,
    .video-grid.count-6,
    .video-grid.count-7,
    .video-grid.count-8,
    .video-grid.count-9 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        grid-template-rows: auto;
    }

    .video-grid.count-10,
    .video-grid.count-11,
    .video-grid.count-12,
    .video-grid.count-13,
    .video-grid.count-14,
    .video-grid.count-15,
    .video-grid.count-16 {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        grid-template-rows: auto;
    }
}

@media (max-width: 600px) {
    .landing-main {
        padding: 16px;
    }

    .landing-actions {
        padding: 20px;
    }

    .meeting-topbar .meeting-meta {
        display: none;
    }

    .control-bar {
        gap: 8px;
        padding: 10px;
    }

    .control-btn {
        width: 42px;
        height: 42px;
    }

    .control-btn.leave {
        width: 60px;
    }

    .video-grid.count-2,
    .video-grid.count-3,
    .video-grid.count-4,
    .video-grid.count-5,
    .video-grid.count-6,
    .video-grid.count-7,
    .video-grid.count-8,
    .video-grid.count-9,
    .video-grid.count-10,
    .video-grid.count-11,
    .video-grid.count-12,
    .video-grid.count-13,
    .video-grid.count-14,
    .video-grid.count-15,
    .video-grid.count-16 {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
    }
}
