*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes pulseReading {
    0% {
        transform: scale(1);
        opacity: 1;
    }

    70% {
        transform: scale(1.05);
        opacity: 0.8;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes scan-line {
    from {
        transform: translateY(-100%);
    }

    to {
        transform: translateY(100%);
    }
}

body {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
    background-color: var(--bg-body-fixed);
    color: var(--text-primary);
    font-family: var(--font-family-system);
    font-size: var(--font-size-base);
    font-weight: 400;
    transition: background-color 0.2s ease, color 0.2s ease;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    position: relative;
    contain: layout style;
}

body.theme-dark {
    background-color: var(--bg-body-fixed);
    background-image: var(--rl-admin-app-bg, linear-gradient(180deg, var(--bg-body-fixed) 0%, #18191b 100%));
    background-size: 100% 100%;
    background-position: center;
}

body:not(.theme-dark).bg-fixed {
    background-color: var(--bg-body-fixed);
    background-image: var(--rl-admin-app-bg, linear-gradient(180deg, var(--bg-body-fixed) 0%, #f8fafc 100%));
    background-size: 100% 100%;
    background-position: center;
}

.hidden {
    display: none !important;
}

.visible {
    display: flex !important;
}

.truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Modo leve para hardware limitado (ativado por classe no body). */
body.performance-lite {
    --transition-quick: 0.08s linear;
    --transition-smooth: 0.12s linear;
}

body.performance-lite .player-column-lhs,
body.performance-lite .playlist-panel,
body.performance-lite .chamadas-panel,
body.performance-lite .modal,
body.performance-lite .modal-content-base,
body.performance-lite .client-info-panel,
body.performance-lite .theme-selector-panel,
body.performance-lite .theme-selector-header,
body.performance-lite .volume-mixer-popup,
body.performance-lite .title-bar,
body.performance-lite .playlist-panel .panel-header,
body.performance-lite .chamadas-panel .panel-header,
body.performance-lite .client-info-header,
body.performance-lite #musicCatalogModal .track-catalog-header,
body.performance-lite #musicCatalogModal .music-catalog-source-select,
body.performance-lite #musicCatalogModal .music-catalog-top-action--ghost,
body.performance-lite #musicCatalogModal .music-catalog-header-insight-btn,
body.performance-lite #musicCatalogModal .music-catalog-search-history-popover,
body.performance-lite #musicCatalogModal .music-catalog-footer-v2 {
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
}

body[data-performance-tier="legacy"] .modal,
body[data-performance-tier="legacy"] .modal-content-base,
body[data-performance-tier="legacy"] .client-info-panel,
body[data-performance-tier="legacy"] .theme-selector-panel,
body[data-performance-tier="legacy"] .theme-selector-header,
body[data-performance-tier="legacy"] .volume-mixer-popup,
body[data-performance-tier="legacy"] #player-footer,
body[data-performance-tier="legacy"] #musicCatalogModal .music-catalog-header-insight-btn,
body[data-performance-tier="legacy"] #musicCatalogModal .music-catalog-search-history-popover {
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
}

body.performance-lite .album-art-default-vinyl,
body.performance-lite .track-info-enter,
body.performance-lite .track-info-exit,
body.performance-lite .status-seal.offline-reading,
body.performance-lite .call-status-text.playing,
body.performance-lite .call-status-text.queued {
    animation: none !important;
}

body.performance-lite .player-column-lhs::before,
body.performance-lite .player-column-lhs::after,
body.performance-lite .playlist-panel::before,
body.performance-lite .playlist-panel::after,
body.performance-lite .chamadas-panel::before,
body.performance-lite .chamadas-panel::after,
body.performance-lite .panel-header::before,
body.performance-lite .client-info-panel::before,
body.performance-lite .theme-selector-panel::before,
body.performance-lite .client-info-footer .client-action-btn::before,
body.performance-lite .client-info-footer .manage-subscription-btn::before,
body.performance-lite .playlist-panel .panel-footer .control-button::before,
body.performance-lite .chamadas-panel .panel-footer .control-button::before,
body.performance-lite #cameraModal .modal-button::before,
body.performance-lite #manualCallShareModal .modal-button::before,
body.performance-lite #manualCallShareModal .save-call-button::before {
    content: none !important;
    display: none !important;
}

body.performance-lite .player-column-lhs,
body.performance-lite .playlist-panel,
body.performance-lite .chamadas-panel,
body.performance-lite .panel-header,
body.performance-lite #player-footer,
body.performance-lite .client-info-panel,
body.performance-lite .theme-selector-panel,
body.performance-lite .theme-selector-header,
body.performance-lite .modal-content-base,
body.performance-lite .toast,
body.performance-lite .global-tooltip {
    box-shadow: none !important;
}

body[data-performance-tier="legacy"] .modal-content-base,
body[data-performance-tier="legacy"] .client-info-panel,
body[data-performance-tier="legacy"] .theme-selector-panel,
body[data-performance-tier="legacy"] .theme-selector-header,
body[data-performance-tier="legacy"] #player-footer,
body[data-performance-tier="legacy"] .volume-mixer-popup {
    box-shadow: none !important;
}

body.performance-lite .control-button,
body.performance-lite .modal-button,
body.performance-lite .modal-close,
body.performance-lite .save-call-button,
body.performance-lite .cancel-call-button,
body.performance-lite #openCameraBtn,
body.performance-lite .playlist-panel .panel-footer .control-button,
body.performance-lite .chamadas-panel .panel-footer .control-button {
    transition:
        background-color var(--transition-quick),
        color var(--transition-quick),
        opacity var(--transition-quick) !important;
}

body.performance-lite .control-button:hover,
body.performance-lite .control-button:active,
body.performance-lite .modal-button:hover,
body.performance-lite .modal-button:active,
body.performance-lite .modal-close:hover,
body.performance-lite .modal-close:active,
body.performance-lite .save-call-button:hover,
body.performance-lite .save-call-button:active,
body.performance-lite .cancel-call-button:hover,
body.performance-lite .cancel-call-button:active,
body.performance-lite #openCameraBtn:hover,
body.performance-lite #openCameraBtn:active,
body.performance-lite .playlist-panel .panel-footer .control-button:hover,
body.performance-lite .playlist-panel .panel-footer .control-button:active,
body.performance-lite .chamadas-panel .panel-footer .control-button:hover,
body.performance-lite .chamadas-panel .panel-footer .control-button:active {
    transform: none !important;
}

body.performance-lite .theme-option,
body.performance-lite .theme-option:hover,
body.performance-lite .theme-option.active,
body[data-performance-tier="legacy"] .theme-option,
body[data-performance-tier="legacy"] .theme-option:hover,
body[data-performance-tier="legacy"] .theme-option.active {
    transform: none !important;
    box-shadow: none !important;
}

body.performance-lite .theme-option-preview,
body.performance-lite .theme-option-check,
body[data-performance-tier="legacy"] .theme-option-preview,
body[data-performance-tier="legacy"] .theme-option-check {
    box-shadow: none !important;
    filter: none !important;
}

body.performance-lite #toastContainer {
    --toast-stack-gap: 8px;
    gap: var(--toast-stack-gap);
}

body.performance-lite .toast {
    transition-duration: 0.12s !important;
    filter: none !important;
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
    will-change: auto !important;
}

body.performance-lite .toast::before {
    content: none !important;
    display: none !important;
}

body.performance-lite .global-tooltip {
    transform: none !important;
    transition: opacity 0.08s linear !important;
}

body.performance-lite .global-tooltip.visible {
    transition-delay: 0s !important;
}

body.performance-lite .track-card,
body.performance-lite .music-env-card,
body.performance-lite .music-env-local-card,
body.performance-lite .music-catalog-search-result-card,
body.performance-lite .music-catalog-header-insight-btn,
body.performance-lite .track-license-btn,
body.performance-lite .track-preview-btn,
body.performance-lite .track-select-btn,
body.performance-lite .track-badge,
body.performance-lite .music-history-item,
body.performance-lite .music-env-local-btn {
    box-shadow: none !important;
    filter: none !important;
    transition: none !important;
    transform: none !important;
}

body.performance-lite .track-card-cover-svg,
body.performance-lite .music-env-card-loading,
body.performance-lite .music-env-card-loading-spinner,
body.performance-lite .track-bpm-processing i,
body.performance-lite .playlist-item-analysis-chip i,
body.performance-lite .fa-spin {
    animation: none !important;
    filter: none !important;
}

body.performance-lite .track-card-cover img,
body.performance-lite .music-env-thumb img {
    filter: none !important;
}

body.performance-lite #musicCatalogModal .music-catalog-toggles-scroll,
body.performance-lite #musicCatalogModal #musicCatalogGrid,
body.performance-lite #musicCatalogModal .track-catalog-grid.clusterize-scroll,
body[data-performance-tier="legacy"] #musicCatalogModal .music-catalog-toggles-scroll,
body[data-performance-tier="legacy"] #musicCatalogModal #musicCatalogGrid,
body[data-performance-tier="legacy"] #musicCatalogModal .track-catalog-grid.clusterize-scroll,
body.performance-lite .playlist-scroll,
body[data-performance-tier="legacy"] .playlist-scroll {
    overscroll-behavior: contain !important;
    overflow-anchor: none;
    scrollbar-gutter: stable;
}

/* Respeito ao sistema operacional: sem animações quando o SO pede redução de movimento */
@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;
    }

    .marquee-wrapper,
    .marquee-track {
        animation: none !important;
    }

    .album-art-default-vinyl,
    .status-seal.offline-reading,
    .call-status-text.playing,
    .call-status-text.queued,
    .track-bpm-processing i,
    .playlist-item-analysis-chip i,
    .fa-spin,
    .music-env-card-loading-spinner {
        animation: none !important;
    }
}
