@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;600;700&display=swap');

 :root {
            --background: #f2f6f8;
            --surface: #ffffff;
            --primary: #f77f3a;
            --text-primary: #000000;
            --text-secondary: #555555; 
            --danger: #e74c3c;
        }
        * {
            box-sizing: border-box;
        }
        body {
            margin: 0;
            background: var(--background);
            color: var(--text-primary);
            font-family: 'Poppins', sans-serif;
            display: flex;
            flex-direction: column; 
            align-items: center;
            min-height: 100vh;
            text-align: center;
        }
        .container {
            width: 100%;
            /* max-width: 400px; */
            padding: 20px;
        }
        .logo {
            max-width: 280px;
            margin-bottom: 40px;
            width: 80%;
        }
        .selection-button {
            display: block;
            width: 100%;
            padding: 20px;
            margin-bottom: 5px;
            border-radius: 12px;
            text-decoration: none;
            font-size: 1.2em;
            font-weight: 700;
            transition: transform 0.2s ease, box-shadow 0.2s ease;
        }
        .selection-button:hover {
            transform: scale(1.05);
        }
        a.selection-button.disabled {
            background-color: #ccc !important;
            color: #666 !important;
            cursor: not-allowed;
            box-shadow: none;
            pointer-events: none; /* Impede qualquer evento de clique */
        }
        .screen-button {
            background-color: var(--primary);
            color: white;
            box-shadow: 0 4px 20px rgba(247, 127, 58, 0.3);
        }
        .control-button {
            background-color: var(--surface);
            color: var(--text-primary);
            border: 1px solid #e0e0e0;
            box-shadow: 0 2px 10px rgba(0,0,0,0.05);
        }

        .admin-button {
            background-color: transparent;
            color: #f28069;
            border: 1px solid #f28069;
        }
        .admin-button:hover {
            background-color: var(--surface);
            border-color: var(--surface);
        }

        @media (max-width: 480px) {
            .logo {
                max-width: 220px;
            }
        }

        /* PWA Install Prompt */
        .install-prompt {
            position: fixed;
            bottom: -150px; /* Start off-screen */
            left: 50%;
            transform: translateX(-50%);
            width: 90%;
            max-width: 450px;
            background: var(--surface); /* #ffffff */
            padding: 15px;
            border-radius: 12px;
            box-shadow: 0 4px 20px rgba(0,0,0,0.4);
            display: flex;
            align-items: center;
            justify-content: space-between;
            z-index: 1000; 
            transition: bottom 0.5s ease-in-out;
            border: 1px solid #e0e0e0;
        }
        .install-prompt.show {
            bottom: 20px;
        }
        .install-prompt-info {
            display: flex;
            align-items: center;
            gap: 15px;
        }
        .install-prompt-info img {
            width: 40px;
            height: 40px;
        }
        .install-prompt-actions button {
            background: var(--primary);
            color: white;
            border: none;
            padding: 8px 12px;
            border-radius: 8px;
            font-weight: bold;
            cursor: pointer;
            margin-left: 10px;
        }
        .install-prompt-actions .dismiss {
            background: transparent;
            color: #f28069;
        }

        
.player-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1; /* Fica atrás de todo o conteúdo */
}

.player-container #player {
    width: 100vw;
    height: 56.25vw; /* 16:9 aspect ratio */
    min-height: 100vh;
    min-width: 177.77vh; /* 16:9 aspect ratio */
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.overlay-top {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 20px 30px;
    box-sizing: border-box;
    background: linear-gradient(to bottom, rgba(0,0,0,0.7), rgba(0,0,0,0));
    
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: opacity 0.5s ease-in-out, visibility 0.5s ease-in-out;
}
 
.overlay-top-left {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 10px 20px;
    border-radius: 10px;
    font-size: 20px;
    color: var(--primary);
}

.header-logo {
    height: 40px;
    width: auto;
}

.info-musica {
    color: #fff;
    font-size: 24px;
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.8);
    position: absolute; /* Centraliza o título na tela */
    left: 50%;
    transform: translateX(-50%);
    opacity: 1;
    transition: opacity 0.5s ease;
}

.skip-button {
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 12px 25px;
    border-radius: 50px;
    font-family: 'Poppins', sans-serif;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(192, 105, 13, 0.4);
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
}

.skip-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(192, 105, 13, 0.4);
    background: var(--primary);
}

.ui-hidden {
    opacity: 0 !important;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.5s ease-in-out, visibility 0.5s ease-in-out;
}

.qr-container {
    position: fixed;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    transform: translate(-50%, -50%); /* Mantido para centralização inicial */
    background: #0d0d0d; /* Cor de fundo sólida para cobrir tudo */
    
    /* Usando flex para centralizar o conteúdo interno */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;

    text-align: center;
    z-index: 20; /* Garante que fique sobre outros elementos */
    opacity: 0; /* Começa invisível para transição */
    visibility: hidden;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.qr-container h2 {
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 22px;
    font-weight: 600;
}

#qrcode {
    padding: 10px;
    background: white;
    border-radius: 8px;
    display: inline-block;
}

.qr-code-text {
    margin-top: 25px;
    font-size: 18px;
    color: #b3b3b3;
}

.qr-code-text span {
    display: inline-block;
    margin-left: 10px;
    font-size: 24px;
    font-weight: bold;
    color: var(--primary);
    letter-spacing: 2px;
    background: #1e1e1e;
    padding: 5px 15px;
    border-radius: 8px;
}

