/* ========================================
   PÁGINA PUBLICAR - Viive
   ======================================== */

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

body {
    font-family: 'Poppins', sans-serif;
    background: #f0f4f8;
    color: #333;
    line-height: 1.6;
}

.pagina-publicar {
    min-height: 100vh;
}

/* Header */
.encabezado-publicar {
    background: white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    position: sticky;
    top: 0;
    z-index: 100;
}

.contenedor-header {
    margin: 0 auto;
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-publicar .logo-img {
    height: 48px;
    width: auto;
}

.menu-publicar {
    display: flex;
    gap: 1.5rem;
}

/* Enlaces del nav: colores unificados en /frontend/estilos.css (clase enlace-menu) */

/* Barra de sesión (publicar) - foto, correo, plan */
.barra-sesion-publicar {
    background: linear-gradient(135deg, #e8f5e9 0%, #f1f8e9 100%);
    border-bottom: 1px solid rgba(76, 175, 80, 0.2);
    padding: 0.6rem 1.5rem;
}
.barra-sesion-contenido {
    max-width: 1200px;
    margin: 0 auto;
}
.barra-sesion-usuario {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.barra-sesion-foto {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(76, 175, 80, 0.4);
}
.barra-sesion-inicial {
    display: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #4caf50;
    color: white;
    font-weight: 700;
    font-size: 1.1rem;
    align-items: center;
    justify-content: center;
}
.barra-sesion-inicial.visible {
    display: flex;
}
.barra-sesion-datos {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}
.barra-sesion-email {
    font-size: 0.9rem;
    color: #333;
    font-weight: 500;
}
.barra-sesion-plan {
    font-size: 0.8rem;
    color: #2e7d32;
    font-weight: 600;
}
.barra-sesion-cerrar-btn {
    font-size: 0.8rem;
    color: #1565c0;
    font-weight: 600;
    text-decoration: underline;
    margin-top: 0.25rem;
    margin-right: 0.5rem;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}
.barra-sesion-cerrar-btn:hover {
    color: #0d47a1;
}

/* MENÚ HAMBURGUESA - OCULTO EN DESKTOP */
.menu-hamburguesa {
    display: none;
}

/* MÓVIL Y TABLET: menú hamburguesa visible */
@media (max-width: 917px) {
    .contenedor-header {
        justify-content: space-between;
        align-items: center;
    }
    
    .menu-hamburguesa {
        display: flex;
        flex-direction: column;
        justify-content: space-around;
        width: 40px;
        height: 40px;
        background: transparent;
        border: none;
        cursor: pointer;
        padding: 6px;
        z-index: 1001;
        position: relative;
        border-radius: 6px;
        transition: background-color 0.3s ease;
    }
    
    .menu-hamburguesa:hover {
        background-color: rgba(76, 175, 80, 0.1);
    }
    
    .linea-hamburguesa {
        width: 28px;
        height: 3px;
        background: #4caf50;
        border-radius: 2px;
        transition: all 0.3s ease;
        transform-origin: center;
        display: block;
    }
    
    .menu-hamburguesa.menu-activo .linea-hamburguesa:nth-child(1) {
        transform: rotate(45deg) translate(7px, 7px);
    }
    
    .menu-hamburguesa.menu-activo .linea-hamburguesa:nth-child(2) {
        opacity: 0;
    }
    
    .menu-hamburguesa.menu-activo .linea-hamburguesa:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -7px);
    }
    
    .menu-publicar {
        position: fixed;
        top: 72px;
        left: -100%;
        width: 100%;
        height: calc(100vh - 72px);
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(20px);
        flex-direction: column;
        justify-content: flex-start;
        align-items: center;
        padding: 2rem 1.5rem;
        gap: 1rem;
        transition: left 0.3s ease;
        z-index: 1000;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    }
    
    .menu-publicar.menu-abierto {
        left: 0;
    }
}

/* DESKTOP: ocultar hamburguesa, menú horizontal */
@media (min-width: 918px) {
    .menu-hamburguesa {
        display: none !important;
    }
}

/* Contenido principal */
.contenido-publicar {
    max-width: 720px;
    margin: 0 auto;
    padding: 2rem 1.5rem 4rem;
}

/* Alerta login */
.alerta-login {
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    padding: 3rem;
    text-align: center;
}

.alerta-contenido i {
    font-size: 3rem;
    color: #9e9e9e;
    margin-bottom: 1rem;
}

.alerta-contenido h2 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.alerta-contenido p {
    color: #666;
    margin-bottom: 1.5rem;
}

.alerta-contenido .btn-login,
.alerta-contenido .btn-registro {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 600;
    margin: 0 0.5rem;
    transition: all 0.2s;
}

.alerta-contenido .btn-login {
    background: linear-gradient(135deg, #4caf50, #45a049);
    color: white;
}

.alerta-contenido .btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.4);
}

