﻿/*
Copyright (c) Microsoft Corporation.
Licensed under the MIT license. */

:root {
    --primary-color: #0078d4; /*#2A22F0;*/
    --secondary-color: #FCFCFC;
    --accent-color: #005a9e;
    --text-color: #2C2C2C;
    --border-color: #D3D3D3;
    --background-color: #EAEAEA;
    --error-color: #d13438;
    --success-color: #107c10;
    --background-white: #FFFFFF;
    --globalColorBluePrimary: #0078d4;
    --globalColorBlueShadeMBU: #006cbf;
    --globalColorBlueShadeMBU: #005ba1;
}

* {
    box-sizing: border-box;
}

html, body {
    height: 100vh;
    width: 100vw;
    margin: 0;
    padding: 0;
    overflow: hidden;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background: #FCFCFC;
    opacity: 1;
}

/* Layout Principal */

/* LAYOUT PRINCIPAL CON SCROLL VERTICAL */
.outer-div {
/*    padding: 0.5em 0.5em;*/
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    gap: 0.4em;
}

.container-row {
    display: flex;
    flex-wrap: wrap;
/*    padding: 0.2rem 0.8rem;*/
    flex-shrink: 0;
    background: white;
    /*    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);*/
}

.container-parent-main { /* La clase del elemento que contiene ambos */
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 0.2rem 0.8rem;
    width: 100%;
    background: var(--globalColorBlueShadeMBU);
}

.title-header {
    color: var(--primary-color);
    font-family: 'Segoe UI Light', arial, sans-serif;
    /*    font-size: calc(1.1rem + 1vh);*/
    font-size: 1em;
    font-weight: bold;
    margin: 0;
}

.user-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    color: white;
/*    color: var(--text-color);*/
    font-family: 'Segoe UI', arial, sans-serif;
    font-size: 0.8em;
    text-align: right;
}
/* Configuración */
.config-container {
    font-size: 0.8em;
    padding: 0.5rem 0;
    flex-shrink: 0;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Área de Contenido */
/* 1. CONTENEDOR PADRE - DEBE tener posición y tamaño */
.container-area {
    position: relative; /* ¡CRÍTICO para hijos absolutos! */
    width: 100%;
    height: 100vh; /* Recomendado: altura basada en viewport */
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    overflow: hidden; /* Para que hijos no se salgan */
}



.report-display-text,
.dashboard-display-text,
.tile-display-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #6E6E6E;
    font: 3.7vh "segoe ui light", arial, sans-serif;
    text-align: center;
    z-index: 10;
    width: 80%;
}
.sign-in-div {
    background-color: var(--background-white);
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.signin-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3vh; /* Espacio consistente entre elementos */
    width: 70vh;
    min-height: 27vh; /* Mejor para contenido dinámico */
    padding: 4.5vh;
    text-align: center;
}

    .signin-container > p {
        color: var(--primary-color);
        font: 300 5vh/1.2 'Segoe UI Light', arial, sans-serif;
        margin: 0; /* Eliminé el margin-bottom porque usamos gap */
    }
.sign-in {
    background-color: var(--primary-color);
    border: none;
    border-radius: 3.7vh;
    color: #FFFFFF;
    cursor: pointer;
    font: 2.28vh 'Segoe UI Semibold', arial, sans-serif;
    padding: 1.5vh 4vh;
    min-width: 200px;
    transition: background-color 0.2s;
}


.button-container {
    display: flex;
    align-items: center;
    justify-content: center;
/*    padding-top: 2.31vh;*/
}

.embed-button {
    background-color: #2A22F0;
    border: none;
    border-radius: 3.7vh;
    color: #FFFFFF;
    cursor: pointer;
    font-size: 0.9em;
    font-family: 'Segoe UI Semibold', arial, sans-serif;
    padding: 0.93vh 3.24vh;
    transition: background-color 0.2s;
    width: auto;
    min-width: 120px;
}

button:disabled {
    background-color: #5C5C5F;
    cursor: default;
}

button:focus {
    outline: none;
}

main {
    margin: 0 auto;
    width: 100%;
}

