/* =========================================
   COMPONENTES REUTILIZABLES
========================================== */

/* --- SISTEMA DE RATING ESTRELLAS --- */
.rating:not(:checked) > input {
    position: absolute;
    appearance: none;
}

.rating:not(:checked) > label {
    float: right;
    cursor: pointer;
    font-size: 30px;
    color: var(--color-texto-secundario);
}

.rating:not(:checked) > label:before {
    content: '★';
}

.rating > input:checked + label:hover,
.rating > input:checked + label:hover ~ label,
.rating > input:checked ~ label:hover,
.rating > input:checked ~ label:hover ~ label,
.rating > label:hover ~ input:checked ~ label {
    color: var(--color-acento-purpura);
    opacity: 0.8;
}

.rating:not(:checked) > label:hover,
.rating:not(:checked) > label:hover ~ label {
    color: var(--color-acento-purpura);
}

.rating > input:checked ~ label {
    color: var(--color-acento-purpura);
}

/* ================= MODAL PREMIUM XYLO (DISEÑO BASE) ================= */
.modal-xylo-premium {
    background-color: #1a1a24; /* Color oscuro base */
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 0;
    max-width: 400px; /* Más compacto, como en tu foto */
    width: 90%;
    overflow: hidden;
    box-shadow: 0 25px 50px rgba(0,0,0,0.8);
    color: white;
}

/* Barra Superior */
.modal-top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.modal-title-small { font-size: 1rem; font-weight: bold; }
.btn-cerrar-modal { background: transparent; border: none; color: #888; font-size: 1.5rem; cursor: pointer; transition: color 0.2s;}
.btn-cerrar-modal:hover { color: white; }

/* Info de la Canción/Álbum */
.modal-entidad-info {
    display: flex; align-items: center; gap: 15px; 
    padding: 20px; 
    border-bottom: 1px solid rgba(255,255,255,0.08); 
}
.modal-portada-mini { width: 65px; height: 65px; border-radius: 8px; object-fit: cover; box-shadow: 0 4px 10px rgba(0,0,0,0.3);}
.modal-entidad-textos h2 { font-size: 1.25rem; margin: 0 0 5px 0; letter-spacing: -0.5px; }
.modal-entidad-textos p { font-size: 0.95rem; color: #aaa; margin: 0; }

/* Cuerpo interactivo */
.modal-body-dynamic { padding: 20px; }

.calificacion-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}
.calificacion-label { font-size: 1.05rem; font-weight: 500; }

/* Estrellas Funcionales (de Derecha a Izquierda para el hover CSS) */
.rating-stars-input-large { display: flex; flex-direction: row-reverse; gap: 5px; }
.rating-stars-input-large input { display: none; }
.rating-stars-input-large label {
    font-size: 2.2rem; 
    color: #333; /* Color de estrella vacía */
    cursor: pointer; 
    transition: color 0.2s;
}
.rating-stars-input-large label:hover,
.rating-stars-input-large label:hover ~ label,
.rating-stars-input-large input:checked ~ label {
    color: var(--color-acento-purpura, #8a2be2); /* Tu morado Xylo */
}

/* Área de Texto */
.xylo-textarea {
    width: 100%; height: 110px; 
    background-color: rgba(0,0,0,0.2);
    border: 1px solid rgba(255,255,255,0.1); 
    border-radius: 12px;
    padding: 15px; color: white; font-family: inherit; font-size: 0.95rem;
    resize: none; outline: none; margin-bottom: 20px; box-sizing: border-box;
}
.xylo-textarea::placeholder { color: #666; }
.xylo-textarea:focus { border-color: var(--color-acento-purpura, #8a2be2); }

/* Botón de Publicar */
.xylo-btn-primary {
    width: 100%;
    background-color: var(--color-acento-purpura, #8a2be2);
    color: white; border: none; padding: 14px; border-radius: 30px;
    font-weight: bold; font-size: 1.05rem; cursor: pointer; transition: filter 0.2s;
}
.xylo-btn-primary:hover { filter: brightness(1.15); }
/* EL FONDO OSCURO DEL MODAL (Oculto por defecto) */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    z-index: 9999;
    
    /* Centrado con Flexbox pero OCULTO por defecto */
    display: none; 
    justify-content: center;
    align-items: center;
}

/* CUANDO JAVASCRIPT LE AGREGA LA CLASE 'ACTIVE' */
.modal-overlay.active {
    display: flex; /* Se hace visible y centra el contenido */
}
/* Contenedor que agrupa estrellas y cuadro de texto */
.rating-interactivo {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* La caja oscura del input numérico */
.rating-exacto-box {
    display: flex;
    align-items: center;
    background-color: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 5px 10px;
    transition: border-color 0.2s;
}
.rating-exacto-box:focus-within {
    border-color: var(--color-acento-purpura, #8a2be2);
}

/* El input de números (Sin flechitas) */
.rating-exacto-box input[type="number"] {
    width: 40px;
    background: transparent;
    border: none;
    color: var(--color-acento-purpura,#6138a8);
    font-size: 1.2rem;
    font-weight: bold;
    text-align: center;
    outline: none;
    font-family: inherit;
    padding: 0;
}

/* Ocultar las flechas nativas del input number en Chrome/Safari/Firefox */
.rating-exacto-box input[type="number"]::-webkit-inner-spin-button, 
.rating-exacto-box input[type="number"]::-webkit-outer-spin-button { 
    -webkit-appearance: none; 
    margin: 0; 
}
.rating-exacto-box input[type="number"] {
    -moz-appearance: textfield;
}

.rating-max {
    color: #888;
    font-size: 0.9rem;
    font-weight: bold;
    margin-left: 2px;
}