.alerta-contenido .btn-registro {
    background: #f5f5f5;
    color: #333;
}

.alerta-contenido .btn-registro:hover {
    background: #e0e0e0;
}

/* Formulario */
.formulario-publicar {
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    padding: 2rem;
}

.cabecera-formulario {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #eee;
}

.cabecera-formulario h1 {
    font-size: 1.75rem;
    color: #333;
    margin-bottom: 0.5rem;
}

.cabecera-formulario h1 i {
    color: #4caf50;
    margin-right: 0.5rem;
}

.subtitulo {
    color: #666;
    font-size: 0.95rem;
}

.mensaje-error {
    background: #ffebee;
    color: #c62828;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.mensaje-exito {
    background: #e8f5e9;
    color: #2e7d32;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.seccion-formulario {
    margin-bottom: 2rem;
}

.seccion-formulario h2 {
    font-size: 1.1rem;
    color: #555;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
}

.grid-campos {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

.campo {
    margin-bottom: 1rem;
}

.campo label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.4rem;
    font-size: 0.9rem;
}

.campo input,
.campo select,
.campo textarea {
    width: 100%;
    padding: 0.65rem 0.9rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-family: inherit;
    font-size: 1rem;
}

.campo input:focus,
.campo select:focus,
.campo textarea:focus {
    outline: none;
    border-color: #4caf50;
    box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.2);
}

.texto-ayuda {
    font-size: 0.85rem;
    color: #777;
    margin-bottom: 1rem;
}