iframe {
    border: none;
}

.colored-bg {
    background-color: #EAEAEA;
}

.transparent-bg {
    background-color: transparent;
}
/* ===================== */
/* WRAPPERS (Padres) */
/* ===================== */

.report-wrapper,
.dashboard-wrapper,
.tile-wrapper {
    position: absolute;
    width: 100% !important;
    height: 100% !important;
    background-color: #EAEAEA;
    padding: 0 !important;
    margin: 0 !important;
    display: flex; /* Cambia a flex */
    justify-content: center; /* Centra horizontalmente */
    align-items: center; /* Centra verticalmente */
    overflow: hidden;
    box-sizing: border-box;
    z-index: 1;
}

/* 3. CONTENEDORES INTERNOS (donde va Power BI) */
.report-container,
.dashboard-container,
.tile-container {
    /* Ocupan TODO el wrapper */
    width: 100% !important;
    height: 100% !important;
    /* Posición relativa para hijos absolutos */
    position: relative;
    /* Estilos */
    background: transparent;
    padding: 0;
    margin: 0;
    box-sizing: border-box;
    /* Inicialmente oculto - lo muestra JavaScript */
    visibility: hidden;
}


.spinner {
    animation: rotation 1s infinite linear;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 50px;
    height: 50px;
    z-index: 10; /* Encima del contenedor */
}


/* 5. CONTROL DE VISIBILIDAD */
[hidden] {
    display: none !important;
}

/* Clase para cuando el embed está activo */
.active-embed .report-container,
.active-embed .dashboard-container,
.active-embed .tile-container {
    visibility: visible;
}

/* 6. DIFERENCIADORES VISUALES (opcional) */
/*.report-wrapper {
    border-left: 4px solid #0078d4;*/ /* Azul para reports */
/*}

.dashboard-wrapper {
    border-left: 4px solid #107c10;*/ /* Verde para dashboards */
/*}

.tile-wrapper {
    border-left: 4px solid #d83b01;*/ /* Naranja para tiles */
/*}*/

/* ===================== */
/* WRAPPERS (Padres) */
/* ===================== */


/* Inicio*/

/* ===================== */
/* CONFIG PANEL - LAYOUT PRINCIPAL */
/* ===================== */
.config-panel {
    display: grid;
    /*    grid-template-columns: auto 2fr 1fr;*/
    /*       grid-template-columns: 1fr 2fr 1fr;*/
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
    align-items: center;
    padding: 0.2rem 0.8rem;
    width: 100%;
}

/* ===================== */
/* SECCIÓN TIPO DE EMBED */
/* ===================== */
.embed-type-section {
    display:none;
/*    display: flex;
    flex-direction: column;
    min-width: 200px;*/
}

.section-label {
    color: var(--text-color);
    font-family: 'Segoe UI Semibold', sans-serif;
    font-size: 0.8rem;
/*    margin-bottom: 0.25rem;*/
    display: block;
}

.radio-group {
    display: flex;
    justify-content:start;
}

.radio-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0.4rem 0.8rem;
}

    .radio-option:hover {
        background-color: #f5f5f5;
    }

    .radio-option input[type="radio"] {
        width: 18px;
        height: 18px;
        cursor: pointer;
        accent-color: var(--primary-color);
    }

    .radio-option label {
        color: var(--text-color);
        font-family: 'Segoe UI', sans-serif;
        font-size: 0.8rem;
        cursor: pointer;
        user-select: none;
        margin:0px;
    }

    .radio-option input[type="radio"]:checked + label {
        color: var(--primary-color);
        font-weight: 600;
    }

/* ===================== */
/* SECCIÓN SELECTORES */
/* ===================== */
.selectors-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    align-items: start;
}

.selector-group-header {
    display: grid;
    grid-template-columns: 1fr;
}
.selector-group {
    display: grid;
    grid-template-columns: auto 1fr;
    gap:0.8rem;
    /*    display: flex;
    flex-direction: column;
*/
    /*gap: 0.5rem;
    min-width: 0;*/ /* Para evitar overflow */
}

