/* ============================================
   ESTILOS COMPLETOS PARA MODAL COMPARTIR PUBLICACIÓN
   Organizado por secciones para fácil identificación
   ============================================ */

/* ============================================
   📌 SECCIÓN 1: MODAL - ESTRUCTURA GENERAL
   Configuración básica del modal de compartir
   ============================================ */

#modalCompartirPublicacion .modal-dialog {
    max-width: 500px;
}

#modalCompartirPublicacion .modal-content {
    border: none;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
}

#modalCompartirPublicacion .modal-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    background: var(--white);
}

#modalCompartirPublicacion .modal-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
}

#modalCompartirPublicacion .modal-title i {
    font-size: 18px;
}

#modalCompartirPublicacion .modal-body {
    padding: 20px;
    background: var(--white);
}

#modalCompartirPublicacion .modal-footer {
    padding: 12px 20px;
    border-top: none;
    background: var(--white);
}

/* ============================================
   📌 SECCIÓN 2: HEADER DEL USUARIO
   Avatar y datos del usuario que comparte
   ============================================ */

.user-header-modal {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--light-bg);
    border-radius: var(--radius-md);
}

.user-header-modal .user-avatar {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
}

.user-header-modal .user-avatar img {
    width: 100%;
    height: 100%;
    border-radius: var(--radius-full);
    object-fit: cover;
}

.user-header-modal .avatar-placeholder {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 18px;
}

.user-header-modal .user-info h6 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    line-height: 1.3;
}

.user-header-modal .user-info small {
    font-size: 12px;
    color: var(--text-muted);
}

/* ============================================
   📌 SECCIÓN 3: SECCIÓN DE COMENTARIO
   Textarea para agregar comentario personal
   ============================================ */

.comment-section {
    margin-bottom: 16px;
}

.comment-textarea {
    width: 100%;
    min-height: 80px;
    max-height: 120px;
    padding: 12px 14px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-family: inherit;
    resize: none;
    transition: var(--transition);
    line-height: 1.5;
}

.comment-textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.1);
}

.comment-textarea::placeholder {
    color: var(--text-muted);
}

/* Contador de caracteres */
#charCountCompartir {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
    transition: color 0.2s ease;
}

/* Info de ayuda */
.comment-section small.text-muted {
    font-size: 11px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.comment-section small.text-muted i {
    font-size: 11px;
}

/* ============================================
   📌 SECCIÓN 4: DIVISOR
   Línea divisoria entre opciones
   ============================================ */

.share-divider {
    position: relative;
    text-align: center;
    margin: 20px 0;
}

.share-divider::before,
.share-divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 40%;
    height: 1px;
    background: var(--border-color);
}

.share-divider::before {
    left: 0;
}

.share-divider::after {
    right: 0;
}

.share-divider span {
    display: inline-block;
    padding: 0 12px;
    background: var(--white);
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
}

/* ============================================
   📌 SECCIÓN 5: OPCIONES DE COMPARTIR
   Botones de redes sociales y copiar enlace - UNA SOLA FILA
   ============================================ */

.share-options {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

/* Botón de opción de compartir */
.share-option-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 8px 4px;
    background: var(--light-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    color: var(--text-primary);
    min-width: 0; /* Permite que se encoja */
}

.share-option-btn:hover {
    background: var(--white);
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.share-option-btn:active {
    transform: translateY(0);
}

/* Efecto de éxito al copiar */
.share-option-btn.copy-success {
    background: #d4edda;
    border-color: var(--success-color);
    animation: pulse-success 0.3s ease;
}

@keyframes pulse-success {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* Icono de la opción - TAMAÑO REDUCIDO */
.share-option-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--white);
    border-radius: var(--radius-full);
    font-size: 14px;
    color: var(--text-secondary);
    transition: var(--transition);
    flex-shrink: 0;
}

.share-option-btn:hover .share-option-icon {
    transform: scale(1.1);
}

/* Colores específicos por red social */
.share-option-icon.whatsapp {
    background: #25D366;
    color: var(--white);
}

.share-option-icon.messenger {
    background: #0084FF;
    color: var(--white);
}

.share-option-icon.facebook {
    background: #1877F2;
    color: var(--white);
}

.share-option-btn:hover .share-option-icon.whatsapp {
    background: #20BA5A;
}

.share-option-btn:hover .share-option-icon.messenger {
    background: #0073E6;
}

.share-option-btn:hover .share-option-icon.facebook {
    background: #166FE5;
}

/* Texto de la opción - TAMAÑO REDUCIDO */
.share-option-btn span {
    font-size: 10px;
    font-weight: 500;
    color: var(--text-primary);
    line-height: 1.2;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
    padding: 0 2px;
}

/* ============================================
   📌 SECCIÓN 6: BOTONES DEL MODAL
   Botón principal de compartir y cancelar
   ============================================ */

#modalCompartirPublicacion .btn-primary {
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 600;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: var(--transition);
}

#modalCompartirPublicacion .btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

#modalCompartirPublicacion .btn-secondary {
    padding: 10px 20px;
    font-size: 13px;
    font-weight: 500;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    gap: 6px;
}

