/*
 * meet.thatsk.org: dark "glass" layer for MiroTalk P2P.
 * Injected by nginx after MiroTalk's own CSS (see /etc/nginx/snippets/mirotalk-theme.conf).
 * Colours come from the 'dark' theme override in /etc/mirotalk/config.js; this file adds material, shape and type.
 * System fonts only (no web fonts, nothing loaded from elsewhere).
 */
:root {
    --glass-bg: rgba(24, 26, 34, 0.52);
    --glass-bg-strong: rgba(18, 20, 27, 0.80);
    --glass-border: rgba(255, 255, 255, 0.12);
    --glass-edge: inset 0 1px 0 rgba(255, 255, 255, 0.10), inset 0 -1px 0 rgba(0, 0, 0, 0.25);
    --glass-shadow: 0 24px 70px rgba(0, 0, 0, 0.50), 0 2px 8px rgba(0, 0, 0, 0.25);
    --glass-blur: blur(28px) saturate(170%);
    --accent: #0a84ff;
    --danger: #ff453a;
    --ok: #30d158;
    --text: #f5f5f7;
    --text-2: rgba(235, 235, 245, 0.64);
    --r-xl: 28px;
    --r-l: 22px;
    --r-m: 14px;
    --font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'SF Pro Display', 'Segoe UI Variable Text',
        'Segoe UI', Inter, Roboto, 'Helvetica Neue', Arial, sans-serif;
    --ds-font-sans: var(--font-family);
}

html,
body,
input,
select,
textarea,
.swal2-popup,
button:not([class*='fa-']),
p,
span:not([class*='fa-']),
h1,
h2,
h3,
h4,
label {
    font-family: var(--font-family) !important;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    letter-spacing: -0.01em;
}

body {
    color: var(--text);
    background-color: #06070b;
}

/* ---------- Shared glass material ---------- */
#bottomButtons,
#mySettings,
#msgerDraggable,
#msger,
#msgerCP,
#captionDraggable,
#emojiPickerContainer,
#bottomButtons .dropdown-menu,
#participantViewMenu,
#exitMenu,
.dropdown-content,
.swal2-popup,
.tippy-box,
.login-card,
.hero-form,
#qrRoomPopupContainer,
#initUser {
    background: var(--glass-bg) !important;
    -webkit-backdrop-filter: var(--glass-blur);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border) !important;
    box-shadow: var(--glass-shadow), var(--glass-edge) !important;
    color: var(--text);
}

/* Large panels: a little more opaque for readability */
#mySettings,
#msgerDraggable,
#msger,
#msgerCP,
#captionDraggable,
.swal2-popup,
#initUser {
    background: var(--glass-bg-strong) !important;
    border-radius: var(--r-l) !important;
}

/* ---------- Floating toolbar: a single glass capsule ---------- */
#bottomButtons {
    border-radius: 999px !important;
    padding: 8px 10px !important;
    gap: 6px !important;
}

#bottomButtons button {
    width: 46px;
    height: 46px;
    padding: 0;
    font-size: 1.1rem;
    border-radius: 999px !important;
    background: rgba(255, 255, 255, 0.07) !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
    transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

#bottomButtons button:hover {
    background: rgba(255, 255, 255, 0.16) !important;
    transform: translateY(-1px) scale(1.03);
}

#bottomButtons button:active {
    transform: scale(0.96);
}

/* split buttons (main action + small device arrow) read as one pill */
#bottomButtons .split-btn {
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.05);
    gap: 0;
}
#bottomButtons .split-btn > button:first-child {
    border-radius: 999px 0 0 999px !important;
}
#bottomButtons .split-btn > button:first-child {
    width: 44px;
    padding-left: 4px;
}
#bottomButtons .split-btn .device-dropdown-toggle {
    width: 24px !important;
    min-width: 24px;
    border-radius: 0 999px 999px 0 !important;
    border-left: 1px solid rgba(255, 255, 255, 0.08) !important;
    font-size: 0.7rem !important;
    background: rgba(255, 255, 255, 0.04) !important;
    box-shadow: none !important;
}

/* leave = the only red element */
#bottomButtons #leaveRoomBtn {
    background: var(--danger) !important;
    color: #fff !important;
    box-shadow: 0 6px 18px rgba(255, 69, 58, 0.35);
}
#bottomButtons #leaveRoomBtn:hover {
    background: #ff5b52 !important;
}

