/* ==========================================================================
   PUNTO 1 A - CONTENEDOR PRINCIPAL Y LAYOUT
   ========================================================================== */
#pfc-aviso-app-container {
    /* ¡LA CLAVE! Ancho máximo y centrado automático */
    max-width: 1100px;
    margin: 40px auto;

    /* Estilos de "tarjeta" moderna */
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: #ffffff;
    padding: 40px;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
}

/* Loader */
#pfc-aviso-app-container .pfc-loader {
    text-align: center;
    padding: 40px;
    color: #6b7280;
}

/* Dashboard de Navegación */
.pfc-app-dashboard {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 20px;
    margin-bottom: 30px;
}

.pfc-app-dashboard button {
    background-color: #f9fafb;
    color: #374151;
    border: 1px solid #d1d5db;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    font-size: 14px;
    transition: all 0.2s ease-in-out;
}

.pfc-app-dashboard button:hover {
    background-color: #f3f4f6;
    border-color: #9ca3af;
    transform: translateY(-2px);
}

/* Estilo para la pestaña activa */
.pfc-app-dashboard button.active {
    background-color: #6a11cb;
    color: #ffffff;
    border-color: #6a11cb;
    font-weight: 600;
    box-shadow: 0 4px 8px rgba(106, 17, 203, 0.2);
}


/* ==========================================================================
   PUNTO 1 B - ESTRUCTURA DEL FORMULARIO
   ========================================================================== */
#pfc-app-main-view h2 {
    font-size: 1.8em;
    color: #111827;
    margin-top: 0;
    margin-bottom: 25px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e5e7eb;
    font-weight: 600;
}

#pfc-crear-aviso-form fieldset {
    border: 1px solid #e5e7eb;
    padding: 25px;
    border-radius: 8px;
    margin-bottom: 30px;
    background-color: #f9fafb;
}

#pfc-crear-aviso-form legend {
    font-weight: 600;
    color: #1f2937;
    padding: 0 10px;
    font-size: 1.3em;
    margin-bottom: 15px;
}

#pfc-crear-aviso-form label {
    display: block;
    font-weight: 500;
    color: #374151;
    margin-bottom: 6px;
    font-size: 14px;
}

#pfc-crear-aviso-form input[type="text"],
#pfc-crear-aviso-form input[type="number"],
#pfc-crear-aviso-form select,
#pfc-crear-aviso-form textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 15px;
    background-color: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}

/* Efecto de foco para los campos */
#pfc-crear-aviso-form input:focus,
#pfc-crear-aviso-form select:focus,
#pfc-crear-aviso-form textarea:focus {
    outline: none;
    border-color: #6a11cb;
    box-shadow: 0 0 0 2px rgba(106, 17, 203, 0.2);
}


/* ==========================================================================
   PUNTO 2 - CAMPOS DE FORMULARIO Y BOTONES
   ========================================================================== */
#pfc-crear-aviso-form select {
    height: 42px;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right .75rem center;
    background-size: 16px 12px;
}

#pfc-crear-aviso-form select:disabled {
    background-color: #f3f4f6;
    cursor: not-allowed;
}

/* Contenedor para alinear los botones al final */
.form-action-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    margin-top: 20px;
}

#pfc-crear-aviso-form button[type="submit"],
#pfc-crear-aviso-form .pfc-secondary-btn {
    font-weight: 600;
    padding: 10px 22px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 15px;
    transition: all 0.2s ease;
    margin-left: 0; /* Reseteamos el margen que tenía .pfc-secondary-btn */
}

#pfc-crear-aviso-form button[type="submit"] {
    background: linear-gradient(135deg, #2575fc 0%, #6a11cb 100%);
    color: white;
}

#pfc-crear-aviso-form button[type="submit"]:hover {
    transform: translateY(-2px);
    box-shadow: 0 7px 14px rgba(50, 50, 93, 0.1), 0 3px 6px rgba(0, 0, 0, 0.08);
}



/* =================================================================================================
   PUNTO 3 - ESTILO PARA LA LISTA DE "MIS AVISOS",  LAYOUT MEJORADO PARA LAS TARJETAS DE AVISO
   ================================================================================================= */
.avisos-list {
    display: grid;
    gap: 15px;
}

.aviso-card {
    display: flex; /* ¡La magia de Flexbox! */
    align-items: center; /* Centra todo verticalmente */
    gap: 15px; /* Espacio entre elementos */
    background-color: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 15px 20px;
    transition: box-shadow 0.2s ease-in-out;
}

.aviso-card:hover {
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
}

.aviso-card-checkbox {
    /* El contenedor del checkbox no necesita mucho estilo */
}

.aviso-card-content {
    flex-grow: 1; /* Le dice a este div que ocupe todo el espacio disponible */
    /* Ya no necesita display, justify-content, etc. */
}