.qr-footer-logo {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    height: 60px;
    opacity: 0.7;
}
 
.btn-primary{
    background: var(--primary);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 50px;
    font-family: 'Poppins', sans-serif;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(247, 127, 58, 0.4);
    transition: all 0.3s ease;
}

.btn-primary:hover{
    background: var(--text-primary);
}

.btn:disabled{
    background-color: var(--primary);
}

/* --- Login Form --- */
.login-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    flex-grow: 1; /* Faz o container ocupar o espaço restante */
    padding: 20px;
}

.login-container h2 {
    margin-bottom: 20px;
}

.login-container input {
    background: #ffffff;
    border: 1px solid #ccc;
    color: var(--text-primary);
    width: 100%;
    max-width: 300px;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    font-size: 16px;
    text-align: center;
}

.login-container button {
    background: var(--primary);
    color: white;
    font-weight: bold;
    border: none;
    width: 100%;
    max-width: 300px;
    padding: 15px;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
}
.now-playing .start-button {
    background: var(--primary);
    color: white;
    width: 100%;
    margin-top: 10px;
}
.login-container .qr-scan-btn {
    background: #e0e0e0;
    color: #333;
    margin-top: 10px;
}

#qr-reader {
    width: 100%;
    max-width: 100%;
}

/* --- Main Control View --- */
.header {
    position: sticky;
    top: 0;
    background: var(--background);
    padding: 15px;
    z-index: 10;
}

.now-playing {
    background: var(--surface);
    padding: 15px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    border-radius: 8px;
    margin-bottom: 15px;
}

.now-playing h3 {
    margin: 0 0 10px 0;
    font-size: 14px;
    color: var(--text-secondary);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.now-playing h3 span {
    color: var(--primary);
    font-weight: bold;
}

.now-playing-info {
    font-weight: 600;
}
.now-playing-info small {
    color: var(--text-secondary);
    display: block;
    font-weight: 400;
}

.now-playing-actions {
    display: flex;
    margin-top: 10px;
    gap: 10px;
}
.stop-button {
    border-color: #e74c3c;
    color: #e74c3c;
}
.now-playing-info strong {
    font-size: 1.1em;
}

.skip-button-controle {
    background: var(--primary);
    border: 1px solid var(--surface);
    color: var(--surface);
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}
.skip-button-controle:hover {
    background: var(--background);
    border: 1px solid var(--primary);
    color: var(--primary);
}

.room-info {
    display: flex;
    align-items: center;
}


.main-content {
    padding: 0 15px 15px 15px;
}

h3 {
    margin-top: 20px;
    margin-bottom: 15px;
    padding-bottom: 10px; 
    border-bottom: 1px solid #e0e0e0;
    margin-bottom: 10px;
}

.tabs {
    display: flex;
    border-bottom: 1px solid #282828;
    margin-bottom: 15px;
}

.tab-button {
    flex: 1;
    padding: 15px;
    cursor: pointer;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 16px;
    font-weight: 600;
    border-bottom: 2px solid transparent;
    transition: color 0.2s, border-color 0.2s;
}

.tab-button.active {
    color: var(--text-primary);
    border-bottom-color: var(--primary);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}


.search-input {
    width: 100%;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid #ccc;
    background: #ffffff;
    color: var(--text-primary);
    margin-bottom: 15px;
    font-size: 16px;
}

.music-list .musica {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #e0e0e0;
}

.music-list .musica-info small {
    color: var(--text-secondary);
}

.add-button {
    background: var(--primary);
    border: none; 
    color: var(--background);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
    transition: transform 0.2s ease;
}
.add-button:hover {
    transform: scale(1.1);
}

.queue-item {
    display: flex;
    padding: 8px;
    border-radius: 4px; 
    background: #282828;
    margin-bottom: 8px;
}

.queue-item .musica-info {
    flex-grow: 1;
}

.remove-button {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 18px;
    padding: 0 5px;
    opacity: 0.6;
    transition: opacity 0.2s ease;
}
.remove-button:hover {
    opacity: 1;
}
.toast {
    position: fixed;
    bottom: -100px;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--primary);
    color: white;
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    transition: bottom 0.5s ease-in-out;
    z-index: 100;
}

.toast.show {
    bottom: 20px;
}

.toast.warning {
    background-color: #f39c12; /* Cor de aviso (amarelo) */
}

.suggestion-box {
    background-color: rgba(243, 156, 18, 0.1);
    border: 1px solid rgba(243, 156, 18, 0.3);
    padding: 10px;
    margin-bottom: 15px;
    border-radius: 8px;
    font-size: 14px;
    display: none; /* Começa escondido */
}

.suggestion-box span {
    color: var(--text-secondary);
}

.music-list:empty::after {
    content: "Nenhuma música encontrada.";
    color: var(--text-secondary);
    display: block;
    text-align: center;
    padding: 20px;
}
.login-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 5px;
    border-bottom: 1px solid #e0e0e0;
    background-color: var(--primary);
}
.login-header .back-button {
    color: var(--surface);
    text-decoration: none;
    padding: 5px; 
    text-align: left;
    position: absolute;
}
.login-header .back-button svg {
    width: 24px;
    height: 24px;
}
.login-header .logo-container {
    flex-grow: 1;
    text-align: center; /* Garante que a imagem dentro dele fique no centro */
}
.login-header .logo-container img {
    height: 45px; /* Um tamanho um pouco maior e mais agradável */
    filter: brightness(0) invert(1);
}