/* active toggles (chat / participants open) */
#bottomButtons #chatRoomBtn.is-active,
#bottomButtons #participantsBtn.is-active {
    background: rgba(10, 132, 255, 0.28) !important;
    box-shadow: inset 0 0 0 1px rgba(10, 132, 255, 0.65) !important;
    color: #fff !important;
}

/* ---------- Video tiles ---------- */
.Camera,
.Screen {
    border-radius: var(--r-l) !important;
    border: 1px solid rgba(255, 255, 255, 0.10) !important;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45) !important;
    background: #0b0d12 !important;
}
.Camera video,
.Screen video {
    border-radius: var(--r-l);
}

/* ---------- Dropdowns, menus, tooltips ---------- */
#bottomButtons .dropdown-menu,
#participantViewMenu,
#exitMenu,
.dropdown-content {
    border-radius: var(--r-m) !important;
    padding: 6px !important;
}
#exitMenu button,
.dropdown-content button,
#settingsExtraDropdown button {
    border-radius: 10px !important;
}
.tippy-box {
    border-radius: 10px !important;
    color: var(--text) !important;
    font-size: 0.8rem !important;
}
.tippy-arrow {
    color: rgba(24, 26, 34, 0.9) !important;
}

/* ---------- Settings panel ---------- */
#mySettings .tab button,
#mySettings .tablinks {
    border-radius: 10px !important;
}
#mySettings select,
#mySettings input[type='text'],
#mySettings input[type='email'],
#mySettings input[type='password'],
.swal2-input,
.swal2-select {
    background: rgba(255, 255, 255, 0.06) !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    border-radius: 12px !important;
    color: var(--text) !important;
    box-shadow: none !important;
}
#mySettings select:focus,
#mySettings input:focus,
.swal2-input:focus {
    outline: none !important;
    border-color: rgba(10, 132, 255, 0.8) !important;
    box-shadow: 0 0 0 4px rgba(10, 132, 255, 0.22) !important;
}

/* ---------- Chat ---------- */
#msgerDraggable .msger-inputarea,
#msger .msger-inputarea {
    background: rgba(255, 255, 255, 0.04) !important;
    border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
}
#msgerDraggable textarea,
#msger textarea {
    background: rgba(255, 255, 255, 0.06) !important;
    border: 1px solid rgba(255, 255, 255, 0.10) !important;
    border-radius: 16px !important;
    color: var(--text) !important;
}
.msg-bubble {
    border-radius: 18px !important;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

/* ---------- Dialogs (SweetAlert2) ---------- */
.swal2-container.swal2-backdrop-show {
    background: rgba(3, 4, 8, 0.55) !important;
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
}
.swal2-title,
.swal2-html-container {
    color: var(--text) !important;
}
.swal2-styled.swal2-confirm {
    background: var(--accent) !important;
    border-radius: 999px !important;
    box-shadow: 0 8px 24px rgba(10, 132, 255, 0.35) !important;
}
.swal2-styled.swal2-deny,
.swal2-styled.swal2-cancel {
    background: rgba(255, 255, 255, 0.10) !important;
    color: var(--text) !important;
    border-radius: 999px !important;
}

/* ---------- Login / new-call pages ---------- */
.login-card {
    border-radius: var(--r-xl) !important;
}
.login-card .form-input,
.hero-form input {
    background: rgba(255, 255, 255, 0.06) !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    border-radius: 14px !important;
    color: var(--text) !important;
}
.login-btn,
.button-primary,
#joinRoomButton {
    background: var(--accent) !important;
    border: none !important;
    border-radius: 999px !important;
    box-shadow: 0 10px 30px rgba(10, 132, 255, 0.35) !important;
    animation: none !important;
}

/* quieter chrome */
::selection {
    background: rgba(10, 132, 255, 0.45);
}
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.14);
    border-radius: 999px;
    border: 2px solid transparent;
    background-clip: padding-box;
}
::-webkit-scrollbar-track {
    background: transparent;
}

@media (prefers-reduced-transparency: reduce) {
    :root {
        --glass-bg: rgba(24, 26, 34, 0.96);
        --glass-bg-strong: rgba(18, 20, 27, 0.98);
    }
}

/* ---------- v2 additions ---------- */

/* Per-video controls and name tags as small glass pills */
.navbar {
    background: rgba(20, 22, 30, 0.45) !important;
    -webkit-backdrop-filter: blur(18px) saturate(160%);
    backdrop-filter: blur(18px) saturate(160%);
    border: 1px solid rgba(255, 255, 255, 0.10) !important;
    border-radius: 999px !important;
    margin: 10px !important;
    width: auto !important;
    left: auto !important;
    right: 0 !important;
    padding: 4px 6px !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}