/* ============================================
   📌 SECCIÓN 7: RESPONSIVO - MÓVIL (640px)
   Ajustes para pantallas móviles
   ============================================ */

@media (max-width: 640px) {
    #modalCompartirPublicacion .modal-dialog {
        margin: 10px;
        max-width: none;
    }

    #modalCompartirPublicacion .modal-header {
        padding: 14px 16px;
    }

    #modalCompartirPublicacion .modal-title {
        font-size: 15px;
    }

    #modalCompartirPublicacion .modal-title i {
        font-size: 16px;
    }

    #modalCompartirPublicacion .modal-body {
        padding: 16px;
    }

    #modalCompartirPublicacion .modal-footer {
        padding: 12px 16px;
    }

    /* User header móvil */
    .user-header-modal {
        padding: 10px;
        gap: 10px;
    }

    .user-header-modal .user-avatar {
        width: 42px;
        height: 42px;
    }

    .user-header-modal .avatar-placeholder {
        width: 42px;
        height: 42px;
        font-size: 16px;
    }

    .user-header-modal .user-info h6 {
        font-size: 13px;
    }

    .user-header-modal .user-info small {
        font-size: 11px;
    }

    /* Comentario móvil */
    .comment-textarea {
        min-height: 70px;
        padding: 10px 12px;
        font-size: 13px;
    }

    .comment-section small.text-muted {
        font-size: 10px;
    }

    #charCountCompartir {
        font-size: 11px;
    }

    /* Divisor móvil */
    .share-divider span {
        font-size: 11px;
    }

    /* Opciones de compartir móvil - UNA SOLA FILA MÁS COMPACTA */
    .share-options {
        gap: 6px;
    }

    .share-option-btn {
        padding: 6px 2px;
        gap: 3px;
    }

    .share-option-icon {
        width: 32px;
        height: 32px;
        font-size: 13px;
    }

    .share-option-btn span {
        font-size: 9px;
    }

    /* Botones móvil */
    #modalCompartirPublicacion .btn-primary {
        padding: 10px 16px;
        font-size: 13px;
    }

    #modalCompartirPublicacion .btn-secondary {
        padding: 8px 16px;
        font-size: 12px;
    }
}

/* ============================================
   📌 SECCIÓN 8: RESPONSIVO - MÓVIL PEQUEÑO (480px)
   Ajustes para pantallas muy pequeñas
   ============================================ */

@media (max-width: 480px) {
    #modalCompartirPublicacion .modal-dialog {
        margin: 8px;
    }

    #modalCompartirPublicacion .modal-header {
        padding: 12px 14px;
    }

    #modalCompartirPublicacion .modal-title {
        font-size: 14px;
    }

    #modalCompartirPublicacion .modal-body {
        padding: 14px;
    }

    #modalCompartirPublicacion .modal-footer {
        padding: 10px 14px;
    }

    /* User header móvil pequeño */
    .user-header-modal {
        padding: 8px;
        gap: 8px;
    }

    .user-header-modal .user-avatar {
        width: 38px;
        height: 38px;
    }

    .user-header-modal .avatar-placeholder {
        width: 38px;
        height: 38px;
        font-size: 14px;
    }

    .user-header-modal .user-info h6 {
        font-size: 12px;
    }

    .user-header-modal .user-info small {
        font-size: 10px;
    }

    /* Comentario móvil pequeño */
    .comment-textarea {
        min-height: 60px;
        padding: 8px 10px;
        font-size: 12px;
    }

    .comment-section small.text-muted {
        font-size: 9px;
    }

    #charCountCompartir {
        font-size: 10px;
    }

    /* Divisor móvil pequeño */
    .share-divider {
        margin: 16px 0;
    }

    .share-divider span {
        font-size: 10px;
        padding: 0 10px;
    }

    /* Opciones de compartir móvil pequeño - UNA SOLA FILA ULTRA COMPACTA */
    .share-options {
        gap: 4px;
    }

    .share-option-btn {
        padding: 5px 2px;
        gap: 2px;
        border-radius: var(--radius-sm);
    }

    .share-option-icon {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }

    .share-option-btn span {
        font-size: 8px;
        letter-spacing: -0.2px;
    }

    /* Botones móvil pequeño */
    #modalCompartirPublicacion .btn-primary {
        padding: 8px 14px;
        font-size: 12px;
    }

    #modalCompartirPublicacion .btn-secondary {
        padding: 6px 14px;
        font-size: 11px;
    }
}

/* ============================================
   📌 SECCIÓN 9: RESPONSIVO - MÓVIL MUY PEQUEÑO (360px)
   Ajustes extremos para pantallas muy pequeñas
   ============================================ */

@media (max-width: 360px) {
    .share-options {
        gap: 3px;
    }

    .share-option-btn {
        padding: 4px 1px;
        gap: 2px;
    }

    .share-option-icon {
        width: 26px;
        height: 26px;
        font-size: 11px;
    }

    .share-option-btn span {
        font-size: 7.5px;
        letter-spacing: -0.3px;
    }
}