﻿/* ================================================================
   GLOBAL RESET + BASE STYLES (OPTIMIZED - GOOGLE MEET STYLE)
   ================================================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    height: 100%;
    background: #202124;
    font-family: 'Google Sans', Roboto, -apple-system, BlinkMacSystemFont, 'Segoe UI', Oxygen, Ubuntu, Cantarell, sans-serif;
    color: #E8EAED;
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    touch-action: manipulation;
}

/* Generic hide/show classes - FIXED */
.global-hide {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
}

.global-show {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
}

/* Element-specific hide/show */
.hide {
    display: none !important;
    opacity: 0;
    visibility: hidden;
}

.show {
    display: flex !important;
    opacity: 1;
    visibility: visible;
}

/* Smooth scroll for WebKit */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-thumb {
    background: #5F6368;
    border-radius: 10px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-corner {
    background: transparent;
}

/* Root container - FIXED FOR iOS */
.meet-root {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: -webkit-fill-available;
    background: #202124;
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
}

/* ================================================================
   HEADER (GOOGLE MEET STYLE) - FIXED FOR JS
   ================================================================ */
.meet-header {
    height: 64px;
    min-height: 64px;
    background: #202124;
    border-bottom: 1px solid #3C4043;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 24px;
    flex-shrink: 0;
    gap: 16px;
    z-index: 100;
    position: relative;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 16px;
    font-weight: 500;
    color: #8AB4F8;
    flex-shrink: 0;
    min-width: 0;
}

    .header-left i {
        font-size: 20px;
        color: #8AB4F8;
    }

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-text {
    display: flex;
    flex-direction: column;
}

.room-code {
    font-size: 12px;
    color: #9AA0A6;
    font-weight: normal;
}

.header-center {
    display: flex;
    gap: 12px;
    flex-shrink: 0;
    flex-wrap: wrap;
    justify-content: center;
}

.view-controls,
.meeting-controls,
.ai-controls {
    display: flex;
    gap: 8px;
}

.btn-label {
    display: none;
}

.header-right {
    margin-left: auto;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 16px;
}

/* Header buttons */
.header-btn {
    width: 35px;
    height: 35px;
    min-width: 35px;
    min-height: 35px;
    background: #303134;
    border: 1px solid #5F6368;
    border-radius: 50%;
    color: #E8EAED;
    font-size: 18px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}
    .header-btn i {
        font-size: 15px;
    }

    .header-btn:hover {
        background: #3C4043;
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    }

    .header-btn:active {
        transform: translateY(0);
    }

    .header-btn.active {
        background: #5F6368;
        border-color: #8AB4F8;
        color: #8AB4F8;
    }

/* Timer */
.meeting-timer {
    font-size: 14px;
    color: #BDC1C6;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Connection status */
.connection-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #34A853;
}

    .connection-status i {
        font-size: 14px;
    }

/* ================================================================
   MAIN AREA (PERFORMANCE OPTIMIZED) - FIXED
   ================================================================ */
.meet-main {
    flex: 1 1 auto;
    overflow: hidden;
    display: grid;
    grid-template-columns: 1fr auto;
    min-height: 0;
    position: relative;
    height: calc(100vh - 144px);
}

/* Video area (left-side) */
.video-area {
    flex: 1;
    min-height: 0;
    overflow: hidden;
    position: relative;
    background: #202124;
    padding: 16px;
}

/* ================================================================
   LOCAL VIDEO (SELF VIEW) - GOOGLE MEET STYLE - FIXED
   ================================================================ */
.local-tile {
    position: absolute !important;
    bottom: 20px;
    right: 20px;
    width: 240px;
    height: 160px;
    border-radius: 12px;
    overflow: hidden;
    background: #000;
    border: 2px solid #5F6368;
    z-index: 50;
    cursor: move;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    max-width: 25%;
    max-height: 25%;
    min-width: 120px;
    min-height: 80px;
}

.video-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
}

.video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 10px;
    background: linear-gradient(to bottom, rgba(0,0,0,0.6) 0%, transparent 20%, transparent 80%, rgba(0,0,0,0.6) 100%);
    z-index: 2;
}

.video-name {
    color: white;
    font-size: 14px;
    font-weight: 500;
    text-shadow: 0 1px 2px rgba(0,0,0,0.8);
}

.video-status {
    display: flex;
    gap: 8px;
    color: white;
    font-size: 12px;
}