/* Documentos */
.lista-documentos {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.item-documento {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.item-documento input[type="checkbox"] {
    width: auto;
    cursor: pointer;
}

.item-documento label {
    font-weight: 400;
    cursor: pointer;
    font-size: 0.9rem;
}

/* Acciones */
.acciones-formulario {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #eee;
}

.btn-enviar {
    background: linear-gradient(135deg, #4caf50, #45a049);
    color: white;
    border: none;
    padding: 0.9rem 2rem;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s;
}

.btn-enviar:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.4);
}

.btn-enviar:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Paso imágenes */
.paso-imagenes {
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    padding: 2rem;
    margin-top: 2rem;
}

.paso-imagenes-pendiente .zona-subida {
    opacity: 0.6;
    pointer-events: none;
    cursor: not-allowed;
}

.paso-imagenes-pendiente .acciones-imagenes .btn-subir-imagenes,
.paso-imagenes-pendiente .acciones-imagenes .btn-omitir {
    opacity: 0.6;
    pointer-events: none;
}

/* Mes gratis - días restantes */
.mes-gratis-container {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.item-mes-gratis {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    background: linear-gradient(135deg, #e8f5e9 0%, #f1f8e9 100%);
    border-radius: 10px;
    border-left: 3px solid #4caf50;
}

.mes-gratis-icono {
    color: #4caf50;
    font-size: 1.1rem;
}

.mes-gratis-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.mes-gratis-info strong {
    font-size: 0.95rem;
}

.mes-gratis-sub {
    font-size: 0.8rem;
    color: #666;
}

.mes-gratis-dias {
    font-size: 0.9rem;
    font-weight: 600;
    color: #2e7d32;
    background: rgba(76, 175, 80, 0.15);
    padding: 0.35rem 0.65rem;
    border-radius: 8px;
}

/* Mis cuotas */
.lista-cuotas {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.item-cuota {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 1.25rem;
    background: #f8fafc;
    border-radius: 12px;
    border-left: 4px solid #4caf50;
}

.item-cuota-vencido {
    border-left-color: #f44336;
}

.item-cuota-pagado {
    border-left-color: #9e9e9e;
    opacity: 0.85;
}

.cuota-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.cuota-info strong {
    font-size: 1rem;
}

.cuota-ciudad, .cuota-fecha {
    font-size: 0.9rem;
    color: #666;
}

.cuota-plan-dia1 {
    font-size: 0.85rem;
    color: #2e7d32;
    font-weight: 500;
}

.cuota-monto {
    font-weight: 600;
    color: #333;
    margin-top: 0.25rem;
}

.cuota-estado {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.badge {
    padding: 0.25rem 0.6rem;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: capitalize;
}

.badge-pendiente {
    background: #fff3e0;
    color: #e65100;
}

.badge-vencido {
    background: #ffebee;
    color: #c62828;
}

.badge-pagado {
    background: #e8f5e9;
    color: #2e7d32;
}

.btn-pagar {
    padding: 0.5rem 1rem;
    border-radius: 8px;
    border: none;
    background: #4caf50;
    color: white;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-pagar:hover {
    background: #43a047;
}

.sin-cuotas {
    text-align: center;
    padding: 2rem;
    color: #666;
}

.sin-cuotas p {
    margin-bottom: 0.5rem;
}

.mensaje-oculto {
    display: none !important;
}

.cabecera-imagenes {
    margin-bottom: 1.5rem;
}

.cabecera-imagenes h2 {
    font-size: 1.25rem;
    margin-bottom: 0.25rem;
}

.cabecera-imagenes h2 i {
    color: #4caf50;
    margin-right: 0.5rem;
}

.zona-subida {
    border: 2px dashed #ccc;
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}

.zona-subida:hover,
.zona-subida.dragover {
    border-color: #4caf50;
    background: rgba(76, 175, 80, 0.05);
}

.zona-subida p {
    color: #666;
    margin: 0.25rem 0;
}

.zona-subida .hint {
    font-size: 0.85rem;
    color: #999;
}

.zona-subida input[type="file"] {
    display: none;
}

.preview-imagenes {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 0.75rem;
    margin: 1.5rem 0;
}

.preview-item {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    aspect-ratio: 1;
}

.preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.preview-item .preview-remove {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(0,0,0,0.6);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
}

.acciones-imagenes {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.btn-subir-imagenes {
    background: linear-gradient(135deg, #4caf50, #45a049);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-subir-imagenes:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-omitir {
    color: #666;
    text-decoration: none;
    font-size: 0.9rem;
}

.btn-omitir:hover {
    color: #4caf50;
}

/* Toast */
.mensaje-toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    padding: 1rem 1.5rem;
    border-radius: 10px;
    color: white;
    font-weight: 500;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    z-index: 1000;
    opacity: 0;
    transition: all 0.3s ease;
}

.mensaje-toast.mostrar {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.mensaje-toast.exito {
    background: #4caf50;
}

.mensaje-toast.error {
    background: #f44336;
}

/* Mis publicaciones - Dashboard */
.lista-publicaciones {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.item-publicacion {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: #f8fafc;
    border-radius: 12px;
    border-left: 4px solid #4caf50;
    flex-wrap: wrap;
}

.item-pub-imagen {
    width: 70px;
    height: 70px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
}

.item-pub-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.item-pub-sin-img {
    width: 100%;
    height: 100%;
    background: #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 1.5rem;
}

.item-pub-info {
    flex: 1;
    min-width: 150px;
}

.item-pub-info strong {
    display: block;
    font-size: 1rem;
}

.item-pub-ciudad, .item-pub-precio {
    font-size: 0.9rem;
    color: #666;
}

.item-pub-estado {
    display: inline-block;
    margin-top: 0.25rem;
}

.badge-activa {
    background: #e8f5e9;
    color: #2e7d32;
}

.badge-inactiva {
    background: #f5f5f5;
    color: #666;
}

.item-pub-stats {
    text-align: center;
}

.item-pub-stats .stat-vistas {
    display: block;
    font-size: 1.25rem;
    font-weight: 600;
    color: #4caf50;
}

.item-pub-stats small {
    font-size: 0.75rem;
    color: #888;
}

.btn-ver-detalle {
    padding: 0.5rem 1rem;
    border-radius: 8px;
    border: none;
    background: #4caf50;
    color: white;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.btn-ver-detalle:hover {
    background: #43a047;
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
}

.modal-contenido {
    background: white;
    border-radius: 16px;
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    padding: 2rem;
    position: relative;
}

.modal-cerrar {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 36px;
    height: 36px;
    border: none;
    background: #f5f5f5;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
}

.modal-cerrar:hover {
    background: #e0e0e0;
}

.modal-contenido h2 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
}

.modal-contenido h2 i, .modal-contenido h3 i {
    color: #4caf50;
    margin-right: 0.5rem;
}

.modal-contenido h3 {
    font-size: 1rem;
    margin: 1.5rem 0 0.75rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.stat-card {
    background: #f8fafc;
    padding: 1rem;
    border-radius: 10px;
    text-align: center;
}

.stat-numero {
    display: block;
    font-size: 1.75rem;
    font-weight: 700;
    color: #4caf50;
}

.stat-etiqueta {
    font-size: 0.85rem;
    color: #666;
}

.lista-visualizaciones {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.item-vista {
    display: flex;
    gap: 1rem;
    padding: 0.75rem;
    background: #f8fafc;
    border-radius: 10px;
}

.vista-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    flex-shrink: 0;
}

.vista-info {
    flex: 1;
}

.vista-info strong {
    display: block;
    font-size: 0.95rem;
}

.vista-info a {
    display: block;
    font-size: 0.85rem;
    color: #4caf50;
    text-decoration: none;
    margin-top: 0.25rem;
}

.vista-info a:hover {
    text-decoration: underline;
}

.vista-info .anonimo {
    font-size: 0.85rem;
    color: #999;
}

.vista-fecha {
    display: block;
    font-size: 0.8rem;
    color: #888;
    margin-top: 0.25rem;
}

.sin-vistas {
    color: #666;
    font-style: italic;
    padding: 1rem 0;
}