.selector-label {
    color: var(--text-color);
    font-family: 'Segoe UI Semibold', sans-serif;
    font-size: 0.8rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    align-content:center;
}
label {
    margin:0rem;
}
.selector-dropdown {
    width: 100%;
    padding: 0.3rem 0.8rem;
    border: 1.5px solid #d1d5db;
    border-radius: 50rem;
    background-color: white;
    color: var(--text-color);
    font-family: 'Segoe UI', sans-serif;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1.2rem;
}

    .selector-dropdown:focus {
        outline: none;
        border-color: var(--primary-color);
        box-shadow: 0 0 0 3px rgba(42, 34, 240, 0.1);
    }

    .selector-dropdown:disabled {
        background-color: #f3f4f6;
        color: #9ca3af;
        cursor: not-allowed;
        border-color: #e5e7eb;
    }

/* ===================== */
/* SECCIÓN ACCIÓN (BOTÓN) */
/* ===================== */
.action-section {
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
/*    min-width: 100px;*/
}

.embed-button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 20rem;
    padding: 0.5rem 2rem;
    font-family: 'Segoe UI Semibold', sans-serif;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s ease;
/*    min-width: 100px;*/
    box-shadow: 0 2px 4px rgba(42, 34, 240, 0.2);
}

    .embed-button:hover:not(:disabled) {
        background-color: #1a14c0;
        transform: translateY(-1px);
        box-shadow: 0 4px 8px rgba(42, 34, 240, 0.25);
    }

    .embed-button:active:not(:disabled) {
        transform: translateY(0);
    }

    .embed-button:disabled {
        background-color: #9ca3af;
        cursor: not-allowed;
        box-shadow: none;
    }

    .embed-button:focus {
        outline: none;
        box-shadow: 0 0 0 3px rgba(42, 34, 240, 0.3);
    }

/* ===================== */
/* UTILIDADES */
/* ===================== */
.hidden {
    display: none !important;
}

/* Estilos para estados dinámicos */
.selector-group.active {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/** finnnnnnnnnnnnnnn*/

@keyframes rotation {
    from {
        transform: translate(-50%, -50%) rotate(0deg);
    }
    to {
        transform: translate(-50%, -50%) rotate(359deg);
    }
}




/* ===================== */
/* RESPONSIVE DESIGN */
/* ===================== */

/* Tablet (768px - 1024px) */
@media (max-width: 1024px) {
    .config-panel {
        grid-template-columns: 1fr auto;
        gap: 0.5rem;
        justify-content:center;
    }

    .action-section {
        justify-content: center;
/*        margin-top: 0.5rem;*/
    }

    .selectors-section {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Mobile (hasta 768px) */
@media (max-width: 768px) {
    .config-panel {
        /*        padding: 1rem;*/
        gap: 0.5rem;
        grid-template-columns: 1fr;
    }

    .selectors-section {
        grid-template-columns: 1fr 1fr;
/*        grid-template-columns: auto auto auto;*/
        gap: 0.3rem;
    }

    .radio-group {
        flex-direction: row;
/*        flex-wrap: wrap;*/
        gap: 0.5rem;
    }

    .radio-option {
        flex: 1;
        padding: 0rem;
        gap:0.3rem;
        /*        min-width: 120px;*/
        justify-content: center;
    }

/*    .embed-button {
        padding: 0.85rem;
    }*/
}



/* Mobile pequeño (hasta 480px) */
@media (max-width: 480px) {
    .outer-div {
        overflow-y:auto;
    }
    .selectors-section {
        grid-template-columns: 1fr;
        gap: 0.3rem;
    }

    .selector-dropdown {
        padding: 0.3rem 0.8rem;
        font-size: 0.7rem;
    }
    .container-parent-main {
        gap: 0rem;
    }
    .user-info {
        justify-content:center;
        gap:0rem;
    }

    .section-label,
    .selector-label {
        font-size: 0.7rem;
    }
    .action-section {
        margin-top: 0rem;
    }
    .embed-button {
       
        padding: 0.3rem 2rem;
        
/*        min-width: 100px;*/
    }
}