.navbar button {
    border-radius: 999px !important;
    background: transparent !important;
}
.navbar button:hover {
    background: rgba(255, 255, 255, 0.14) !important;
}
.videoPeerName {
    background: rgba(20, 22, 30, 0.50) !important;
    -webkit-backdrop-filter: blur(16px) saturate(160%);
    backdrop-filter: blur(16px) saturate(160%);
    border: 1px solid rgba(255, 255, 255, 0.10) !important;
    border-radius: 999px !important;
    padding: 4px 12px !important;
    color: var(--text) !important;
}

/* Settings: borderless tabs, accent on the active one */
#mySettings .tablinks {
    border: none !important;
    background: transparent !important;
    border-radius: 12px !important;
    color: var(--text-2) !important;
    transition: background 0.15s ease, color 0.15s ease;
}
#mySettings .tablinks:hover {
    background: rgba(255, 255, 255, 0.06) !important;
    color: var(--text) !important;
}
#mySettings .tablinks.active {
    background: rgba(10, 132, 255, 0.22) !important;
    color: #fff !important;
    box-shadow: inset 0 0 0 1px rgba(10, 132, 255, 0.45);
}
#mySettings .tablinks .tabButtonText {
    color: inherit !important;
}

/* iOS-style switches (label text hidden, grey off / green on) */
.switch .slider,
.toggle-switch .slider {
    border-radius: 999px !important;
}

/* Login page: centred card on the theme background, no wave artwork */
.illustration-section-01::after {
    display: none !important;
}
.body-wrap,
.site-content,
.hero {
    background: transparent !important;
}
body.has-animations,
body.is-loaded {
    background: radial-gradient(120% 90% at 0% 0%, rgba(40, 60, 140, 0.35) 0%, rgba(40, 60, 140, 0) 55%),
        radial-gradient(90% 80% at 100% 100%, rgba(110, 40, 150, 0.28) 0%, rgba(110, 40, 150, 0) 55%), #06070b !important;
}
#loginForm {
    margin-left: auto !important;
    margin-right: auto !important;
}
.hero .split-wrap .split-item {
    justify-content: center !important;
}
.hero-content.split-item-content {
    width: 100% !important;
    max-width: 440px !important;
    margin: 0 auto !important;
    float: none !important;
}

/* Footer: keep copyright, About, Privacy and author contact; drop social/sponsor/star and the disabled API link */
.footer-top,
.footer-social,
a[href*='/api/v1/docs'] {
    display: none !important;
}
.site-footer {
    opacity: 0.6;
}

/* Hidden: features that are disabled here or would send data to third parties.
   (Also hidden via config.buttons; this keeps them hidden even if that config fails to load.) */
#captionBtn,
#captionDraggable,
#captionEveryoneBtn,
#msgerSpeechMsg,
#msgerSpeechMsgDiv,
#speechRecognitionStart,
#speechRecognitionStop,
#msgerVideoUrlBtn,
#tabVideoShareBtn,
#activeRoomsBtn,
#noiseSuppressionBtn,
#labelNoiseSuppression,
[id$='_pSendVideoUrl'],
[id$='_pRequestGeo'],
[id$='_geoLocation'] {
    display: none !important;
}

/* ---------- v3 refinements ---------- */

/* Ambient glow on every page; MiroTalk's --body-bg stays flat for inner cards.
   !important beats the inline background that MiroTalk's theme code sets on <body>. */
body {
    background: radial-gradient(120% 90% at 0% 0%, rgba(40, 60, 140, 0.35) 0%, rgba(40, 60, 140, 0) 55%),
        radial-gradient(90% 80% at 100% 100%, rgba(110, 40, 150, 0.28) 0%, rgba(110, 40, 150, 0) 55%), #06070b !important;
    background-attachment: fixed !important;
}
.site-footer,
.site-footer-inner,
.footer-bottom {
    background: transparent !important;
}

/* Split buttons: one continuous pill, transparent halves */
#bottomButtons .split-btn {
    height: 46px;
    align-items: center !important;
    background: rgba(255, 255, 255, 0.07) !important;
    border-radius: 999px !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
    overflow: hidden;
}
#bottomButtons .split-btn > button,
#bottomButtons .split-btn .device-dropdown-toggle {
    height: 46px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    transform: none !important;
}
#bottomButtons .split-btn > button:first-child {
    width: 42px !important;
    padding-left: 4px !important;
}
#bottomButtons .split-btn:hover {
    background: rgba(255, 255, 255, 0.14) !important;
}
#bottomButtons #participantViewButton {
    background: rgba(255, 255, 255, 0.07) !important;
    border: none !important;
}

