/* Global legal / copyright bar — bottom of every page */
body.has-app-legal-footer {
    padding-bottom: 34px !important;
    box-sizing: border-box;
}

body.meeting-page.has-app-legal-footer {
    padding-bottom: 0 !important;
}

.app-legal-footer {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1045;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 34px;
    padding: 0 0.75rem 0 0.35rem;
    background: linear-gradient(180deg, #1a2744 0%, #0f172a 100%);
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    color: #e2e8f0;
    font-family: 'Segoe UI', Arial, sans-serif;
    font-size: 0.6875rem;
    line-height: 1.3;
    box-sizing: border-box;
    animation: appLegalFooterIn 0.35s ease-out;
}

@keyframes appLegalFooterIn {
    from { opacity: 0; transform: translateY(100%); }
    to { opacity: 1; transform: translateY(0); }
}

.app-legal-footer-icon {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    margin: 0;
    padding: 0;
    border: none;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.1);
    color: #93c5fd;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8125rem;
    transition: background 0.15s, color 0.15s;
}

.app-legal-footer-icon:hover,
.app-legal-footer-icon:focus {
    background: rgba(147, 197, 253, 0.25);
    color: #fff;
    outline: none;
}

.app-legal-footer-summary {
    margin: 0;
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #cbd5e1;
    cursor: pointer;
    user-select: none;
}

.app-legal-footer-summary:hover {
    color: #fff;
}

/* Meeting page — controls always above legal bar */
body.has-app-legal-footer .controls-bar,
body.meeting-page .controls-bar {
    z-index: 1060;
}

body.has-app-legal-footer .video-sidebar {
    bottom: calc(var(--meet-controls-height, 88px) + var(--meet-legal-footer-height, 34px) + env(safe-area-inset-bottom, 0px));
    height: auto;
}

body.has-app-legal-footer.meeting-form-share-active .video-sidebar.active {
    bottom: calc(var(--meet-controls-height, 88px) + var(--meet-legal-footer-height, 34px) + env(safe-area-inset-bottom, 0px));
}

body.has-app-legal-footer.meeting-form-share-active .controls-bar,
body.meeting-page.meeting-form-share-active .controls-bar {
    right: var(--form-share-sidebar-width, 360px);
}

@media (max-width: 768px) {
    body.has-app-legal-footer .video-sidebar.active {
        bottom: calc(var(--meet-controls-height, 72px) + var(--meet-legal-footer-height, 34px));
    }

    body.meeting-form-share-active .controls-bar,
    body.has-app-legal-footer.meeting-form-share-active .controls-bar {
        right: 0;
    }
}

/* Login — above footnote */
body.has-app-legal-footer.login-page .login-page-footnote {
    margin-bottom: 2.5rem;
}

/* AdminLTE main footer — stack above legal bar */
body.has-app-legal-footer .main-footer {
    margin-bottom: 34px;
}

/* Full notice panel */
.app-legal-panel {
    position: fixed;
    inset: 0;
    z-index: 10060;
    display: none;
    pointer-events: none;
}

.app-legal-panel.is-open {
    display: block;
    pointer-events: auto;
}

.app-legal-panel-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    opacity: 0;
    transition: opacity 0.25s ease;
}

.app-legal-panel.is-open .app-legal-panel-backdrop {
    opacity: 1;
}

.app-legal-panel-sheet {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    max-height: min(85vh, 520px);
    background: #fff;
    border-radius: 12px 12px 0 0;
    box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    transform: translateY(100%);
    transition: transform 0.28s ease;
}

.app-legal-panel.is-open .app-legal-panel-sheet {
    transform: translateY(0);
}

.app-legal-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    border-bottom: 1px solid #e2e8f0;
    flex-shrink: 0;
}

.app-legal-panel-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    color: #0f172a;
}

.app-legal-panel-close {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 6px;
    background: #f1f5f9;
    color: #475569;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.app-legal-panel-close:hover {
    background: #e2e8f0;
}

.app-legal-panel-body {
    padding: 1rem 1.1rem 1.25rem;
    overflow-y: auto;
    font-size: 0.8125rem;
    line-height: 1.6;
    color: #334155;
}

.app-legal-notice-p {
    margin: 0 0 0.85rem;
}

.app-legal-notice-contact {
    margin-bottom: 0;
    color: #64748b;
}

.app-legal-notice-contact a {
    color: #1565c0;
}

/* Meeting: slim copyright line under the video — not a watermark on the person */
body.meeting-page .app-legal-footer {
    position: fixed;
    top: auto;
    left: 0;
    right: 0;
    bottom: 0;
    height: 28px;
    min-height: 28px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.4rem;
    padding: 0 12px 0 8px;
    background: linear-gradient(180deg, #1a2744 0%, #0f172a 100%) !important;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: none;
    overflow: hidden;
    z-index: 1045;
    pointer-events: auto;
    animation: none;
}

body.meeting-page .app-legal-footer-summary {
    position: static !important;
    width: auto !important;
    max-width: 100%;
    height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    clip: auto !important;
    overflow: hidden !important;
    text-overflow: ellipsis;
    white-space: nowrap !important;
    transform: none !important;
    color: #cbd5e1 !important;
    font-size: 11px !important;
    font-weight: 500;
    letter-spacing: 0.02em;
    line-height: 1.2;
    pointer-events: auto !important;
    text-align: left;
    cursor: pointer;
}

body.meeting-page .app-legal-footer-summary:hover {
    color: #fff !important;
}

body.meeting-page .app-legal-footer-icon {
    position: static;
    left: auto;
    top: auto;
    bottom: auto;
    z-index: auto;
    width: 22px;
    height: 22px;
    background: transparent;
    color: #93c5fd;
    pointer-events: auto;
}

body.meeting-page .app-legal-footer-icon:hover,
body.meeting-page .app-legal-footer-icon:focus {
    background: rgba(147, 197, 253, 0.25);
    color: #fff;
}

body.meeting-page .app-legal-panel-sheet {
    bottom: 16px;
}

@media (min-width: 640px) {
    .app-legal-panel-sheet {
        left: 50%;
        right: auto;
        bottom: 34px;
        width: min(640px, 94vw);
        transform: translate(-50%, 100%);
        border-radius: 12px;
    }

    .app-legal-panel.is-open .app-legal-panel-sheet {
        transform: translate(-50%, 0);
    }
}