.aviso-card-title {
    font-size: 1.2em;
    font-weight: 600;
    color: #1f2937;
    margin: 0 0 5px 0;
}

.aviso-card-meta {
    font-size: 0.9em;
    color: #6b7280;
    margin: 0;
}

.aviso-card-status {
    display: inline-block;
    padding: 2px 8px;
    font-size: 0.8em;
    font-weight: 500;
    border-radius: 12px;
    text-transform: capitalize;
    margin-bottom: 8px;
}

.status-borrador { background-color: #e5e7eb; color: #374151; }
.status-pendiente_revision { background-color: #fef3c7; color: #92400e; }
.status-en_revision { background-color: #dbeafe; color: #1e40af; } 
.status-verificado { background-color: #d1fae5; color: #065f46; }
.status-rechazado { background-color: #fee2e2; color: #991b1b; }
.status-trash { background-color: #e5e7eb; color: #4b5563; }


.aviso-card-actions button {
    background: none;
    border: 1px solid #d1d5db;
    color: #374151;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    margin-left: 10px;
}

.aviso-card-actions .delete-btn {
    border-color: #ef4444;
    color: #ef4444;
}
.aviso-card-actions .delete-btn:hover {
    background-color: #ef4444;
    color: #fff;
}

.aviso-card-actions {
    display: flex;
    gap: 10px;
}


/* =====================================================================================
   PUNTO 4 - ESTILOS PARA LOS UPLOADERS DE ARCHIVOS 
   ===================================================================================== */
.uploader-container {
    background-color: #fff;
    border: 2px dashed #d1d5db;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
}
.image-preview {
    margin-bottom: 15px;
}
.image-preview img {
    max-width: 100%;
    max-height: 200px;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
}
.uploader-container .remove-btn {
    background: #ef4444; color: white; border: none;
    padding: 5px 10px; border-radius: 5px; cursor: pointer;
    margin-top: 10px;
}


/* =====================================================================================
   PUNTO 5 - ESTILOS PARA LOS ESTADOS DE REVISION DEL ADMIN
   ===================================================================================== */
/* Contenedor del encabezado de estado en cada paso */
.fieldset-status-header {
    display: none; /* Oculto por defecto en el formulario de creación */
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding: 10px;
    background-color: #f3f4f6;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
}

/* Las 'luces' de estado */
.status-lights {
    display: flex;
    gap: 8px;
    align-items: center;
}

.status-light {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background-color: #d1d5db; /* Gris por defecto (inactivo) */
    position: relative;
    cursor: help;
}

/* Colores de las luces */
.status-light.status-verificado { background-color: #34d399; }
.status-light.status-corregir { background-color: #f59e0b; }
.status-light.status-rechazado { background-color: #ef4444; }

/* Caja para el feedback del admin */
.admin-feedback-box {
    font-size: 0.9em;
    color: #4b5563;
}

/* Cuando mostremos un formulario para editar, añadiremos esta clase */
/* para hacer visibles los indicadores de estado. */
#pfc-crear-aviso-form.modo-revision .fieldset-status-header {
    display: flex;
}

/* Estilos para los nuevos uploaders de video */
.media-previews {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 15px;
}


/* =====================================================================================
   PUNTO 6 - MEJORAS PARA EL DASHBOARD Y NAVEGADORES
   ===================================================================================== */
.pfc-app-dashboard {
    overflow-x: auto; /* Permite scroll horizontal si los botones no caben */
    white-space: nowrap; /* Evita que los botones salten a la línea de abajo */
    -webkit-overflow-scrolling: touch; /* Scroll suave en iOS */
}

/* Para navegadores que soportan scrollbars personalizadas */
.pfc-app-dashboard::-webkit-scrollbar {
    height: 6px;
}
.pfc-app-dashboard::-webkit-scrollbar-thumb {
    background-color: #d1d5db;
    border-radius: 10px;
}


/* =====================================================================================
   PUNTO 7 - ESTILOS PARA LA NUEVA VISTA PREVIA CON ACCIONES
   ===================================================================================== */
.image-preview-item {
    position: relative;
    display: inline-block;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    max-width: 200px; /* Tamaño de la vista previa */
}

.image-preview-item img {
    display: block;
    width: 100%;
    height: auto;
}

.image-preview-actions {
    position: absolute;
    top: 5px;
    right: 5px;
    display: flex;
    gap: 5px;
    background-color: rgba(0, 0, 0, 0.5);
    padding: 5px;
    border-radius: 5px;
    opacity: 0; /* Oculto por defecto */
    transition: opacity 0.2s ease-in-out;
}

.image-preview-item:hover .image-preview-actions {
    opacity: 1; /* Se muestra al pasar el mouse */
}

.pfc-action-btn {
    background-color: #fff;
    color: #333;
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    text-decoration: none;
    font-size: 16px;
    transition: background-color 0.2s, color 0.2s;
}

.pfc-action-btn:hover {
    background-color: #f0f0f0;
}

.pfc-action-btn.pfc-delete-btn {
    background-color: #ef4444;
    color: white;
}
.pfc-action-btn.pfc-delete-btn:hover {
    background-color: #dc2626;
}


/* =====================================================================================
   PUNTO 8 - ESTILOS PARA LA GALERÍA DE IMÁGENES ADICIONALES
   ===================================================================================== */
.gallery-preview-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 15px;
}

/* Reutilizamos el estilo que ya creamos para la imagen principal, 
   pero lo hacemos más pequeño para las miniaturas de la galería. */
.gallery-preview-grid .image-preview-item {
    max-width: 120px; /* Miniaturas más pequeñas */
}

.gallery-preview-grid .image-preview-item .pfc-action-btn {
    width: 24px;   /* Botones más pequeños */
    height: 24px;
    font-size: 12px;
}


/* =====================================================================================
   PUNTO 9 - ESTILOS PARA VISTA PREVIA DE VIDEO 
   ===================================================================================== */
.video-preview-item video {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Asegura que el video llene el contenedor */
}


/* =====================================================================================
   PUNTO 10 - ESTILO PARA EL BOTON SECUNDARIO DE CANCELAR EDICION
   ===================================================================================== */
.pfc-secondary-btn {
    background: #6b7280;
    color: white;
    font-weight: 500;
    padding: 12px 25px;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    font-size: 1.1em;
    margin-left: 10px;
    transition: background-color 0.2s ease;
}

.pfc-secondary-btn:hover {
    background: #4b5563;
}


/* =====================================================================================
   PUNTO 11 - ESTILO PARA EL MENSAJE AL FRONTED (Visible y Legible)
   ===================================================================================== */
.mensaje-admin-texto {
    background-color: #f3f4f6;       /* Fondo gris muy claro */
    border-left: 4px solid #6a11cb;  /* Borde violeta a la izquierda */
    padding: 10px;
    margin: 10px 0;
    border-radius: 4px;
    
    /* --- AGREGADO PARA SOLUCIONAR EL TEXTO INVISIBLE --- */
    color: #333333 !important;       /* Texto Gris Oscuro (Casi negro) */
    font-weight: 500;                /* Un poco más gordita la letra para leer mejor */
    font-size: 14px;                 /* Tamaño legible */
    line-height: 1.5;                /* Espaciado entre líneas */
}


/* =====================================================================================
   PUNTO 12 - MENSAJE DEL ADMIN A PESTAÑA MENSAJE DE PACAMAZU, ESTO ES PARA QUE RESALTE
   ===================================================================================== */
.admin-feedback-container {
    background-color: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
}
.admin-feedback-container h4 {
    margin-top: 0;
    color: #b45309;
}


/* ==========================================================================
   PUNTO 13 - BARRA DE PROGRESO PARA LAS IMAGENES
   ========================================================================== */
.upload-progress-container {
    padding: 10px;
    text-align: left;
}
.progress-bar-background {
    width: 100%;
    background-color: #e9ecef;
    border-radius: .25rem;
    height: 1rem;
    margin-top: 5px;
}
.progress-bar-foreground {
    background-color: #007bff;
    height: 100%;
    border-radius: .25rem;
    transition: width 0.2s ease-in-out; 
}
.progress-percentage {
    display: block;
    text-align: center;
    font-size: 0.8em;
    margin-top: 5px;
    font-weight: bold;
}


/* ==========================================================================
   PUNTO 14 - BARRA DE PROGRESO PARA LAS VIDEOS SHORT GALERIA
   ========================================================================== */
.upload-in-progress {
    width: 120px; /* O el tamaño de tus miniaturas */
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f8f9fa;
    border: 2px dashed #dee2e6;
}



/* ==========================================================================
   PUNTO 15 - ESTILOS PARA LA PAGINACIÓN DEL FRONTEND
   ========================================================================== */

.pfc-pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 25px;
}

.page-btn {
    background-color: #fff;
    border: 1px solid #d1d5db;
    color: #374151;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease;
}

.page-btn:hover {
    background-color: #f3f4f6;
    border-color: #9ca3af;
}

/* Estilo para el botón de la página actual */
.page-btn.current {
    background-color: #6a11cb;
    color: #ffffff;
    border-color: #6a11cb;
    font-weight: bold;
    cursor: default;
}


/* ==========================================================================
   PUNTO 16 - DISEÑO RESPONSIVE
   ========================================================================== */
@media (max-width: 782px) {
    #pfc-aviso-app-container {
        padding: 20px;
        margin: 20px auto;
    }
}

@media (max-width: 480px) {
    #pfc-app-main-view h2 {
        font-size: 1.5em;
    }
    .form-action-buttons {
        flex-direction: column-reverse; /* Botones uno encima del otro */
    }
    #pfc-crear-aviso-form button[type="submit"],
    #pfc-crear-aviso-form .pfc-secondary-btn {
        width: 100%;
    }
}



/* ==========================================================================
   17 - ESTILOS PARA EL MODAL DE VISTA PREVIA "PREMIUM"
   ========================================================================== */

#pfc-preview-modal-backdrop {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background-color: rgba(20, 20, 30, 0.85);
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
}

#pfc-preview-modal-wrap {
    width: 90%;
    max-width: 900px;
    height: 90vh;
    background-color: #f4f5f7;
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

#pfc-preview-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 25px;
    background-color: #ffffff;
    border-bottom: 1px solid #e5e7eb;
}

#pfc-preview-modal-header .header-text h2 {
    font-size: 1em;
    font-weight: 700;
    color: #6a11cb;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 1px;
}
#pfc-preview-modal-header .header-text p {
    font-size: 0.8em;
    margin: 0;
    color: #6b7280;
}