/* Panel header buttons as small glass circles */
#msgerHeader button,
#msgerCPHeader button,
#mySettingsHeader button,
#captionHeader button,
.panel-close-button {
    width: 36px !important;
    height: 36px !important;
    border-radius: 999px !important;
    background: rgba(255, 255, 255, 0.06) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    box-shadow: none !important;
    color: var(--text) !important;
}
#msgerHeader button:hover,
#msgerCPHeader button:hover,
#mySettingsHeader button:hover,
.panel-close-button:hover {
    background: rgba(255, 255, 255, 0.14) !important;
}

/* The settings section label left empty by the hidden "Share media" tab */
.settings-nav-label:has(+ #tabVideoShareBtn) {
    display: none !important;
}

/* Dropdown wrappers around the arrow buttons stay invisible; only the menus are glass */
#bottomButtons #audioDropdown,
#bottomButtons #videoDropdown,
#bottomButtons #participantsActionsDropdown,
#bottomButtons #participantViewDropdown,
#bottomButtons #settingsExtraDropdown,
#bottomButtons #exitDropdown {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
}

/* Guest waiting-room card: same material as the login card */
.waiting-card,
.waiting-room-card,
.wr-card {
    background: var(--glass-bg) !important;
    -webkit-backdrop-filter: var(--glass-blur);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border) !important;
    border-radius: var(--r-xl) !important;
    box-shadow: var(--glass-shadow), var(--glass-edge) !important;
}

/* ---------- Phones: compact, centred capsule that scrolls sideways if it must ---------- */
@media (max-width: 640px) {
    #bottomButtons {
        left: 50% !important;
        right: auto !important;
        transform: translateX(-50%) !important;
        box-sizing: border-box !important;
        width: max-content !important;
        max-width: calc(100vw - 16px) !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        flex-wrap: nowrap !important;
        justify-content: flex-start !important;
        padding: 6px 8px !important;
        gap: 4px !important;
        border-radius: 26px !important;
        margin-bottom: max(8px, env(safe-area-inset-bottom)) !important;
        scrollbar-width: none;
    }
    #bottomButtons::-webkit-scrollbar {
        display: none;
    }
    #bottomButtons > *,
    #bottomButtons .split-btn {
        flex: 0 0 auto !important;
    }
    #bottomButtons button {
        width: 40px !important;
        height: 40px !important;
        font-size: 1rem !important;
    }
    #bottomButtons .split-btn,
    #bottomButtons .split-btn > button,
    #bottomButtons .split-btn .device-dropdown-toggle {
        height: 40px !important;
    }
    #bottomButtons .split-btn > button:first-child {
        width: 36px !important;
    }
    #bottomButtons .split-btn .device-dropdown-toggle {
        width: 20px !important;
        min-width: 20px !important;
    }
    /* fewer controls on phones: devices are still selectable in Settings; phone browsers can't screen-share */
    #bottomButtons #audioToggle,
    #bottomButtons #videoToggle,
    #bottomButtons #participantsActionsButton,
    #bottomButtons #participantViewDropdown,
    #bottomButtons #participantViewButton,
    #bottomButtons #screenShareBtn {
        display: none !important;
    }
    #bottomButtons .split-btn:has(> #audioBtn),
    #bottomButtons .split-btn:has(> #videoBtn),
    #bottomButtons .split-btn:has(> #participantsBtn) {
        background: transparent !important;
        box-shadow: none !important;
    }
    #bottomButtons #audioBtn,
    #bottomButtons #videoBtn,
    #bottomButtons #participantsBtn {
        width: 40px !important;
        padding-left: 0 !important;
        border-radius: 999px !important;
        background: rgba(255, 255, 255, 0.07) !important;
    }
    /* hang-up always visible: pinned to the right edge even if the bar scrolls */
    #bottomButtons #exitDropdown {
        position: sticky !important;
        right: 0;
        z-index: 2;
        background: transparent !important;
    }
    .navbar {
        margin: 8px !important;
    }
    #mySettings,
    #msgerDraggable,
    .swal2-popup {
        border-radius: 20px !important;
    }
}