.local-tile.dragging {
    cursor: grabbing;
    opacity: 0.9;
}

.local-tile.zoomed {
    position: absolute !important;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 70vw;
    height: 70vh;
    max-width: 960px;
    max-height: 540px;
    min-width: 320px;
    min-height: 240px;
    cursor: default;
    z-index: 100;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.4);
}

/* Video elements */
video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    background: #000;
    transform: scaleX(1);
}

#local-video {
    transform: scaleX(-1);
}

/* Remote video styling */
.video-tile video {
    object-fit: contain;
}

/* ================================================================
   REMOTE VIDEOS GRID (GOOGLE MEET STYLE) - FIXED
   ================================================================ */
.video-grid {
    width: 100%;
    height: 100%;
    padding: 16px;
    display: grid;
    gap: 12px;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
    align-content: start;
}

/* Grid mode */
.grid-mode .video-grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    grid-auto-rows: minmax(180px, 1fr);
    grid-auto-flow: dense;
}

/* Speaker mode */
.speaker-mode .video-grid {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.speaker-mode .video-tile {
    width: 80% !important;
    height: 70% !important;
    max-width: 900px;
    max-height: 600px;
    min-width: 320px;
    min-height: 240px;
}

    .speaker-mode .video-tile.active {
        border-color: #8AB4F8;
        box-shadow: 0 0 0 3px rgba(138, 180, 248, 0.2);
    }

/* No participants message */
.no-participants {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: #9AA0A6;
    padding: 40px;
    max-width: 400px;
}

    .no-participants i {
        font-size: 48px;
        margin-bottom: 16px;
        color: #5F6368;
    }

    .no-participants h3 {
        font-size: 20px;
        margin-bottom: 8px;
        color: #E8EAED;
    }

    .no-participants p {
        margin-bottom: 24px;
        font-size: 14px;
    }

.room-link {
    background: #303134;
    border-radius: 12px;
    padding: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

    .room-link code {
        flex: 1;
        text-overflow: ellipsis;
        overflow: hidden;
        white-space: nowrap;
        color: #8AB4F8;
        font-size: 13px;
    }

.btn-copy {
    background: #4285F4;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

/* ================================================================
   REMOTE VIDEO TILE (GOOGLE MEET STYLE) - FIXED
   ================================================================ */
.video-tile {
    position: relative;
    background: #303134;
    border-radius: 12px;
    overflow: hidden;
    border: 2px solid transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    aspect-ratio: 16 / 9;
    height: 100%;
    margin: auto;
    width: 100%;
}

    .video-tile.speaking {
        border-color: #202124;
        box-shadow: initial !important;
    }

    .video-tile.active {
        border-color: #8AB4F8;
        box-shadow: 0 0 0 3px rgba(138, 180, 248, 0.2);
    }

    .video-tile.pinned {
        border-color: #FBBC05;
        box-shadow: 0 0 0 3px rgba(251, 188, 5, 0.2);
    }

    /* Name label */
    .video-tile .video-name {
        position: absolute;
        bottom: 10px;
        left: 10px;
        background: rgba(32, 33, 36, 0.8);
        padding: 6px 12px;
        border-radius: 8px;
        font-size: 14px;
        color: #E8EAED;
        max-width: calc(100% - 20px);
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        backdrop-filter: blur(4px);
        z-index: 2;
        font-weight: 500;
    }

/* Audio indicator */
.audio-level-bar {
    position: absolute;
    bottom: 10px;
    right: 10px;
    width: 40px;
    height: 4px;
    background: rgba(232, 234, 237, 0.2);
    border-radius: 2px;
    overflow: hidden;
    z-index: 2;
}

.audio-level-fill {
    height: 100%;
    width: 0%;
    background: #34A853;
    border-radius: 2px;
    transition: width 0.1s ease;
}

/* Fade out animation */
.fade-out {
    animation: fadeOut 0.3s ease forwards;
}

@keyframes fadeOut {
    from {
        opacity: 1;
        transform: scale(1);
    }

    to {
        opacity: 0;
        transform: scale(0.9);
    }
}

/* ================================================================
   SIDEBAR (CHAT / PARTICIPANTS / AI) - GOOGLE MEET STYLE - FIXED
   ================================================================ */
.sidebar {
    width: 360px;
    height: 100%;
    background: #202124;
    border-left: 1px solid #3C4043;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    z-index: 90;
    transform: translateX(0);
    opacity: 1;
    visibility: visible;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease, visibility 0.3s ease;
}

    .sidebar.hide {
        transform: translateX(100%);
        opacity: 0;
        visibility: hidden;
    }

    .sidebar.show {
        transform: translateX(0);
        opacity: 1;
        visibility: visible;
    }

/* Tabs */
.sidebar-tabs {
    display: flex;
    border-bottom: 1px solid #3C4043;
    background: #202124;
    flex-shrink: 0;
}

.tab {
    flex: 1;
    padding: 16px;
    background: transparent;
    border: none;
    color: #9AA0A6;
    cursor: pointer;
    text-align: center;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
    white-space: nowrap;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

    .tab:hover {
        background: rgba(255, 255, 255, 0.04);
        color: #E8EAED;
    }

    .tab.active {
        color: #8AB4F8;
        background: rgba(138, 180, 248, 0.05);
    }

        .tab.active::after {
            content: '';
            position: absolute;
            bottom: 0;
            left: 0;
            right: 0;
            height: 3px;
            background: #8AB4F8;
            border-radius: 3px 3px 0 0;
        }

.unread-badge {
    background: #EA4335;
    color: white;
    font-size: 11px;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
    font-weight: 600;
}

/* Content area */
.sidebar-content {
    flex: 1;
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
}

/* Panel header */
.panel-header {
    padding: 16px;
    border-bottom: 1px solid #3C4043;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

    .panel-header h4 {
        margin: 0;
        font-size: 16px;
        color: #E8EAED;
        font-weight: 500;
    }

.count-badge {
    background: #5F6368;
    color: #E8EAED;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.btn-clear {
    background: transparent;
    border: none;
    color: #9AA0A6;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    font-size: 14px;
}

    .btn-clear:hover {
        background: #3C4043;
        color: #E8EAED;
    }

/* Panel switching */
.panel {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: none;
    flex-direction: column;
    overflow: hidden;
    padding: 0;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

    .panel.show {
        display: flex !important;
        opacity: 1;
        visibility: visible;
        position: relative;
    }

    .panel.hide {
        display: none !important;
        opacity: 0;
        visibility: hidden;
    }

/* ================================================================
   CHAT PANEL (GOOGLE MEET STYLE) - FIXED
   ================================================================ */
.chat-history {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 0;
}

.chat-message {
    background: #303134;
    border-radius: 12px;
    padding: 12px 16px;
    max-width: 85%;
    width: fit-content;
    animation: messageAppear 0.2s ease;
}

@keyframes messageAppear {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chat-message.mine {
    background: #1A73E8;
    margin-left: auto;
}

.chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

    .chat-header strong {
        font-weight: 600;
        font-size: 13px;
        color: #8AB4F8;
    }

.chat-message.mine .chat-header strong {
    color: white;
}

.chat-time {
    font-size: 11px;
    color: #9AA0A6;
    opacity: 0.8;
}

.chat-message.mine .chat-time {
    color: rgba(255, 255, 255, 0.8);
}

.chat-body {
    font-size: 14px;
    line-height: 1.5;
    color: #E8EAED;
    word-break: break-word;
}

.chat-message.mine .chat-body {
    color: white;
}

.chat-form {
    padding: 16px;
    border-top: 1px solid #3C4043;
    display: flex;
    align-items: flex-end;
    gap: 12px;
    background: #202124;
    flex-shrink: 0;
}

#chat-input {
    flex: 1;
    min-height: 70px;
    max-height: 120px;
    padding: 10px 14px;
    border-radius: 20px;
    background: #303134;
    color: #E8EAED;
    border: 1px solid #5F6368;
    resize: none;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.5;
    transition: all 0.2s ease;
}

    #chat-input:focus {
        outline: none;
        border-color: #8AB4F8;
        box-shadow: 0 0 0 2px rgba(138, 180, 248, 0.1);
    }

#chat-send {
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    background: #1A73E8;
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

    #chat-send:hover:not(:disabled) {
        background: #1666D6;
        transform: translateY(-2px);
    }

    #chat-send:active:not(:disabled) {
        transform: translateY(0);
    }

    #chat-send:disabled {
        background: #5F6368;
        cursor: not-allowed;
        opacity: 0.6;
    }

/* ================================================================
   PARTICIPANTS PANEL (GOOGLE MEET STYLE) - FIXED
   ================================================================ */
.participants-list-container {
    flex: 1;
    overflow-y: auto;
}

.participant-list {
    list-style: none;
    padding: 8px;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.participant-item {
    display: flex;
    align-items: center;
    padding: 12px;
    border-radius: 8px;
    background: transparent;
    transition: all 0.2s ease;
    position: relative;
}

    .participant-item:hover {
        background: #303134;
    }

    .participant-item.self {
        background: rgba(26, 115, 232, 0.1);
    }

    .participant-item.speaking {
        background: rgba(52, 168, 83, 0.1);
    }

.participant-avatar {
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4285F4, #34A853);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 600;
    margin-right: 12px;
    flex-shrink: 0;
}

.participant-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.p-name {
    font-size: 14px;
    font-weight: 500;
    color: #E8EAED;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.p-meta {
    font-size: 12px;
    color: #9AA0A6;
}

.p-icons {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

    .p-icons i {
        color: #34A853;
    }

        .p-icons i.fa-microphone-slash,
        .p-icons i.fa-video-slash {
            color: #EA4335;
        }

/* ================================================================
   WAITING ROOM (GOOGLE MEET STYLE) - FIXED
   ================================================================ */
.waiting-room-host {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #3C4043;
    flex-shrink: 0;
}

.waiting-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding: 0 16px;
}

.waiting-list-container {
    max-height: 200px;
    overflow-y: auto;
    padding: 0 8px;
}

.waiting-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.waiting-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px;
    background: #303134;
    border: 1px solid #5F6368;
    border-radius: 8px;
    transition: all 0.2s ease;
}

    .waiting-item:hover {
        background: #3C4043;
        border-color: #8AB4F8;
    }

.waiting-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

    .waiting-actions button {
        padding: 6px 16px;
        border-radius: 20px;
        font-size: 13px;
        font-weight: 500;
        cursor: pointer;
        transition: all 0.2s ease;
        border: none;
        white-space: nowrap;
    }

    .waiting-actions .admit {
        background: #34A853;
        color: white;
    }

        .waiting-actions .admit:hover {
            background: #2E8B47;
            transform: translateY(-1px);
        }

    .waiting-actions .reject {
        background: transparent;
        border: 1px solid #EA4335;
        color: #EA4335;
    }

        .waiting-actions .reject:hover {
            background: rgba(234, 67, 53, 0.1);
            transform: translateY(-1px);
        }

/* ================================================================
   AI PANEL (GOOGLE MEET STYLE) - FIXED
   ================================================================ */
.ai-features {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ai-feature {
    background: #303134;
    border-radius: 12px;
    padding: 16px;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

    .ai-feature:hover {
        border-color: #5F6368;
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    }

.feature-label {
    display: block;
    cursor: pointer;
}

.feature-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

    .feature-content i {
        font-size: 20px;
        color: #8AB4F8;
        width: 24px;
    }

.feature-text {
    flex: 1;
}

    .feature-text strong {
        display: block;
        font-size: 14px;
        color: #E8EAED;
        margin-bottom: 2px;
    }

    .feature-text small {
        font-size: 12px;
        color: #9AA0A6;
    }

.feature-toggle {
    display: none;
}

/* ================================================================
   SETTINGS PANEL (GOOGLE MEET STYLE) - ADDED
   ================================================================ */
.settings-list {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.setting-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

    .setting-item label {
        font-size: 14px;
        color: #E8EAED;
        font-weight: 500;
    }

.settings-select {
    padding: 10px 12px;
    background: #303134;
    border: 1px solid #5F6368;
    border-radius: 8px;
    color: #E8EAED;
    font-size: 14px;
    width: 100%;
    cursor: pointer;
}

    .settings-select:focus {
        outline: none;
        border-color: #8AB4F8;
    }

.volume-slider {
    width: 100%;
    height: 6px;
    -webkit-appearance: none;
    background: #5F6368;
    border-radius: 3px;
    outline: none;
}

    .volume-slider::-webkit-slider-thumb {
        -webkit-appearance: none;
        width: 18px;
        height: 18px;
        border-radius: 50%;
        background: #8AB4F8;
        cursor: pointer;
    }

/* ================================================================
   FOOTER CONTROLS (GOOGLE MEET STYLE) - FIXED
   ================================================================ */
.meet-footer {
    height: 80px;
    min-height: 80px;
    background: #202124;
    border-top: 1px solid #3C4043;
    flex-shrink: 0;
    padding: 0 24px;
    z-index: 100;
}

.footer-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
    height: 100%;
}

.control-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.control-btn {
    width: 56px;
    height: 56px;
    min-width: 56px;
    min-height: 56px;
    background: #303134;
    border: 1px solid #5F6368;
    border-radius: 50%;
    font-size: 20px;
    color: #E8EAED;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

    .control-btn:hover {
        background: #3C4043;
        transform: scale(1.1);
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    }

    .control-btn:active {
        transform: scale(0.95);
    }

    .control-btn.active {
        background: #5F6368;
        border-color: #8AB4F8;
    }

    .control-btn.off {
        background: #5F6368;
        color: #9AA0A6;
    }

    .control-btn.muted {
        background: #EA4335;
        border-color: #EA4335;
        color: white;
    }

    .control-btn.screen-sharing {
        background: #FBBC05;
        border-color: #FBBC05;
        color: #202124;
    }

    .control-btn.leave-btn {
        background: #EA4335;
        border-color: #EA4335;
        color: white;
    }

        .control-btn.leave-btn:hover {
            background: #D93025;
        }

.control-label {
    font-size: 11px;
    color: #BDC1C6;
    margin-top: 4px;
    text-align: center;
    white-space: nowrap;
}

.control-status {
    font-size: 11px;
    color: #34A853;
    font-weight: 500;
}

.control-btn.off + .control-status {
    color: #EA4335;
}

/* Unread badge */
#btn-sidebar-toggle {
    position: relative;
}

#sidebar-unread-footer {
    position: absolute;
    top: -6px;
    right: -6px;
}

/* ================================================================
   WAITING OVERLAY (Guest only) - FIXED
   ================================================================ */
.waiting-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(32, 33, 36, 0.98);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 24px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

    .waiting-overlay.show {
        opacity: 1;
        visibility: visible;
    }

    .waiting-overlay.hide {
        opacity: 0;
        visibility: hidden;
    }

.waiting-content {
    background: #202124;
    padding: 40px;
    border-radius: 20px;
    border: 1px solid #5F6368;
    text-align: center;
    max-width: 400px;
    width: 100%;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.4);
    animation: scaleIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

    .waiting-content h2 {
        font-size: 24px;
        color: #E8EAED;
        margin-bottom: 12px;
        font-weight: 500;
    }

    .waiting-content p {
        font-size: 16px;
        color: #9AA0A6;
        line-height: 1.5;
        margin-bottom: 24px;
    }

.waiting-spinner {
    width: 48px;
    height: 48px;
    border: 3px solid #5F6368;
    border-top-color: #8AB4F8;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 24px;
}

.waiting-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
}

.btn-leave {
    padding: 10px 20px;
    background: #EA4335;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background 0.2s;
}

    .btn-leave:hover {
        background: #D93025;
    }

/* ================================================================
   ADMIT POPUP (Dynamic JavaScript Popup) - ADDED
   ================================================================ */
.admit-popup {
    position: fixed;
    top: 24px;
    right: 24px;
    width: 360px;
    background: #202124;
    border: 1px solid #3C4043;
    border-radius: 16px;
    padding: 20px;
    z-index: 10000;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    animation: slideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

    .admit-popup.hide {
        animation: slideOut 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    }

@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;
    }
}

/* ================================================================
   HAND RAISE POPUP (GOOGLE MEET STYLE) - FIXED
   ================================================================ */
.hand-popup {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 320px;
    background: #202124;
    border: 1px solid #3C4043;
    border-radius: 16px;
    padding: 20px;
    z-index: 10000;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    animation: slideUpIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

    .hand-popup.hide {
        display: none !important;
        opacity: 0;
        visibility: hidden;
    }

/* ================================================================
   EMOJI REACTIONS (GOOGLE MEET STYLE) - FIXED
   ================================================================ */
.reaction-menu {
    position: absolute;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    background: #303134;
    padding: 12px;
    border-radius: 12px;
    display: flex;
    gap: 12px;
    z-index: 2000;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

    .reaction-menu.hide {
        display: none !important;
        opacity: 0;
        visibility: hidden;
    }

    .reaction-menu button {
        width: 40px;
        height: 40px;
        font-size: 20px;
        background: transparent;
        border: none;
        cursor: pointer;
        border-radius: 8px;
        transition: all 0.2s ease;
        display: flex;
        align-items: center;
        justify-content: center;
    }

        .reaction-menu button:hover {
            background: rgba(255, 255, 255, 0.1);
            transform: scale(1.2);
        }

.reaction-layer {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: 10000;
}

.float-emoji {
    position: absolute;
    bottom: 100px;
    animation: floatUp 2s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    font-size: 32px;
    pointer-events: none;
    z-index: 10001;
}

/* ================================================================
   CAPTIONS (GOOGLE MEET STYLE) - FIXED
   ================================================================ */
.caption-bar {
    position: absolute;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    min-width: 300px;
    max-width: 80%;
    background: rgba(32, 33, 36, 0.95);
    padding: 16px 20px;
    border-radius: 12px;
    border: 1px solid rgba(232, 234, 237, 0.1);
    color: white;
    backdrop-filter: blur(10px);
    z-index: 90;
    display: flex;
    flex-direction: column;
}

    .caption-bar.hide {
        display: none !important;
        opacity: 0;
        visibility: hidden;
    }

.caption-container {
    display: flex;
    flex-direction: column;
}

.caption-user {
    font-size: 12px;
    font-weight: 500;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
}

    .caption-user.host {
        color: #8AB4F8;
    }

    .caption-user.guest {
        color: #F28B82;
    }

    .caption-user::before {
        content: "●";
        font-size: 8px;
    }

.caption-text {
    font-size: 16px;
    font-weight: 400;
    line-height: 1.4;
    color: #E8EAED;
}

/* ================================================================
   TOAST NOTIFICATIONS - FIXED
   ================================================================ */
.toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 20000;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
}

.toast {
    background: #202124;
    border: 1px solid #3C4043;
    border-radius: 12px;
    padding: 16px 20px;
    color: #E8EAED;
    font-size: 14px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    animation: toastSlideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    max-width: 320px;
    backdrop-filter: blur(10px);
    display: none;
}

    .toast.show {
        display: block !important;
        opacity: 1;
        visibility: visible;
    }

.toast-info {
    border-left: 4px solid #4285F4;
}

.toast-success {
    border-left: 4px solid #34A853;
}

.toast-warning {
    border-left: 4px solid #FBBC05;
}

.toast-error {
    border-left: 4px solid #EA4335;
}

/* ================================================================
   show side toggle - ADDED
   ================================================================ */
.sidebar {
   
    top: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-width: 100%;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease, visibility 0.3s ease;
    border-left: none;
    opacity: 0;
    visibility: hidden;
}
.sidebar.show {
    transform: translateX(0);
    opacity: 1;
    visibility: visible;
}

/* ================================================================
   SCREEN SHARE INDICATOR - ADDED
   ================================================================ */
.screen-share-indicator {
    position: fixed;
    top: 80px;
    right: 24px;
    background: rgba(251, 188, 5, 0.9);
    color: #202124;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 90;
    backdrop-filter: blur(4px);
    animation: slideInRight 0.3s ease;
}

    .screen-share-indicator.hide {
        display: none !important;
        opacity: 0;
        visibility: hidden;
    }

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ================================================================
   RESPONSIVE DESIGN - UPDATED
   ================================================================ */

/* Tablet (768px and below) */
@media (max-width: 768px) {
    .meet-header {
        height: 56px;
        padding: 0 16px;
        gap: 12px;
    }

    .header-center {
        flex-wrap: wrap;
        gap: 8px;
    }

    .header-btn {
        width: 40px;
        height: 40px;
        min-width: 40px;
        min-height: 40px;
        font-size: 16px;
    }

    .meet-main {
        height: calc(100vh - 136px);
    }

    .local-tile {
        width: 160px;
        height: 120px;
        bottom: 16px;
        right: 16px;
        min-width: 100px;
        min-height: 75px;
    }

    .video-grid {
        padding: 12px;
        gap: 8px;
    }

    .grid-mode .video-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        grid-auto-rows: minmax(150px, 1fr);
    }

    .sidebar {
        width: 300px;
    }

    .meet-footer {
        height: 72px;
        min-height: 72px;
        padding: 0 16px;
    }

    .footer-controls {
        gap: 16px;
    }

    .control-btn {
        width: 48px;
        height: 48px;
        min-width: 48px;
        min-height: 48px;
        font-size: 18px;
    }

    .admit-popup {
        width: calc(100% - 40px);
        right: 10px;
        left: 10px;
    }

    .caption-bar {
        min-width: 240px;
        padding: 12px 16px;
        bottom: 80px;
    }

    .caption-text {
        font-size: 14px;
    }
}

/* Mobile (480px and below) */
@media (max-width: 480px) {
    .meet-header {
        height: 52px;
        padding: 0 12px;
    }

    .header-left .logo-text {
        display: none;
    }

    .header-center {
        display: none;
    }

    .header-right {
        margin-left: auto;
    }

    .meet-main {
        grid-template-columns: 1fr;
        height: calc(100vh - 124px);
    }

    .sidebar {
        position: absolute;
        top: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        max-width: 100%;
        transform: translateX(100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease, visibility 0.3s ease;
        border-left: none;
        opacity: 0;
        visibility: hidden;
    }

        .sidebar.show {
            transform: translateX(0);
            opacity: 1;
            visibility: visible;
        }

    .local-tile {
        width: 120px;
        height: 90px;
        bottom: 12px;
        right: 12px;
        min-width: 80px;
        min-height: 60px;
    }

    .video-grid {
        grid-template-columns: 1fr !important;
        grid-auto-rows: minmax(200px, 1fr);
        padding: 8px;
        gap: 6px;
    }

    .speaker-mode .video-tile {
        width: 95% !important;
        height: 60% !important;
        min-width: 280px;
        min-height: 200px;
    }

    .meet-footer {
        height: 72px;
        padding: 0 12px;
    }

    .footer-controls {
        gap: 12px;
        justify-content: space-between;
    }

    .control-btn {
        width: 44px;
        height: 44px;
        min-width: 44px;
        min-height: 44px;
        font-size: 16px;
    }

    .control-label {
        display: none;
    }

    .admit-popup {
        width: calc(100% - 32px);
        right: 16px;
        left: 16px;
    }
}

/* Small Mobile (360px and below) */
@media (max-width: 360px) {
    .meet-header {
        height: 48px;
        padding: 0 8px;
    }

    .header-btn {
        width: 36px;
        height: 36px;
        min-width: 36px;
        min-height: 36px;
        font-size: 14px;
    }

    .meet-main {
        height: calc(100vh - 120px);
    }

    .control-btn {
        width: 40px;
        height: 40px;
        min-width: 40px;
        min-height: 40px;
        font-size: 14px;
    }

    .local-tile {
        width: 100px;
        height: 75px;
        bottom: 10px;
        right: 10px;
    }

    .video-tile {
        border-radius: 8px;
    }
}

/* Landscape mobile */
@media (max-height: 500px) and (orientation: landscape) {
    .meet-header {
        height: 62px;
        min-height: 48px;
    }

    .meet-main {
        height: calc(100vh - 128px);
    }

    .meet-footer {
        height: 80px;
        min-height: 80px;
    }

    .local-tile {
        width: 100px;
        height: 75px;
    }

    .video-grid {
        padding: 8px;
        gap: 6px;
    }

    .grid-mode .video-grid {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
        grid-auto-rows: minmax(120px, 1fr);
    }
}

/* iOS Safe Area Support */
@supports (padding: env(safe-area-inset-bottom)) {
    .meet-footer {
        padding-bottom: calc(8px + env(safe-area-inset-bottom));
    }

    .meet-header {
        padding-top: env(safe-area-inset-top);
    }
}

/* Reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* High DPI screens */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    video {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* Accessibility improvements */
@media (prefers-contrast: high) {
    .video-tile.speaking {
        border-width: 3px;
    }

    .tab.active::after {
        height: 4px;
    }

    .control-btn,
    .header-btn {
        border-width: 2px;
    }
}

/* Additional animations */
@keyframes slideUpIn {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes toastSlideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes scaleIn {
    from {
        transform: translate(-50%, -50%) scale(0.9);
        opacity: 0;
    }

    to {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes floatUp {
    0% {
        transform: translateY(0) scale(1);
        opacity: 1;
    }

    100% {
        transform: translateY(-100px) scale(0.5);
        opacity: 0;
    }
}


#tab-ai {
    display: none !important;
}

.footer-controls .control-label {
    display: none !important;
}

.footer-controls .control-group .control-status {
    display: none !important;
}

@media(max-width: 1024px){

    .mobile_none {
        display: none !important;
    }
}

.remote-video video {
    filter: brightness(1.25) contrast(1.15) saturate(1.1);
}
/* Add to your main CSS file */
#btn-background {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
}