#pfc-preview-modal-close {
    background: #e5e7eb;
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    font-size: 20px;
    cursor: pointer;
    line-height: 30px;
    transition: all 0.2s;
}

#pfc-preview-modal-close:hover {
    background: #d1d5db;
    transform: rotate(90deg);
}

#pfc-preview-modal-content {
    flex-grow: 1;
    overflow-y: auto;
    padding: 30px;
}

/* ===== IMAGEN PRINCIPAL ===== */
.preview-gallery-main {
    width: 100%;
    height: 450px; /* Le damos una altura fija */
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 15px;
    background-color: #e5e7eb; /* Fondo mientras carga la imagen */
    display: flex;
    align-items: center;
    justify-content: center;
}
.preview-gallery-main img {
    width: 100%;
    height: 100%;
    object-fit: contain; /* La imagen se verá completa, contenida en la caja */
}
.preview-gallery-thumbnails {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
}
.preview-gallery-thumbnails .thumbnail {
    width: 80px;
    height: 60px;
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color 0.2s;
}
.preview-gallery-thumbnails .thumbnail:hover {
    border-color: #6a11cb;
}
.preview-gallery-thumbnails .thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding-bottom: 20px;
    border-bottom: 1px solid #e5e7eb;
    margin-bottom: 20px;
}
.preview-title h1 {
    font-size: 2em;
    margin: 0 0 5px 0;
    font-weight: 700;
    color: #111827;
}
.preview-title .subtitle {
    font-size: 1.1em;
    color: #6b7280;
    margin: 0;
}
.preview-price .price-tag {
    background: linear-gradient(135deg, #2575fc 0%, #6a11cb 100%);
    color: white;
    padding: 10px 20px;
    font-size: 1.5em;
    font-weight: bold;
    border-radius: 8px;
}

.preview-section {
    margin-bottom: 30px;
}
.preview-section h3 {
    font-size: 1.4em;
    font-weight: 600;
    color: #111827;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e5e7eb;
}
.preview-description {
    font-size: 1.1em;
    line-height: 1.6;
    color: #374151;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
}
.feature-item {
    background-color: #ffffff;
    padding: 10px 15px;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
    font-size: 1em;
}
.feature-item strong {
    display: block;
    color: #6b7280;
    font-size: 0.9em;
    margin-bottom: 3px;
    text-transform: capitalize;
}
.feature-item span {
    font-weight: 500;
    color: #111827;
}
.feature-item.checked {
    color: #16a34a;
    font-weight: 500;
    border-left: 3px solid #16a34a;
    background-color: #f0fdf4;
}

/* ===== ESTILOS PARA VIDEOS Y SHORTS ===== */
.media-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}
.media-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background-color: #fff;
    border: 1px solid #e5e7eb;
    padding: 10px 20px;
    border-radius: 6px;
    text-decoration: none;
    color: #374151;
    font-weight: 500;
    transition: all 0.2s;
}
.media-item:hover {
    border-color: #6a11cb;
    color: #6a11cb;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}
.media-item .dashicons {
    font-size: 24px;
}



/* ==========================================================================
   18 - AJUSTES PARA EL BLOQUE DE PRECIOS MÚLTIPLES
   ========================================================================== */
/* Hace que los precios se apilen si hay más de uno */
.preview-price {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: flex-end;
}

/* Estilo para la etiqueta "Pago Único", "Abono Mensual", etc. */
.preview-price .price-op {
    display: block;
    text-align: right;
    font-size: 0.85em;
    color: #6b7280;
    margin-top: -5px; /* Acerca la etiqueta al precio */
    font-weight: 500;
}


